Changeset - r11816:51966ecac704
[Not reviewed]
master
0 2 0
alberth - 15 years ago 2009-05-03 10:38:35
alberth@openttd.org
(svn r16211) -Codechange: Moving StationListWidgets out of the window class, completing StationViewWidgets.
2 files changed with 30 insertions and 28 deletions:
0 comments (0 inline, 0 general)
src/station_gui.cpp
Show inline comments
 
@@ -76,45 +76,45 @@ static void StationsWndShowStationRating
 
	rating = minu(rating, rating_full) / 16;
 
	if (rating != 0) GfxFillRect(left + 1, y, left + rating, y, 0xD0);
 
}
 

	
 
typedef GUIList<const Station*> GUIStationList;
 

	
 
/** Enum for CompanyStations, referring to _company_stations_widgets */
 
enum StationListWidgets {
 
	SLW_CLOSEBOX =  0,  ///< Close window button
 
	SLW_CAPTION,        ///< Window caption
 
	SLW_STICKY,         ///< Sticky button
 
	SLW_LIST,           ///< The main panel, list of stations
 
	SLW_SCROLLBAR,      ///< Scrollbar next to the main panel
 
	SLW_RESIZE,         ///< Resize button
 

	
 
	SLW_TRAIN,          ///< 'TRAIN' button - list only facilities where is a railroad station
 
	SLW_TRUCK,          ///< 'TRUCK' button - list only facilities where is a truck stop
 
	SLW_BUS,            ///< 'BUS' button - list only facilities where is a bus stop
 
	SLW_AIRPLANE,       ///< 'AIRPLANE' button - list only facilities where is an airport
 
	SLW_SHIP,           ///< 'SHIP' button - list only facilities where is a dock
 
	SLW_FACILALL,       ///< 'ALL' button - list all facilities
 

	
 
	SLW_PAN_BETWEEN,    ///< Small panel between list of types of ficilities and list of cargo types
 
	SLW_NOCARGOWAITING, ///< 'NO' button - list stations where no cargo is waiting
 
	SLW_CARGOALL,       ///< 'ALL' button - list all stations
 
	SLW_PAN_RIGHT,      ///< Panel right of list of cargo types
 

	
 
	SLW_SORTBY,         ///< 'Sort by' button - reverse sort direction
 
	SLW_SORTDROPBTN,    ///< Dropdown button
 
	SLW_PAN_SORT_RIGHT, ///< Panel right of sorting options
 

	
 
	SLW_CARGOSTART,     ///< Widget numbers used for list of cargo types (not present in _company_stations_widgets)
 
};
 

	
 
/**
 
 * The list of stations per company.
 
 */
 
class CompanyStationsWindow : public Window
 
{
 
	/** Enum for CompanyStations, referring to _company_stations_widgets */
 
	enum StationListWidgets {
 
		SLW_CLOSEBOX =  0,  ///< Close window button
 
		SLW_CAPTION,        ///< Window caption
 
		SLW_STICKY,         ///< Sticky button
 
		SLW_LIST,           ///< The main panel, list of stations
 
		SLW_SCROLLBAR,      ///< Scrollbar next to the main panel
 
		SLW_RESIZE,         ///< Resize button
 

	
 
		SLW_TRAIN,          ///< 'TRAIN' button - list only facilities where is a railroad station
 
		SLW_TRUCK,          ///< 'TRUCK' button - list only facilities where is a truck stop
 
		SLW_BUS,            ///< 'BUS' button - list only facilities where is a bus stop
 
		SLW_AIRPLANE,       ///< 'AIRPLANE' button - list only facilities where is an airport
 
		SLW_SHIP,           ///< 'SHIP' button - list only facilities where is a dock
 
		SLW_FACILALL,       ///< 'ALL' button - list all facilities
 

	
 
		SLW_PAN_BETWEEN,    ///< Small panel between list of types of ficilities and list of cargo types
 
		SLW_NOCARGOWAITING, ///< 'NO' button - list stations where no cargo is waiting
 
		SLW_CARGOALL,       ///< 'ALL' button - list all stations
 
		SLW_PAN_RIGHT,      ///< Panel right of list of cargo types
 

	
 
		SLW_SORTBY,         ///< 'Sort by' button - reverse sort direction
 
		SLW_SORTDROPBTN,    ///< Dropdown button
 
		SLW_PAN_SORT_RIGHT, ///< Panel right of sorting options
 

	
 
		SLW_CARGOSTART,     ///< Widget numbers used for list of cargo types (not present in _company_stations_widgets)
 
	};
 

	
 
protected:
 
	/* Runtime saved values */
 
	static Listing last_sorting;
 
	static byte facilities;               // types of stations of interest
 
	static bool include_empty;            // whether we should include stations without waiting cargo
 
	static const uint32 cargo_filter_max;
src/station_gui.h
Show inline comments
 
@@ -8,13 +8,15 @@
 
#include "command_type.h"
 

	
 
/** Enum for StationView, referring to _station_view_widgets and _station_view_expanded_widgets */
 
enum StationViewWidgets {
 
	SVW_CLOSEBOX   =  0, ///< Close 'X' button
 
	SVW_CAPTION    =  1, ///< Caption of the window
 
	SVW_STICKYBOX  =  2, ///< Sticky button
 
	SVW_WAITING    =  3, ///< List of waiting cargo
 
	SVW_SCROLLBAR  =  4, ///< Scrollbar
 
	SVW_ACCEPTLIST =  5, ///< List of accepted cargos
 
	SVW_RATINGLIST =  5, ///< Ratings of cargos
 
	SVW_LOCATION   =  6, ///< 'Location' button
 
	SVW_RATINGS    =  7, ///< 'Ratings' button
 
	SVW_ACCEPTS    =  7, ///< 'Accepts' button
 
	SVW_RENAME     =  8, ///< 'Rename' button
0 comments (0 inline, 0 general)