aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Bacca2004-01-28 01:09:08 +0000
committerNicolas Bacca2004-01-28 01:09:08 +0000
commit2ff396d7e8682ae5b06c54a57f3ceefed01e20e3 (patch)
tree20ce2113539518734a0db8d4054309adb4b6e671
parent4793b48326a111e05deb76d61b5bbbcc965d861d (diff)
downloadscummvm-rg350-2ff396d7e8682ae5b06c54a57f3ceefed01e20e3.tar.gz
scummvm-rg350-2ff396d7e8682ae5b06c54a57f3ceefed01e20e3.tar.bz2
scummvm-rg350-2ff396d7e8682ae5b06c54a57f3ceefed01e20e3.zip
640x480 toolbar fixes, don't draw an invisible toolbar
svn-id: r12644
-rw-r--r--backends/wince/CEgui/Panel.cpp2
-rw-r--r--backends/wince/CEgui/Toolbar.cpp6
-rw-r--r--backends/wince/CEgui/ToolbarHandler.cpp17
-rw-r--r--backends/wince/CEgui/ToolbarHandler.h3
4 files changed, 22 insertions, 6 deletions
diff --git a/backends/wince/CEgui/Panel.cpp b/backends/wince/CEgui/Panel.cpp
index 012742740e..d29f4004e2 100644
--- a/backends/wince/CEgui/Panel.cpp
+++ b/backends/wince/CEgui/Panel.cpp
@@ -43,7 +43,7 @@ namespace CEGUI {
bool Panel::draw(SDL_Surface *surface) {
ItemMap::ConstIterator iterator;
- if (!_drawn) {
+ if (!_drawn && _visible) {
GUIElement::draw(surface);
for (iterator = _itemsMap.begin(); iterator != _itemsMap.end(); ++iterator) {
((GUIElement*)(iterator->_value))->draw(surface);
diff --git a/backends/wince/CEgui/Toolbar.cpp b/backends/wince/CEgui/Toolbar.cpp
index dff2ca63ec..af5229bef0 100644
--- a/backends/wince/CEgui/Toolbar.cpp
+++ b/backends/wince/CEgui/Toolbar.cpp
@@ -24,12 +24,12 @@
namespace CEGUI {
- // FIXME (could be game dependant)
- Toolbar::Toolbar() : GUIElement(0, 200, 320, 40)
+ // Not to be drawn on game screen !
+ Toolbar::Toolbar() : GUIElement(0, 0, 320, 40)
{
}
Toolbar::~Toolbar() {
}
-} \ No newline at end of file
+}
diff --git a/backends/wince/CEgui/ToolbarHandler.cpp b/backends/wince/CEgui/ToolbarHandler.cpp
index 6703dde34a..430f2da105 100644
--- a/backends/wince/CEgui/ToolbarHandler.cpp
+++ b/backends/wince/CEgui/ToolbarHandler.cpp
@@ -58,8 +58,13 @@ namespace CEGUI {
}
bool ToolbarHandler::action(int x, int y, bool pushed) {
- if (_active)
- return _active->action(x, y, pushed);
+ if (_active) {
+ // FIXME !
+ if (_offset > 240)
+ return _active->action(x / 2, (y - _offset) / 2, pushed);
+ else
+ return _active->action(x, y - _offset, pushed);
+ }
else
return false;
}
@@ -103,6 +108,14 @@ namespace CEGUI {
return false;
}
+ void ToolbarHandler::setOffset(int offset) {
+ _offset = offset;
+ }
+
+ int ToolbarHandler::getOffset() {
+ return _offset;
+ }
+
Toolbar* ToolbarHandler::active() {
return _active;
}
diff --git a/backends/wince/CEgui/ToolbarHandler.h b/backends/wince/CEgui/ToolbarHandler.h
index 8c2f62ce07..9a62ab9881 100644
--- a/backends/wince/CEgui/ToolbarHandler.h
+++ b/backends/wince/CEgui/ToolbarHandler.h
@@ -45,6 +45,8 @@ namespace CEGUI {
bool visible();
String activeName();
void forceRedraw();
+ void setOffset(int offset);
+ int getOffset();
bool draw(SDL_Surface *surface, SDL_Rect *rect);
bool drawn();
Toolbar *active();
@@ -59,6 +61,7 @@ namespace CEGUI {
Map<String, Toolbar*, IgnoreCaseComparator> _toolbarMap;
String _current;
Toolbar *_active;
+ int _offset;
};
}