(svn r24697) -Codechange: Use WDF_UNCLICK_BUTTONS instead of duplicating the same functionality.

This commit is contained in:
frosch
2012-11-11 16:07:46 +00:00
parent b02347c645
commit 88b8e43090
5 changed files with 12 additions and 61 deletions

View File

@@ -535,8 +535,6 @@ public:
case WID_STL_SORTBY: // flip sorting method asc/desc
this->stations.ToggleSortOrder();
this->SetTimeout();
this->LowerWidget(WID_STL_SORTBY);
this->SetDirty();
break;
@@ -610,12 +608,6 @@ public:
}
}
virtual void OnTimeout()
{
this->RaiseWidget(WID_STL_SORTBY);
this->SetDirty();
}
virtual void OnResize()
{
this->vscroll->SetCapacityFromWidget(this, WID_STL_LIST, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM);
@@ -705,7 +697,7 @@ static const NWidgetPart _nested_company_stations_widgets[] = {
NWidget(WWT_PANEL, COLOUR_GREY), SetDataTip(0x0, STR_NULL), SetResize(1, 0), SetFill(1, 1), EndContainer(),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_STL_SORTBY), SetMinimalSize(81, 12), SetDataTip(STR_BUTTON_SORT_BY, STR_TOOLTIP_SORT_ORDER),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_STL_SORTBY), SetMinimalSize(81, 12), SetDataTip(STR_BUTTON_SORT_BY, STR_TOOLTIP_SORT_ORDER),
NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_STL_SORTDROPBTN), SetMinimalSize(163, 12), SetDataTip(STR_SORT_BY_NAME, STR_TOOLTIP_SORT_CRITERIA), // widget_data gets overwritten.
NWidget(WWT_PANEL, COLOUR_GREY), SetDataTip(0x0, STR_NULL), SetResize(1, 0), SetFill(1, 1), EndContainer(),
EndContainer(),