(svn r24735) -Codechange: Move HandleEditBoxKey to Window class.

This commit is contained in:
frosch
2012-11-13 21:47:13 +00:00
parent f1d40ca6f2
commit 2ccba5e6c5
4 changed files with 43 additions and 31 deletions

View File

@@ -811,33 +811,6 @@ void QueryString::DrawEditBox(const Window *w, int wid) const
_cur_dpi = old_dpi;
}
EventState QueryStringBaseWindow::HandleEditBoxKey(int wid, uint16 key, uint16 keycode)
{
EventState state = ES_NOT_HANDLED;
switch (this->QueryString::HandleEditBoxKey(this, wid, key, keycode, state)) {
case HEBR_EDITING:
this->OnEditboxChanged(wid);
break;
case HEBR_CONFIRM:
if (this->ok_button >= 0) {
this->OnClick(Point(), this->ok_button, 1);
}
break;
case HEBR_CANCEL:
if (this->cancel_button >= 0) {
this->OnClick(Point(), this->cancel_button, 1);
} else {
this->UnfocusFocusedWidget();
}
break;
default: break;
}
return state;
}
/** Class for the string query window. */
struct QueryStringWindow : public QueryStringBaseWindow
{