Toolbar window for constructing water infra structure. More...
Public Member Functions | |
BuildDocksToolbarWindow (const WindowDesc *desc, WindowNumber window_number) | |
virtual void | OnInvalidateData (int data=0, bool gui_scope=true) |
Some data on this window has become invalid. | |
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 (uint16 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 | 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 | OnPlaceObjectAbort () |
The user cancelled a tile highlight mode that has been set. | |
virtual void | OnPlacePresize (Point pt, TileIndex tile_from) |
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. | |
Data Fields | |
DockToolbarWidgets | last_clicked_widget |
Contains the last widget that has been clicked on this toolbar. | |
Static Public Attributes | |
static Hotkey < BuildDocksToolbarWindow > | dockstoolbar_hotkeys [] |
Toolbar window for constructing water infra structure.
Definition at line 106 of file dock_gui.cpp.
virtual void BuildDocksToolbarWindow::OnClick | ( | Point | pt, | |
int | widget, | |||
int | click_count | |||
) | [inline, virtual] |
A click with the left mouse button has been made on the window.
pt | the point inside the window that has been clicked. | |
widget | the clicked widget. | |
click_count | Number of fast consecutive clicks at same position |
Reimplemented from Window.
Definition at line 137 of file dock_gui.cpp.
References ANIMCURSOR_DEMOLISH, CanBuildVehicleInfrastructure(), DTW_BUILD_AQUEDUCT, DTW_BUOY, DTW_CANAL, DTW_DEMOLISH, DTW_DEPOT, DTW_LOCK, DTW_RIVER, DTW_STATION, HandlePlacePushButton(), HT_DIAGONAL, HT_RECT, HT_SPECIAL, last_clicked_widget, and VEH_SHIP.
Referenced by OnKeyPress().
virtual void BuildDocksToolbarWindow::OnInvalidateData | ( | int | data = 0 , |
|
bool | gui_scope = true | |||
) | [inline, virtual] |
Some data on this window has become invalid.
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 127 of file dock_gui.cpp.
References CanBuildVehicleInfrastructure(), DTW_BUOY, DTW_DEPOT, DTW_STATION, Window::SetWidgetsDisabledState(), VEH_SHIP, and WIDGET_LIST_END.
virtual EventState BuildDocksToolbarWindow::OnKeyPress | ( | uint16 | key, | |
uint16 | keycode | |||
) | [inline, virtual] |
A key has been pressed.
key | the Unicode value of the key. | |
keycode | the untranslated key code including shift state. |
Reimplemented from Window.
Definition at line 181 of file dock_gui.cpp.
References CheckHotkeyMatch(), and OnClick().
virtual void BuildDocksToolbarWindow::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.
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 238 of file dock_gui.cpp.
References VpSelectTilesWithMethod().
virtual void BuildDocksToolbarWindow::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.
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 243 of file dock_gui.cpp.
References _ctrl_pressed, CMD_BUILD_CANAL, CMD_MSG, DDSP_CREATE_RIVER, DDSP_CREATE_WATER, DDSP_DEMOLISH_AREA, DoCommandP(), GUIPlaceProcDragXY(), WATER_CLASS_CANAL, WATER_CLASS_RIVER, and WATER_CLASS_SEA.
The user clicked some place on the map when a tile highlight mode has been set.
pt | the exact point on the map that has been clicked. | |
tile | the tile on the map that has been clicked. |
Reimplemented from Window.
Definition at line 189 of file dock_gui.cpp.
References _ctrl_pressed, CcBuildBridge(), CMD_BUILD_BRIDGE, CMD_BUILD_BUOY, CMD_BUILD_DOCK, CMD_BUILD_LOCK, CMD_BUILD_SHIP_DEPOT, CMD_MSG, DDSP_CREATE_RIVER, DDSP_CREATE_WATER, DoCommandP(), DTW_BUILD_AQUEDUCT, DTW_BUOY, DTW_CANAL, DTW_DEMOLISH, DTW_DEPOT, DTW_LOCK, DTW_RIVER, DTW_STATION, GetInclinedSlopeDirection(), GetOtherAqueductEnd(), GetTileSlope(), INVALID_DIAGDIR, last_clicked_widget, PlaceProc_DemolishArea(), ReverseDiagDir(), ShowSelectStationIfNeeded(), TileAddByDiagDir(), TRANSPORT_WATER, VPM_X_AND_Y, VPM_X_OR_Y, and VpStartPlaceSizing().
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.
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 272 of file dock_gui.cpp.
References DTW_BUILD_AQUEDUCT, DTW_LOCK, GetInclinedSlopeDirection(), GetOtherAqueductEnd(), GetTileSlope(), IsValidDiagDirection(), last_clicked_widget, ReverseDiagDir(), TileAddByDiagDir(), and VpSetPresizeRange().
Hotkey< BuildDocksToolbarWindow > BuildDocksToolbarWindow::dockstoolbar_hotkeys [static] |
{ Hotkey<BuildDocksToolbarWindow>('1', "canal", DTW_CANAL), Hotkey<BuildDocksToolbarWindow>('2', "lock", DTW_LOCK), Hotkey<BuildDocksToolbarWindow>('3', "demolish", DTW_DEMOLISH), Hotkey<BuildDocksToolbarWindow>('4', "depot", DTW_DEPOT), Hotkey<BuildDocksToolbarWindow>('5', "dock", DTW_STATION), Hotkey<BuildDocksToolbarWindow>('6', "buoy", DTW_BUOY), Hotkey<BuildDocksToolbarWindow>('7', "river", DTW_RIVER), Hotkey<BuildDocksToolbarWindow>(_dockstoolbar_aqueduct_keys, "aqueduct", DTW_BUILD_AQUEDUCT), }
Definition at line 291 of file dock_gui.cpp.