From d12f21b31db2985faeb2e2a6b9b09cd210f82c34 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Wed, 22 Feb 2012 18:30:47 -0600 Subject: KEYMAPPER: Map non-key custom input events This also makes the keymapper be in charge of keymapping logic --- gui/dialog.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gui/dialog.cpp') diff --git a/gui/dialog.cpp b/gui/dialog.cpp index fd15ba5e09..2201e83ca5 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -21,6 +21,10 @@ #include "common/rect.h" +#ifdef ENABLE_KEYMAPPER +#include "common/events.h" +#endif + #include "gui/gui-manager.h" #include "gui/dialog.h" #include "gui/widget.h" @@ -314,6 +318,9 @@ void Dialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { } } +#ifdef ENABLE_KEYMAPPER +void Dialog::handleOtherEvent(Common::Event evt) { } +#endif /* * Determine the widget at location (x,y) if any. Assumes the coordinates are * in the local coordinate system, i.e. relative to the top left of the dialog. -- cgit v1.2.3 From e6c317a9226b71af572d2e2004e307c0e895b77c Mon Sep 17 00:00:00 2001 From: Oleksiy Kurochko Date: Thu, 3 May 2012 19:32:08 +0300 Subject: GUI: Implemented pressed state for buttons --- gui/dialog.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gui/dialog.cpp') diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 2201e83ca5..ffca15bbc8 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -42,7 +42,7 @@ namespace GUI { Dialog::Dialog(int x, int y, int w, int h) : GuiObject(x, y, w, h), - _mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), + _mouseWidget(0), _focusedWidget(0), _dragWidget(0), _tickleWidget(0), _visible(false), _backgroundType(GUI::ThemeEngine::kDialogBackgroundDefault) { // Some dialogs like LauncherDialog use internally a fixed size, even though // their widgets rely on the layout to be initialized correctly by the theme. @@ -54,7 +54,7 @@ Dialog::Dialog(int x, int y, int w, int h) Dialog::Dialog(const Common::String &name) : GuiObject(name), - _mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), + _mouseWidget(0), _focusedWidget(0), _dragWidget(0), _tickleWidget(0), _visible(false), _backgroundType(GUI::ThemeEngine::kDialogBackgroundDefault) { // It may happen that we have 3x scaler in launcher (960xY) and then 640x480 @@ -117,6 +117,12 @@ void Dialog::reflowLayout() { GuiObject::reflowLayout(); } +void Dialog::lostFocus() { + if (_tickleWidget) { + _tickleWidget->lostFocus(); + } +} + void Dialog::setFocusWidget(Widget *widget) { // The focus will change. Tell the old focused widget (if any) // that it lost the focus. @@ -308,6 +314,9 @@ void Dialog::handleTickle() { // Focused widget receives tickle notifications if (_focusedWidget && _focusedWidget->getFlags() & WIDGET_WANT_TICKLE) _focusedWidget->handleTickle(); + + if (_tickleWidget && _tickleWidget->getFlags() & WIDGET_WANT_TICKLE) + _tickleWidget->handleTickle(); } void Dialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { -- cgit v1.2.3