aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2005-03-27 11:27:07 +0000
committerMax Horn2005-03-27 11:27:07 +0000
commite80cdab64bc7f26a1be67d72e0b0028d767adbe8 (patch)
tree8dd8f88a54b944012a84f15782e273ae400b52bf
parentabcf7bf2de88c3926843fa3fd613e50f5ea63cd5 (diff)
downloadscummvm-rg350-e80cdab64bc7f26a1be67d72e0b0028d767adbe8.tar.gz
scummvm-rg350-e80cdab64bc7f26a1be67d72e0b0028d767adbe8.tar.bz2
scummvm-rg350-e80cdab64bc7f26a1be67d72e0b0028d767adbe8.zip
Patch #1171300: ListWidget + Chooser Patch
svn-id: r17260
-rw-r--r--gui/ListWidget.cpp2
-rw-r--r--gui/ListWidget.h2
-rw-r--r--gui/chooser.cpp1
3 files changed, 4 insertions, 1 deletions
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index f4a0a81e84..d2229a31f3 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -380,6 +380,8 @@ void ListWidget::startEditMode() {
}
void ListWidget::endEditMode() {
+ if(!_editMode)
+ return;
// send a message that editing finished with a return/enter key press
_editMode = false;
_list[_selectedItem] = _editString;
diff --git a/gui/ListWidget.h b/gui/ListWidget.h
index 36ce8150c0..6d36fc4502 100644
--- a/gui/ListWidget.h
+++ b/gui/ListWidget.h
@@ -86,6 +86,7 @@ public:
// Made startEditMode for SCUMM's SaveLoadChooser
void startEditMode();
+ void endEditMode();
protected:
void drawWidget(bool hilite);
@@ -93,7 +94,6 @@ protected:
int findItem(int x, int y) const;
void scrollBarRecalc();
- void endEditMode();
void abortEditMode();
Common::Rect getEditRect() const;
diff --git a/gui/chooser.cpp b/gui/chooser.cpp
index e1a8184f7f..429d60b171 100644
--- a/gui/chooser.cpp
+++ b/gui/chooser.cpp
@@ -53,6 +53,7 @@ void ChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
switch (cmd) {
case kChooseCmd:
case kListItemDoubleClickedCmd:
+ _list->endEditMode();
setResult(item);
close();
break;