summaryrefslogtreecommitdiff
path: root/src/settings_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-14 22:50:35 +0000
committerfrosch <frosch@openttd.org>2012-11-14 22:50:35 +0000
commitf5d8ba5d7f90abc72db6c0470da383ecf82da487 (patch)
tree3dbbbbe18733005c5851251dac62314d871b2b30 /src/settings_gui.cpp
parentdcfb2af871b76a7b65fb959b2f4ebc2da2f9e4d3 (diff)
downloadopenttd-f5d8ba5d7f90abc72db6c0470da383ecf82da487.tar.xz
(svn r24742) -Codechange: Remove QueryStringBaseWindow and store QueryStrings per widget instead.
Diffstat (limited to 'src/settings_gui.cpp')
-rw-r--r--src/settings_gui.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 30225f5b0..8cef170d4 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1956,7 +1956,7 @@ static const StringID _game_settings_restrict_dropdown[] = {
};
assert_compile(lengthof(_game_settings_restrict_dropdown) == RM_END);
-struct GameSettingsWindow : QueryStringBaseWindow {
+struct GameSettingsWindow : Window {
static const int SETTINGTREE_LEFT_OFFSET = 5; ///< Position of left edge of setting values
static const int SETTINGTREE_RIGHT_OFFSET = 5; ///< Position of right edge of setting values
static const int SETTINGTREE_TOP_OFFSET = 5; ///< Position of top edge of setting values
@@ -1971,13 +1971,14 @@ struct GameSettingsWindow : QueryStringBaseWindow {
bool closing_dropdown; ///< True, if the dropdown list is currently closing.
StringFilter string_filter; ///< Text filter for settings.
+ QueryString filter_editbox; ///< Filter editbox;
bool manually_changed_folding; ///< Whether the user expanded/collapsed something manually.
RestrictionMode cur_restriction_mode; ///< Currently selected index of the drop down list for the restrict drop down.
Scrollbar *vscroll;
- GameSettingsWindow(const WindowDesc *desc) : QueryStringBaseWindow(50), cur_restriction_mode((RestrictionMode)_settings_client.gui.settings_restriction_mode)
+ GameSettingsWindow(const WindowDesc *desc) : filter_editbox(50), cur_restriction_mode((RestrictionMode)_settings_client.gui.settings_restriction_mode)
{
static bool first_time = true;
@@ -2002,6 +2003,7 @@ struct GameSettingsWindow : QueryStringBaseWindow {
this->vscroll = this->GetScrollbar(WID_GS_SCROLLBAR);
this->FinishInitNested(desc, WN_GAME_OPTIONS_GAME_SETTINGS);
+ this->querystrings[WID_GS_FILTER] = &this->filter_editbox;
this->SetFocusedWidget(WID_GS_FILTER);
this->InvalidateData();
@@ -2408,7 +2410,7 @@ struct GameSettingsWindow : QueryStringBaseWindow {
virtual void OnEditboxChanged(int wid)
{
if (wid == WID_GS_FILTER) {
- string_filter.SetFilterTerm(this->text.buf);
+ string_filter.SetFilterTerm(this->filter_editbox.text.buf);
if (!string_filter.IsEmpty() && !this->manually_changed_folding) {
/* User never expanded/collapsed single pages and entered a filter term.
* Expand everything, to save weird expand clicks, */