Public Member Functions | Data Fields | Static Public Attributes

BuildRoadToolbarWindow Struct Reference

Road toolbar window handler. More...

Inheritance diagram for BuildRoadToolbarWindow:
Window ZeroedMemoryAllocator

Public Member Functions

 BuildRoadToolbarWindow (const WindowDesc *desc, WindowNumber window_number)
virtual void OnInvalidateData (int data=0, bool gui_scope=true)
 Some data on this window has become invalid.
void UpdateOptionWidgetStatus (RoadToolbarWidgets clicked_widget)
 Update the remove button lowered state of the road toolbar.
virtual void OnClick (Point pt, int widget, int click_count)
 A click with the left mouse button has been made on the window.
virtual EventState OnKeyPress (WChar key, uint16 keycode)
 A key has been pressed.
virtual void OnPlaceObject (Point pt, TileIndex tile)
 The user clicked some place on the map when a tile highlight mode has been set.
virtual void OnPlaceObjectAbort ()
 The user cancelled a tile highlight mode that has been set.
virtual void OnPlaceDrag (ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
 The user is dragging over the map when the tile highlight mode has been set.
virtual void OnPlaceMouseUp (ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
 The user has dragged over the map when the tile highlight mode has been set.
virtual void OnPlacePresize (Point pt, TileIndex tile)
 The user moves over the map when a tile highlight mode has been set when the special mouse mode has been set to 'PRESIZE' mode.
virtual EventState OnCTRLStateChange ()
 The state of the control key has changed.

Data Fields

int last_started_action
 Last started user action.

Static Public Attributes

static Hotkey
< BuildRoadToolbarWindow
roadtoolbar_hotkeys []

Detailed Description

Road toolbar window handler.

Definition at line 308 of file road_gui.cpp.


Member Function Documentation

virtual void BuildRoadToolbarWindow::OnClick ( Point  pt,
int  widget,
int  click_count 
) [inline, virtual]
virtual EventState BuildRoadToolbarWindow::OnCTRLStateChange (  )  [inline, virtual]

The state of the control key has changed.

Returns:
ES_HANDLED if the change has been handled and no other window should receive the event.

Reimplemented from Window.

Definition at line 657 of file road_gui.cpp.

References RoadToolbar_CtrlChanged().

virtual void BuildRoadToolbarWindow::OnInvalidateData ( int  data = 0,
bool  gui_scope = true 
) [inline, virtual]

Some data on this window has become invalid.

Parameters:
data Information about the changed data.
gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See InvalidateWindowData() for details.

Reimplemented from Window.

Definition at line 335 of file road_gui.cpp.

References CanBuildVehicleInfrastructure(), Window::SetWidgetsDisabledState(), VEH_ROAD, WID_ROT_BUS_STATION, WID_ROT_DEPOT, WID_ROT_TRUCK_STATION, and WIDGET_LIST_END.

virtual EventState BuildRoadToolbarWindow::OnKeyPress ( WChar  key,
uint16  keycode 
) [inline, virtual]

A key has been pressed.

Parameters:
key the Unicode value of the key.
keycode the untranslated key code including shift state.
Returns:
ES_HANDLED if the key press has been handled and no other window should receive the event.

Reimplemented from Window.

Definition at line 476 of file road_gui.cpp.

References CheckHotkeyMatch(), MarkTileDirtyByTile(), OnClick(), TileHighlightData::pos, and TileVirtXY().

virtual void BuildRoadToolbarWindow::OnPlaceDrag ( ViewportPlaceMethod  select_method,
ViewportDragDropSelectionProcess  select_proc,
Point  pt 
) [inline, virtual]

The user is dragging over the map when the tile highlight mode has been set.

Parameters:
select_method the method of selection (allowed directions)
select_proc what will be created when the drag is over.
pt the exact point on the map where the mouse is.

Reimplemented from Window.

Definition at line 556 of file road_gui.cpp.

References DDSP_PLACE_AUTOROAD, DDSP_PLACE_ROAD_X_DIR, DDSP_PLACE_ROAD_Y_DIR, TileHighlightData::size, and VpSelectTilesWithMethod().

virtual void BuildRoadToolbarWindow::OnPlaceMouseUp ( ViewportPlaceMethod  select_method,
ViewportDragDropSelectionProcess  select_proc,
Point  pt,
TileIndex  start_tile,
TileIndex  end_tile 
) [inline, virtual]

The user has dragged over the map when the tile highlight mode has been set.

Parameters:
select_method the method of selection (allowed directions)
select_proc what should be created.
pt the exact point on the map where the mouse was released.
start_tile the begin tile of the drag.
end_tile the end tile of the drag.

Reimplemented from Window.

Definition at line 599 of file road_gui.cpp.

References _ctrl_pressed, _remove_button_clicked, _settings_client, CMD_BUILD_LONG_ROAD, CMD_BUILD_ROAD_STOP, CMD_MSG, CMD_REMOVE_LONG_ROAD, CMD_REMOVE_ROAD_STOP, DDSP_BUILD_BRIDGE, DDSP_BUILD_BUSSTOP, DDSP_BUILD_TRUCKSTOP, DDSP_DEMOLISH_AREA, DDSP_PLACE_AUTOROAD, DDSP_PLACE_ROAD_X_DIR, DDSP_PLACE_ROAD_Y_DIR, DDSP_REMOVE_BUSSTOP, DDSP_REMOVE_TRUCKSTOP, DoCommandP(), ClientSettings::gui, GUIPlaceProcDragXY(), TileArea::h, GUISettings::persistent_buildingtools, PlaceRoadStop(), ROADSTOP_BUS, ROADSTOP_TRUCK, RoadTypeToRoadTypes(), ShowBuildBridgeWindow(), TileArea::tile, TRANSPORT_ROAD, and TileArea::w.

virtual void BuildRoadToolbarWindow::OnPlaceObject ( Point  pt,
TileIndex  tile 
) [inline, virtual]
virtual void BuildRoadToolbarWindow::OnPlacePresize ( Point  pt,
TileIndex  tile 
) [inline, virtual]

The user moves over the map when a tile highlight mode has been set when the special mouse mode has been set to 'PRESIZE' mode.

An example of this is the tile highlight for dock building.

Parameters:
pt the exact point on the map where the mouse is.
tile the tile on the map where the mouse is.

Reimplemented from Window.

Definition at line 651 of file road_gui.cpp.

References _build_tunnel_endtile, CMD_BUILD_TUNNEL, DC_AUTO, DoCommand(), RoadTypeToRoadTypes(), TRANSPORT_ROAD, and VpSetPresizeRange().

void BuildRoadToolbarWindow::UpdateOptionWidgetStatus ( RoadToolbarWidgets  clicked_widget  )  [inline]

Field Documentation

Hotkey< BuildRoadToolbarWindow > BuildRoadToolbarWindow::roadtoolbar_hotkeys [static]
Initial value:
 {
  Hotkey<BuildRoadToolbarWindow>('1', "build_x", WID_ROT_ROAD_X),
  Hotkey<BuildRoadToolbarWindow>('2', "build_y", WID_ROT_ROAD_Y),
  Hotkey<BuildRoadToolbarWindow>('3', "autoroad", WID_ROT_AUTOROAD),
  Hotkey<BuildRoadToolbarWindow>('4', "demolish", WID_ROT_DEMOLISH),
  Hotkey<BuildRoadToolbarWindow>('5', "depot", WID_ROT_DEPOT),
  Hotkey<BuildRoadToolbarWindow>('6', "bus_station", WID_ROT_BUS_STATION),
  Hotkey<BuildRoadToolbarWindow>('7', "truck_station", WID_ROT_TRUCK_STATION),
  Hotkey<BuildRoadToolbarWindow>('8', "oneway", WID_ROT_ONE_WAY),
  Hotkey<BuildRoadToolbarWindow>('B', "bridge", WID_ROT_BUILD_BRIDGE),
  Hotkey<BuildRoadToolbarWindow>('T', "tunnel", WID_ROT_BUILD_TUNNEL),
  Hotkey<BuildRoadToolbarWindow>('R', "remove", WID_ROT_REMOVE),

}

Definition at line 663 of file road_gui.cpp.


The documentation for this struct was generated from the following file: