diff options
author | frosch <frosch@openttd.org> | 2012-11-14 22:50:35 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-11-14 22:50:35 +0000 |
commit | f5d8ba5d7f90abc72db6c0470da383ecf82da487 (patch) | |
tree | 3dbbbbe18733005c5851251dac62314d871b2b30 /src/newgrf_gui.cpp | |
parent | dcfb2af871b76a7b65fb959b2f4ebc2da2f9e4d3 (diff) | |
download | openttd-f5d8ba5d7f90abc72db6c0470da383ecf82da487.tar.xz |
(svn r24742) -Codechange: Remove QueryStringBaseWindow and store QueryStrings per widget instead.
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r-- | src/newgrf_gui.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 1fa6d47e3..bf6487d10 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -585,7 +585,7 @@ static void NewGRFConfirmationCallback(Window *w, bool confirmed); /** * Window for showing NewGRF files */ -struct NewGRFWindow : public QueryStringBaseWindow, NewGRFScanCallback { +struct NewGRFWindow : public Window, NewGRFScanCallback { typedef GUIList<const GRFConfig *, StringFilter &> GUIGRFConfigList; static const uint EDITBOX_MAX_SIZE = 50; @@ -599,6 +599,7 @@ struct NewGRFWindow : public QueryStringBaseWindow, NewGRFScanCallback { const GRFConfig *avail_sel; ///< Currently selected available grf. \c NULL is none is selected. int avail_pos; ///< Index of #avail_sel if existing, else \c -1. StringFilter string_filter; ///< Filter for available grf. + QueryString filter_editbox; ///< Filter editbox; GRFConfig *actives; ///< Temporary active grf list to which changes are made. GRFConfig *active_sel; ///< Selected active grf item. @@ -613,7 +614,7 @@ struct NewGRFWindow : public QueryStringBaseWindow, NewGRFScanCallback { Scrollbar *vscroll; Scrollbar *vscroll2; - NewGRFWindow(const WindowDesc *desc, bool editable, bool show_params, bool execute, GRFConfig **orig_list) : QueryStringBaseWindow(EDITBOX_MAX_SIZE) + NewGRFWindow(const WindowDesc *desc, bool editable, bool show_params, bool execute, GRFConfig **orig_list) : filter_editbox(EDITBOX_MAX_SIZE) { this->avail_sel = NULL; this->avail_pos = -1; @@ -637,6 +638,7 @@ struct NewGRFWindow : public QueryStringBaseWindow, NewGRFScanCallback { this->GetWidget<NWidgetStacked>(WID_NS_SHOW_APPLY)->SetDisplayedPlane(this->editable ? 0 : this->show_params ? 1 : SZSP_HORIZONTAL); this->FinishInitNested(desc, WN_GAME_OPTIONS_NEWGRF_STATE); + this->querystrings[WID_NS_FILTER] = &this->filter_editbox; this->SetFocusedWidget(WID_NS_FILTER); this->avails.SetListing(this->last_sorting); @@ -1279,7 +1281,7 @@ struct NewGRFWindow : public QueryStringBaseWindow, NewGRFScanCallback { { if (!this->editable) return; - string_filter.SetFilterTerm(this->text.buf); + string_filter.SetFilterTerm(this->filter_editbox.text.buf); this->avails.SetFilterState(!string_filter.IsEmpty()); this->avails.ForceRebuild(); this->InvalidateData(0); |