# BuildDocksToolbarWindow Struct Reference

Toolbar window for constructing water infra structure. More...

Inheritance diagram for BuildDocksToolbarWindow:

## Public Member Functions
| BuildDocksToolbarWindow (const WindowDesc *desc, WindowNumber window_number)
void | OnInvalidateData (int data=0)
| 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 infra structure.

Definition at line 106 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 131 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().

void BuildDocksToolbarWindow::OnInvalidateData | ( | int | data = `0` | ) | `[inline, virtual]`

Some data on this window has become invalid.

Parameters:

  | data | information about the changed data.

Reimplemented from Window.

Definition at line 122 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.

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 175 of file dock_gui.cpp.

References CheckHotkeyMatch(), ES_HANDLED, ES_NOT_HANDLED, 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 232 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 237 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]`

The user clicked some place on the map when a tile highlight mode has been set.

Parameters:

  | 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 183 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().

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 266 of file dock_gui.cpp.

References DTW_BUILD_AQUEDUCT, DTW_LOCK, GetInclinedSlopeDirection(), GetOtherAqueductEnd(), GetTileSlope(), IsValidDiagDirection(), last_clicked_widget, ReverseDiagDir(), TileAddByDiagDir(), and VpSetPresizeRange().

## Field Documentation

Hotkey< BuildDocksToolbarWindow > BuildDocksToolbarWindow::dockstoolbar_hotkeys`[static]`

Initial value:

     {
      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 285 of file dock_gui.cpp.

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

- src/dock_gui.cpp