diff options
Diffstat (limited to 'gui/widgets')
-rw-r--r-- | gui/widgets/editable.cpp | 4 | ||||
-rw-r--r-- | gui/widgets/editable.h | 8 | ||||
-rw-r--r-- | gui/widgets/edittext.cpp | 9 | ||||
-rw-r--r-- | gui/widgets/edittext.h | 6 | ||||
-rw-r--r-- | gui/widgets/list.cpp | 1 | ||||
-rw-r--r-- | gui/widgets/popup.cpp | 2 | ||||
-rw-r--r-- | gui/widgets/scrollbar.cpp | 7 | ||||
-rw-r--r-- | gui/widgets/tab.cpp | 1 |
8 files changed, 24 insertions, 14 deletions
diff --git a/gui/widgets/editable.cpp b/gui/widgets/editable.cpp index 7d6e0fae01..2ee3575bc6 100644 --- a/gui/widgets/editable.cpp +++ b/gui/widgets/editable.cpp @@ -22,9 +22,11 @@ * $Id$ */ -#include "common/events.h" +#include "common/rect.h" +#include "common/system.h" #include "gui/widgets/editable.h" #include "gui/gui-manager.h" +#include "graphics/font.h" namespace GUI { diff --git a/gui/widgets/editable.h b/gui/widgets/editable.h index b394e105d1..e0b6375919 100644 --- a/gui/widgets/editable.h +++ b/gui/widgets/editable.h @@ -25,9 +25,15 @@ #ifndef GUI_WIDGETS_EDITABLE_H #define GUI_WIDGETS_EDITABLE_H +#include "common/keyboard.h" #include "common/str.h" -#include "common/rect.h" #include "gui/widget.h" +#include "gui/ThemeEngine.h" +#include "gui/object.h" + +namespace Common { +struct Rect; +} namespace GUI { diff --git a/gui/widgets/edittext.cpp b/gui/widgets/edittext.cpp index 3ef813283e..106262bafe 100644 --- a/gui/widgets/edittext.cpp +++ b/gui/widgets/edittext.cpp @@ -23,25 +23,26 @@ */ #include "gui/widgets/edittext.h" -#include "gui/dialog.h" #include "gui/gui-manager.h" #include "gui/ThemeEval.h" namespace GUI { -EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip, uint32 cmd) + EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd) : EditableWidget(boss, x, y - 1, w, h + 2, tooltip, cmd) { setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE); _type = kEditTextWidget; + _finishCmd = finishCmd; setEditString(text); } -EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip, uint32 cmd) +EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd) : EditableWidget(boss, name, tooltip, cmd) { setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE); _type = kEditTextWidget; + _finishCmd = finishCmd; setEditString(text); } @@ -107,6 +108,8 @@ void EditTextWidget::startEditMode() { void EditTextWidget::endEditMode() { releaseFocus(); + + sendCommand(_finishCmd, 0); } void EditTextWidget::abortEditMode() { diff --git a/gui/widgets/edittext.h b/gui/widgets/edittext.h index a2549882ca..b94e58780c 100644 --- a/gui/widgets/edittext.h +++ b/gui/widgets/edittext.h @@ -41,8 +41,8 @@ protected: int _rightPadding; public: - EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0); - EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0); + EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0, uint32 finishCmd = 0); + EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0, uint32 finishCmd = 0); void setEditString(const String &str); @@ -62,6 +62,8 @@ protected: void abortEditMode(); Common::Rect getEditRect() const; + + uint32 _finishCmd; }; } // End of namespace GUI diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp index 1e13226d61..1f7846c503 100644 --- a/gui/widgets/list.cpp +++ b/gui/widgets/list.cpp @@ -23,7 +23,6 @@ */ #include "common/system.h" -#include "common/events.h" #include "common/frac.h" #include "common/tokenizer.h" diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp index 02cbd940b2..cab556065f 100644 --- a/gui/widgets/popup.cpp +++ b/gui/widgets/popup.cpp @@ -23,11 +23,9 @@ */ #include "common/system.h" -#include "common/events.h" #include "gui/dialog.h" #include "gui/gui-manager.h" #include "gui/widgets/popup.h" -#include "engines/engine.h" #include "gui/ThemeEval.h" diff --git a/gui/widgets/scrollbar.cpp b/gui/widgets/scrollbar.cpp index 5e963e04fe..38383c0e55 100644 --- a/gui/widgets/scrollbar.cpp +++ b/gui/widgets/scrollbar.cpp @@ -22,11 +22,12 @@ * $Id$ */ +#include "common/rect.h" +#include "common/system.h" +#include "common/timer.h" #include "gui/widgets/scrollbar.h" -#include "gui/dialog.h" #include "gui/gui-manager.h" - -#include "common/timer.h" +#include "gui/ThemeEngine.h" namespace GUI { diff --git a/gui/widgets/tab.cpp b/gui/widgets/tab.cpp index 10baeac901..721fb88cf8 100644 --- a/gui/widgets/tab.cpp +++ b/gui/widgets/tab.cpp @@ -24,7 +24,6 @@ #include "common/util.h" #include "gui/widgets/tab.h" -#include "gui/dialog.h" #include "gui/gui-manager.h" #include "gui/ThemeEval.h" |