mirror of https://github.com/OpenTTD/OpenTTD
(svn r24750) -Cleanup: Remove old special clear filter button from signs list.
parent
d5a798033a
commit
06054d7a9d
|
@ -1020,7 +1020,6 @@ void SQGSWindow_Register(Squirrel *engine)
|
||||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SIL_SCROLLBAR, "WID_SIL_SCROLLBAR");
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SIL_SCROLLBAR, "WID_SIL_SCROLLBAR");
|
||||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SIL_FILTER_TEXT, "WID_SIL_FILTER_TEXT");
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SIL_FILTER_TEXT, "WID_SIL_FILTER_TEXT");
|
||||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SIL_FILTER_MATCH_CASE_BTN, "WID_SIL_FILTER_MATCH_CASE_BTN");
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SIL_FILTER_MATCH_CASE_BTN, "WID_SIL_FILTER_MATCH_CASE_BTN");
|
||||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SIL_FILTER_CLEAR_BTN, "WID_SIL_FILTER_CLEAR_BTN");
|
|
||||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SIL_FILTER_ENTER_BTN, "WID_SIL_FILTER_ENTER_BTN");
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SIL_FILTER_ENTER_BTN, "WID_SIL_FILTER_ENTER_BTN");
|
||||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_QES_CAPTION, "WID_QES_CAPTION");
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_QES_CAPTION, "WID_QES_CAPTION");
|
||||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_QES_TEXT, "WID_QES_TEXT");
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_QES_TEXT, "WID_QES_TEXT");
|
||||||
|
|
|
@ -2143,7 +2143,6 @@ public:
|
||||||
WID_SIL_SCROLLBAR = ::WID_SIL_SCROLLBAR, ///< Scrollbar of list.
|
WID_SIL_SCROLLBAR = ::WID_SIL_SCROLLBAR, ///< Scrollbar of list.
|
||||||
WID_SIL_FILTER_TEXT = ::WID_SIL_FILTER_TEXT, ///< Text box for typing a filter string.
|
WID_SIL_FILTER_TEXT = ::WID_SIL_FILTER_TEXT, ///< Text box for typing a filter string.
|
||||||
WID_SIL_FILTER_MATCH_CASE_BTN = ::WID_SIL_FILTER_MATCH_CASE_BTN, ///< Button to toggle if case sensitive filtering should be used.
|
WID_SIL_FILTER_MATCH_CASE_BTN = ::WID_SIL_FILTER_MATCH_CASE_BTN, ///< Button to toggle if case sensitive filtering should be used.
|
||||||
WID_SIL_FILTER_CLEAR_BTN = ::WID_SIL_FILTER_CLEAR_BTN, ///< Button to clear the filter.
|
|
||||||
WID_SIL_FILTER_ENTER_BTN = ::WID_SIL_FILTER_ENTER_BTN, ///< Scroll to first sign.
|
WID_SIL_FILTER_ENTER_BTN = ::WID_SIL_FILTER_ENTER_BTN, ///< Scroll to first sign.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -171,17 +171,6 @@ struct SignListWindow : Window, SignList {
|
||||||
this->BuildSortSignList();
|
this->BuildSortSignList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Empties the string buffer that is edited by the filter text edit widget.
|
|
||||||
* It also triggers the redraw of the widget so it become visible that the string has been made empty.
|
|
||||||
*/
|
|
||||||
void ClearFilterTextWidget()
|
|
||||||
{
|
|
||||||
this->filter_editbox.text.DeleteAll();
|
|
||||||
|
|
||||||
this->SetWidgetDirty(WID_SIL_FILTER_TEXT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function sets the filter string of the sign list. The contents of
|
* This function sets the filter string of the sign list. The contents of
|
||||||
* the edit widget is not updated by this function. Depending on if the
|
* the edit widget is not updated by this function. Depending on if the
|
||||||
|
@ -192,10 +181,6 @@ struct SignListWindow : Window, SignList {
|
||||||
{
|
{
|
||||||
/* check if there is a new filter string */
|
/* check if there is a new filter string */
|
||||||
this->string_filter.SetFilterTerm(new_filter_string);
|
this->string_filter.SetFilterTerm(new_filter_string);
|
||||||
this->SetWidgetDisabledState(WID_SIL_FILTER_CLEAR_BTN, StrEmpty(new_filter_string));
|
|
||||||
|
|
||||||
/* Repaint the clear button since its disabled state may have changed */
|
|
||||||
this->SetWidgetDirty(WID_SIL_FILTER_CLEAR_BTN);
|
|
||||||
|
|
||||||
/* Rebuild the list of signs */
|
/* Rebuild the list of signs */
|
||||||
this->InvalidateData();
|
this->InvalidateData();
|
||||||
|
@ -263,11 +248,6 @@ struct SignListWindow : Window, SignList {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_SIL_FILTER_CLEAR_BTN:
|
|
||||||
this->ClearFilterTextWidget(); // Empty the text in the EditBox widget
|
|
||||||
this->SetFilterString(""); // Use empty text as filter text (= view all signs)
|
|
||||||
break;
|
|
||||||
|
|
||||||
case WID_SIL_FILTER_MATCH_CASE_BTN:
|
case WID_SIL_FILTER_MATCH_CASE_BTN:
|
||||||
SignList::match_case = !SignList::match_case; // Toggle match case
|
SignList::match_case = !SignList::match_case; // Toggle match case
|
||||||
this->SetWidgetLoweredState(WID_SIL_FILTER_MATCH_CASE_BTN, SignList::match_case); // Toggle button pushed state
|
this->SetWidgetLoweredState(WID_SIL_FILTER_MATCH_CASE_BTN, SignList::match_case); // Toggle button pushed state
|
||||||
|
@ -379,7 +359,6 @@ static const NWidgetPart _nested_sign_list_widgets[] = {
|
||||||
SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP),
|
SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP),
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_SIL_FILTER_MATCH_CASE_BTN), SetDataTip(STR_SIGN_LIST_MATCH_CASE, STR_SIGN_LIST_MATCH_CASE_TOOLTIP),
|
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_SIL_FILTER_MATCH_CASE_BTN), SetDataTip(STR_SIGN_LIST_MATCH_CASE, STR_SIGN_LIST_MATCH_CASE_TOOLTIP),
|
||||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SIL_FILTER_CLEAR_BTN), SetDataTip(STR_SIGN_LIST_CLEAR, STR_SIGN_LIST_CLEAR_TOOLTIP),
|
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
NWidget(NWID_VERTICAL),
|
NWidget(NWID_VERTICAL),
|
||||||
|
|
|
@ -20,7 +20,6 @@ enum SignListWidgets {
|
||||||
WID_SIL_SCROLLBAR, ///< Scrollbar of list.
|
WID_SIL_SCROLLBAR, ///< Scrollbar of list.
|
||||||
WID_SIL_FILTER_TEXT, ///< Text box for typing a filter string.
|
WID_SIL_FILTER_TEXT, ///< Text box for typing a filter string.
|
||||||
WID_SIL_FILTER_MATCH_CASE_BTN, ///< Button to toggle if case sensitive filtering should be used.
|
WID_SIL_FILTER_MATCH_CASE_BTN, ///< Button to toggle if case sensitive filtering should be used.
|
||||||
WID_SIL_FILTER_CLEAR_BTN, ///< Button to clear the filter.
|
|
||||||
WID_SIL_FILTER_ENTER_BTN, ///< Scroll to first sign.
|
WID_SIL_FILTER_ENTER_BTN, ///< Scroll to first sign.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue