From 3ee25565858062788c7466e1bd2fef64b2ae2c57 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 18 May 2008 16:51:44 +0000 Subject: (svn r13165) -Codechange: replace some RebuildXXXList/ResortXXXList+InvalidateWindowXXX with InvalidateWindowXXXData. --- src/station_gui.cpp | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) (limited to 'src/station_gui.cpp') diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 2e05722b4..d9535480c 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -167,39 +167,6 @@ static int CDECL StationRatingMaxSorter(const void *a, const void *b) typedef GUIList GUIStationList; -/** - * Set the station sort flag for all station-list windows. - * @param sl_flag Sort list flag to set for all station-list windows - */ -static void SetStationListsFlag(SortListFlags sl_flag) -{ - Window *const *wz; - - FOR_ALL_WINDOWS(wz) { - Window *w = *wz; - if (w->window_class == WC_STATION_LIST) { - dynamic_cast(w)->flags |= sl_flag; - w->SetDirty(); - } - } -} - -/** - * Set the 'VL_REBUILD' flag for all station lists - */ -void RebuildStationLists() -{ - SetStationListsFlag(VL_REBUILD); -} - -/** - * Set the 'VL_RESORT' flag for all station lists - */ -void ResortStationLists() -{ - SetStationListsFlag(VL_RESORT); -} - /** * Rebuild station list if the VL_REBUILD flag is set * @@ -605,6 +572,11 @@ struct PlayerStationsWindow : public Window, public GUIStationList { this->vscroll.cap += delta.y / 10; } + + virtual void OnInvalidateData(int data) + { + this->flags |= (data == 0 ? VL_REBUILD : VL_RESORT); + } }; Listing PlayerStationsWindow::station_sort = {0, 0}; -- cgit v1.2.3-54-g00ecf