diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-07 12:45:31 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-07 12:45:31 +0000 |
commit | 5d94840c848fb0c41fb2c1d92488510936acdcd2 (patch) | |
tree | 5f2885924d1779fe8e385a1b4adff3d7a24bacd0 /src/gui | |
parent | 7692d16b78efd8a4f683150094065079df84461d (diff) | |
download | mana-5d94840c848fb0c41fb2c1d92488510936acdcd2.tar.gz mana-5d94840c848fb0c41fb2c1d92488510936acdcd2.tar.bz2 mana-5d94840c848fb0c41fb2c1d92488510936acdcd2.tar.xz mana-5d94840c848fb0c41fb2c1d92488510936acdcd2.zip |
Solved the window dragging problem.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui.cpp | 7 | ||||
-rw-r--r-- | src/gui/window.cpp | 12 | ||||
-rw-r--r-- | src/gui/window.h | 2 |
3 files changed, 16 insertions, 5 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index c227f05f..5cd475af 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -28,10 +28,7 @@ #include "../log.h" #include "../sound/sound.h" #include "allegroinput.h" - -#ifndef WIN32 -#define __cdecl __attribute__((cdecl)) -#endif +#include "windowcontainer.h" #define GUI_BMP_COUNT 11 #define GUI_BMP_OFS_BUTTON 0 @@ -71,7 +68,7 @@ Gui::Gui(BITMAP *screen) gcn::Image::setImageLoader(imageLoader); // Initialize top GUI widget - guiTop = new gcn::Container(); + guiTop = new WindowContainer(); guiTop->setDimension(gcn::Rectangle(0, 0, SCREEN_W, SCREEN_H)); guiTop->setOpaque(false); diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 632ad303..52665213 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -215,3 +215,15 @@ void Window::mouseOut() { mouseDown = false; } + +void Window::_mouseInputMessage(const gcn::MouseInput &mouseInput) +{ + if (mouseInput.getType() == gcn::MouseInput::MOTION && mouseDown) { + // It's a window drag event + gcn::Widget::_mouseInputMessage(mouseInput); + } + else { + // It's something else + gcn::Container::_mouseInputMessage(mouseInput); + } +} diff --git a/src/gui/window.h b/src/gui/window.h index 58f0e9b7..0a0170d8 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -117,6 +117,8 @@ class Window : public gcn::Container, public gcn::MouseListener void mouseRelease(int mx, int my, int button); void mouseMotion(int mx, int my); void mouseOut(); + + void _mouseInputMessage(const gcn::MouseInput &mouseInput); }; #endif |