(svn r24733) -Codechange: Move handling of editbox keys to window class.

This commit is contained in:
frosch
2012-11-13 21:47:02 +00:00
parent 7699a7dc06
commit c4d7c8dd42
13 changed files with 34 additions and 94 deletions

View File

@@ -306,12 +306,10 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
EventState state = ES_NOT_HANDLED;
if (this->HandleEditBoxKey(WID_SIL_FILTER_TEXT, key, keycode, state) == HEBR_NOT_FOCUSED) {
if (CheckHotkeyMatch(signlist_hotkeys, keycode, this) == SLHK_FOCUS_FILTER_BOX) {
this->SetFocusedWidget(WID_SIL_FILTER_TEXT);
SetFocusedWindow(this); // The user has asked to give focus to the text box, so make sure this window is focused.
state = ES_HANDLED;
}
if (CheckHotkeyMatch(signlist_hotkeys, keycode, this) == SLHK_FOCUS_FILTER_BOX) {
this->SetFocusedWidget(WID_SIL_FILTER_TEXT);
SetFocusedWindow(this); // The user has asked to give focus to the text box, so make sure this window is focused.
state = ES_HANDLED;
}
return state;
@@ -540,13 +538,6 @@ struct SignWindow : QueryStringBaseWindow, SignList {
break;
}
}
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
EventState state = ES_NOT_HANDLED;
this->HandleEditBoxKey(WID_QES_TEXT, key, keycode, state);
return state;
}
};
static const NWidgetPart _nested_query_sign_edit_widgets[] = {