Public Member Functions | Data Fields | Static Public Attributes

BuildDocksToolbarWindow Struct Reference

Toolbar window for constructing water infrastructure. More...

Inheritance diagram for BuildDocksToolbarWindow:
Window ZeroedMemoryAllocator

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 []

Detailed Description

Toolbar window for constructing water infrastructure.

Definition at line 91 of file dock_gui.cpp.


Member Function Documentation

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.

Parameters:
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 122 of file dock_gui.cpp.

References ANIMCURSOR_DEMOLISH, CanBuildVehicleInfrastructure(), HandlePlacePushButton(), HT_DIAGONAL, HT_RECT, HT_SPECIAL, last_clicked_widget, VEH_SHIP, WID_DT_BUILD_AQUEDUCT, WID_DT_BUOY, WID_DT_CANAL, WID_DT_DEMOLISH, WID_DT_DEPOT, WID_DT_LOCK, WID_DT_RIVER, and WID_DT_STATION.

Referenced by OnKeyPress().

virtual void BuildDocksToolbarWindow::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 112 of file dock_gui.cpp.

References CanBuildVehicleInfrastructure(), Window::SetWidgetsDisabledState(), VEH_SHIP, WID_DT_BUOY, WID_DT_DEPOT, WID_DT_STATION, and WIDGET_LIST_END.

virtual EventState BuildDocksToolbarWindow::OnKeyPress ( uint16  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 166 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.

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 223 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.

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 228 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.

virtual void BuildDocksToolbarWindow::OnPlaceObject ( Point  pt,
TileIndex  tile 
) [inline, virtual]
virtual void BuildDocksToolbarWindow::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 257 of file dock_gui.cpp.

References GetInclinedSlopeDirection(), GetOtherAqueductEnd(), GetTileSlope(), IsValidDiagDirection(), last_clicked_widget, ReverseDiagDir(), TileAddByDiagDir(), VpSetPresizeRange(), WID_DT_BUILD_AQUEDUCT, and WID_DT_LOCK.


Field Documentation

Hotkey< BuildDocksToolbarWindow > BuildDocksToolbarWindow::dockstoolbar_hotkeys [static]
Initial value:
 {
  Hotkey<BuildDocksToolbarWindow>('1', "canal", WID_DT_CANAL),
  Hotkey<BuildDocksToolbarWindow>('2', "lock", WID_DT_LOCK),
  Hotkey<BuildDocksToolbarWindow>('3', "demolish", WID_DT_DEMOLISH),
  Hotkey<BuildDocksToolbarWindow>('4', "depot", WID_DT_DEPOT),
  Hotkey<BuildDocksToolbarWindow>('5', "dock", WID_DT_STATION),
  Hotkey<BuildDocksToolbarWindow>('6', "buoy", WID_DT_BUOY),
  Hotkey<BuildDocksToolbarWindow>('7', "river", WID_DT_RIVER),
  Hotkey<BuildDocksToolbarWindow>(_dockstoolbar_aqueduct_keys, "aqueduct", WID_DT_BUILD_AQUEDUCT),

}

Definition at line 276 of file dock_gui.cpp.


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