BuildRailStationWindow Struct Reference

Inheritance diagram for BuildRailStationWindow:

PickerWindowBase Window ZeroedMemoryAllocator

Public Member Functions

 BuildRailStationWindow (const WindowDesc *desc, Window *parent, bool newstation)
 Window event handler of station build window.
virtual void OnPaint ()
 This window is currently being repainted.
virtual void OnClick (Point pt, int widget)
 A click with the left mouse button has been made on the window.
virtual void OnDropdownSelect (int widget, int index)
 A dropdown option associated to this window has been selected.
virtual void OnTick ()
 Called once per (game) tick.

Private Types

 BRSW_CLOSEBOX = 0
 BRSW_CAPTION
 BRSW_BACKGROUND
 BRSW_PLATFORM_DIR_X
 BRSW_PLATFORM_DIR_Y
 BRSW_PLATFORM_NUM_BEGIN = BRSW_PLATFORM_DIR_Y
 BRSW_PLATFORM_NUM_1
 BRSW_PLATFORM_NUM_2
 BRSW_PLATFORM_NUM_3
 BRSW_PLATFORM_NUM_4
 BRSW_PLATFORM_NUM_5
 BRSW_PLATFORM_NUM_6
 BRSW_PLATFORM_NUM_7
 BRSW_PLATFORM_LEN_BEGIN = BRSW_PLATFORM_NUM_7
 BRSW_PLATFORM_LEN_1
 BRSW_PLATFORM_LEN_2
 BRSW_PLATFORM_LEN_3
 BRSW_PLATFORM_LEN_4
 BRSW_PLATFORM_LEN_5
 BRSW_PLATFORM_LEN_6
 BRSW_PLATFORM_LEN_7
 BRSW_PLATFORM_DRAG_N_DROP
 BRSW_HIGHLIGHT_OFF
 BRSW_HIGHLIGHT_ON
 BRSW_NEWST_DROPDOWN
 BRSW_NEWST_LIST
 BRSW_NEWST_SCROLL
enum  BuildRailStationWidgets {
  BRSW_CLOSEBOX = 0, BRSW_CAPTION, BRSW_BACKGROUND, BRSW_PLATFORM_DIR_X,
  BRSW_PLATFORM_DIR_Y, BRSW_PLATFORM_NUM_BEGIN = BRSW_PLATFORM_DIR_Y, BRSW_PLATFORM_NUM_1, BRSW_PLATFORM_NUM_2,
  BRSW_PLATFORM_NUM_3, BRSW_PLATFORM_NUM_4, BRSW_PLATFORM_NUM_5, BRSW_PLATFORM_NUM_6,
  BRSW_PLATFORM_NUM_7, BRSW_PLATFORM_LEN_BEGIN = BRSW_PLATFORM_NUM_7, BRSW_PLATFORM_LEN_1, BRSW_PLATFORM_LEN_2,
  BRSW_PLATFORM_LEN_3, BRSW_PLATFORM_LEN_4, BRSW_PLATFORM_LEN_5, BRSW_PLATFORM_LEN_6,
  BRSW_PLATFORM_LEN_7, BRSW_PLATFORM_DRAG_N_DROP, BRSW_HIGHLIGHT_OFF, BRSW_HIGHLIGHT_ON,
  BRSW_NEWST_DROPDOWN, BRSW_NEWST_LIST, BRSW_NEWST_SCROLL
}
 Enum referring to the widgets of the rail stations window.

Private Member Functions

void CheckSelectedSize (const StationSpec *statspec)
 Verify whether the currently selected station size is allowed after selecting a new station class/type.

Static Private Member Functions

static DropDownListBuildStationClassDropDown ()
 Build a dropdown list of available station classes.

Detailed Description

Definition at line 887 of file rail_gui.cpp.


Constructor & Destructor Documentation

BuildRailStationWindow::BuildRailStationWindow ( const WindowDesc desc,
Window parent,
bool  newstation 
) [inline]

Window event handler of station build window.

Parameters:
w Staion build window
e Window event to handle

Definition at line 974 of file rail_gui.cpp.

References _railstation, _station_show_coverage, Scrollbar::cap, Clamp(), Scrollbar::count, RailStationGUISettings::dragdrop, Window::FindWindowPlacementAndResize(), GetNumCustomStations(), Window::LowerWidget(), RailStationGUISettings::newstations, RailStationGUISettings::numtracks, RailStationGUISettings::orientation, RailStationGUISettings::platlength, Scrollbar::pos, Window::SetWidgetLoweredState(), RailStationGUISettings::station_class, RailStationGUISettings::station_count, RailStationGUISettings::station_type, and Window::vscroll.


Member Function Documentation

void BuildRailStationWindow::CheckSelectedSize ( const StationSpec statspec  )  [inline, private]

Verify whether the currently selected station size is allowed after selecting a new station class/type.

If not, change the station size variables ( _railstation.numtracks and _railstation.platlength ).

Parameters:
statspec Specification of the new station class/type

Definition at line 931 of file rail_gui.cpp.

References _railstation, StationSpec::disallowed_lengths, StationSpec::disallowed_platforms, RailStationGUISettings::dragdrop, HasBit(), Window::LowerWidget(), RailStationGUISettings::numtracks, RailStationGUISettings::platlength, and Window::RaiseWidget().

virtual void BuildRailStationWindow::OnClick ( Point  pt,
int  widget 
) [inline, virtual]

A click with the left mouse button has been made on the window.

Parameters:
pt the point inside the window that has been clicked.
widget the clicked widget.

Reimplemented from Window.

Definition at line 1090 of file rail_gui.cpp.

References _railstation, StationSpec::disallowed_lengths, StationSpec::disallowed_platforms, RailStationGUISettings::dragdrop, GetCustomStationSpec(), HasBit(), Window::LowerWidget(), RailStationGUISettings::newstations, RailStationGUISettings::numtracks, RailStationGUISettings::orientation, RailStationGUISettings::platlength, Window::RaiseWidget(), Window::SetDirty(), SndPlayFx(), RailStationGUISettings::station_class, and RailStationGUISettings::station_type.

virtual void BuildRailStationWindow::OnDropdownSelect ( int  widget,
int  index 
) [inline, virtual]

A dropdown option associated to this window has been selected.

Parameters:
widget the widget (button) that the dropdown is associated with.
index the element in the dropdown that is selected.

Reimplemented from Window.

Definition at line 1235 of file rail_gui.cpp.

References _railstation, GetCustomStationSpec(), GetNumCustomStations(), SndPlayFx(), RailStationGUISettings::station_class, RailStationGUISettings::station_count, and RailStationGUISettings::station_type.


The documentation for this struct was generated from the following file:
Generated on Sat Sep 6 20:15:59 2008 for openttd by  doxygen 1.4.7