aboutsummaryrefslogtreecommitdiff
path: root/gui/dialog.cpp
diff options
context:
space:
mode:
authorOleksiy Kurochko2012-05-03 19:32:08 +0300
committerEugene Sandulenko2012-05-03 19:32:08 +0300
commite6c317a9226b71af572d2e2004e307c0e895b77c (patch)
tree985d9069de0b156803a306da494ea7fd92d7c5c5 /gui/dialog.cpp
parent8d157ae1858c6aab2acc78c732b547dd4e94723a (diff)
downloadscummvm-rg350-e6c317a9226b71af572d2e2004e307c0e895b77c.tar.gz
scummvm-rg350-e6c317a9226b71af572d2e2004e307c0e895b77c.tar.bz2
scummvm-rg350-e6c317a9226b71af572d2e2004e307c0e895b77c.zip
GUI: Implemented pressed state for buttons
Diffstat (limited to 'gui/dialog.cpp')
-rw-r--r--gui/dialog.cpp13
1 files changed, 11 insertions, 2 deletions
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) {