aboutsummaryrefslogtreecommitdiff
path: root/gui/editable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/editable.cpp')
-rw-r--r--gui/editable.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/gui/editable.cpp b/gui/editable.cpp
index 38dcb1ecf5..232873ffe3 100644
--- a/gui/editable.cpp
+++ b/gui/editable.cpp
@@ -28,13 +28,13 @@
namespace GUI {
-EditableWidget::EditableWidget(GuiObject *boss, int x, int y, int w, int h)
- : Widget(boss, x, y, w, h) {
+EditableWidget::EditableWidget(GuiObject *boss, int x, int y, int w, int h, uint32 cmd)
+ : Widget(boss, x, y, w, h), CommandSender(boss), _cmd(cmd) {
init();
}
-EditableWidget::EditableWidget(GuiObject *boss, const String &name)
- : Widget(boss, name) {
+EditableWidget::EditableWidget(GuiObject *boss, const String &name, uint32 cmd)
+ : Widget(boss, name), CommandSender(boss), _cmd(cmd) {
init();
}
@@ -109,6 +109,8 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) {
_caretPos--;
_editString.deleteChar(_caretPos);
dirty = true;
+
+ sendCommand(_cmd, 0);
}
forcecaret = true;
break;
@@ -116,6 +118,8 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) {
if (_caretPos < (int)_editString.size()) {
_editString.deleteChar(_caretPos);
dirty = true;
+
+ sendCommand(_cmd, 0);
}
forcecaret = true;
break;
@@ -146,6 +150,8 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) {
_caretPos++;
dirty = true;
forcecaret = true;
+
+ sendCommand(_cmd, 0);
} else {
handled = false;
}