# dock_gui.cpp File Reference

GUI to create amazing water objects. More...

`#include "stdafx.h"`
`#include "openttd.h"`
`#include "tile_map.h"`
`#include "station_type.h"`
`#include "terraform_gui.h"`
`#include "window_gui.h"`
`#include "station_gui.h"`
`#include "command_func.h"`
`#include "water.h"`
`#include "window_func.h"`
`#include "vehicle_func.h"`
`#include "sound_func.h"`
`#include "viewport_func.h"`
`#include "gfx_func.h"`
`#include "company_func.h"`
`#include "slope_func.h"`
`#include "tilehighlight_func.h"`
`#include "company_base.h"`
`#include "settings_type.h"`
`#include "table/sprites.h"`
`#include "table/strings.h"`

Go to the source code of this file.

## Data Structures
struct | BuildDocksToolbarWindow
struct | BuildDocksStationWindow
struct | BuildDocksDepotWindow
## Typedefs
typedef void | OnButtonClick (Window *w)
## Enumerations
enum | DockToolbarWidgets { DTW_BEGIN = 0, DTW_CLOSEBOX = DTW_BEGIN, DTW_CAPTION, DTW_STICKY, DTW_BUTTONS_BEGIN, DTW_CANAL = DTW_BUTTONS_BEGIN, DTW_LOCK, DTW_SEPERATOR, DTW_DEMOLISH, DTW_DEPOT, DTW_STATION, DTW_BUOY, DTW_RIVER, DTW_BUILD_AQUEDUCT, DTW_END }
| Enum referring to the widgets of the build dock toolbar. More...
## Functions
static void | ShowBuildDockStationPicker (Window *parent)
static void | ShowBuildDocksDepotPicker (Window *parent)
void | CcBuildDocks (bool success, TileIndex tile, uint32 p1, uint32 p2)
void | CcBuildCanal (bool success, TileIndex tile, uint32 p1, uint32 p2)
static void | PlaceDocks_Dock (TileIndex tile)
static void | PlaceDocks_Depot (TileIndex tile)
static void | PlaceDocks_Buoy (TileIndex tile)
static void | PlaceDocks_BuildCanal (TileIndex tile)
static void | PlaceDocks_BuildLock (TileIndex tile)
static void | PlaceDocks_BuildRiver (TileIndex tile)
static void | PlaceDocks_Aqueduct (TileIndex tile)
static void | BuildDocksClick_Canal (Window *w)
static void | BuildDocksClick_Lock (Window *w)
static void | BuildDocksClick_Demolish (Window *w)
static void | BuildDocksClick_Depot (Window *w)
static void | BuildDocksClick_Dock (Window *w)
static void | BuildDocksClick_Buoy (Window *w)
static void | BuildDocksClick_River (Window *w)
static void | BuildDocksClick_Aqueduct (Window *w)
void | ShowBuildDocksToolbar ()
void | ShowBuildDocksScenToolbar ()
void | InitializeDockGui ()
## Variables
static Axis | _ship_depot_direction
static OnButtonClick *const | _build_docks_button_proc []
static const Widget | _build_docks_toolb_widgets []
static const WindowDesc | _build_docks_toolbar_desc
static const Widget | _build_docks_scen_toolb_widgets []
static const WindowDesc | _build_docks_scen_toolbar_desc
static const Widget | _build_dock_station_widgets []
static const WindowDesc | _build_dock_station_desc
static const Widget | _build_docks_depot_widgets []
static const WindowDesc | _build_docks_depot_desc

## Detailed Description

GUI to create amazing water objects.

Definition in file dock_gui.cpp.

## Enumeration Type Documentation

enum DockToolbarWidgets

Enum referring to the widgets of the build dock toolbar.

Enumerator:

  DTW_BEGIN | Start of toolbar widgets.
  DTW_CLOSEBOX | Close window button.
  DTW_CAPTION | Window caption.
  DTW_STICKY | Sticky window button.
  DTW_BUTTONS_BEGIN | Begin of clickable buttons (except seperating panel).
  DTW_CANAL | Build canal button.
  DTW_LOCK | Build lock button.
  DTW_SEPERATOR | Seperating panel between lock and demolish.
  DTW_DEMOLISH | Demolish aka dynamite button.
  DTW_DEPOT | Build depot button.
  DTW_STATION | Build station button.
  DTW_BUOY | Build buoy button.
  DTW_RIVER | Build river button (in scenario editor).
  DTW_BUILD_AQUEDUCT | Build aqueduct button.
  DTW_END | End of toolbar widgets.

Definition at line 88 of file dock_gui.cpp.

## Variable Documentation

const WindowDesc _build_dock_station_desc`[static]`

Initial value:

     {
      WDP_AUTO, WDP_AUTO, 148, 75, 148, 75,
      WC_BUILD_STATION, WC_BUILD_TOOLBAR,
      WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
      _build_dock_station_widgets,
    }

Definition at line 398 of file dock_gui.cpp.

const Widget _build_dock_station_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,                         STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,    11,   147,     0,    13, STR_3068_DOCK,                    STR_018C_WINDOW_TITLE_DRAG_THIS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,   147,    14,    74, 0x0,                              STR_NULL},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,          14,    73,    30,    40, STR_02DB_OFF,                     STR_3065_DON_T_HIGHLIGHT_COVERAGE},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,          74,   133,    30,    40, STR_02DA_ON,                      STR_3064_HIGHLIGHT_COVERAGE_AREA},
    {      WWT_LABEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,   147,    17,    30, STR_3066_COVERAGE_AREA_HIGHLIGHT, STR_NULL},
    {   WIDGETS_END},
    }

Definition at line 388 of file dock_gui.cpp.

OnButtonClick* const _build_docks_button_proc[]`[static]`

Initial value:

     {
      BuildDocksClick_Canal,
      BuildDocksClick_Lock,
      NULL,
      BuildDocksClick_Demolish,
      BuildDocksClick_Depot,
      BuildDocksClick_Dock,
      BuildDocksClick_Buoy,
      BuildDocksClick_River,
      BuildDocksClick_Aqueduct
    }

Definition at line 154 of file dock_gui.cpp.

const WindowDesc _build_docks_depot_desc`[static]`

Initial value:

     {
      WDP_AUTO, WDP_AUTO, 204, 86, 204, 86,
      WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
      WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
      _build_docks_depot_widgets,
    }

Definition at line 472 of file dock_gui.cpp.

const Widget _build_docks_depot_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,                        STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,    11,   203,     0,    13, STR_3800_SHIP_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,   203,    14,    85, 0x0,                             STR_NULL},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,           3,   100,    17,    82, 0x0,                             STR_3803_SELECT_SHIP_DEPOT_ORIENTATION},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         103,   200,    17,    82, 0x0,                             STR_3803_SELECT_SHIP_DEPOT_ORIENTATION},
    {   WIDGETS_END},
    }

Definition at line 463 of file dock_gui.cpp.

const Widget _build_docks_scen_toolb_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,                           STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,    11,   102,     0,    13, STR_9801_WATERWAYS_CONSTRUCTION_SE, STR_018C_WINDOW_TITLE_DRAG_THIS},
    {  WWT_STICKYBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,   103,   114,     0,    13, 0x0,                                STR_STICKY_BUTTON},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    21,    14,    35, SPR_IMG_BUILD_CANAL,                STR_CREATE_LAKE},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    22,    43,    14,    35, SPR_IMG_BUILD_LOCK,                 STR_BUILD_LOCKS_TIP},

    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,    44,    48,    14,    35, 0x0,                                STR_NULL},

    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    49,    70,    14,    35, SPR_IMG_DYNAMITE,                   STR_018D_DEMOLISH_BUILDINGS_ETC},
    {     WWT_EMPTY,    RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                                STR_NULL},
    {     WWT_EMPTY,    RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                                STR_NULL},
    {     WWT_EMPTY,    RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                                STR_NULL},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    71,    92,    14,    35, SPR_IMG_BUILD_RIVER,                STR_CREATE_RIVER},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    93,   114,    14,    35, SPR_IMG_AQUEDUCT,                   STR_BUILD_AQUEDUCT},
    {   WIDGETS_END},
    }

Definition at line 293 of file dock_gui.cpp.

const WindowDesc _build_docks_scen_toolbar_desc`[static]`

Initial value:

     {
      WDP_AUTO, WDP_AUTO, 115, 36, 115, 36,
      WC_SCEN_BUILD_TOOLBAR, WC_NONE,
      WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
      _build_docks_scen_toolb_widgets,
    }

Definition at line 312 of file dock_gui.cpp.

const Widget _build_docks_toolb_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,                        STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,    11,   147,     0,    13, STR_9801_WATERWAYS_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
    {  WWT_STICKYBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,   148,   159,     0,    13, 0x0,                             STR_STICKY_BUTTON},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    21,    14,    35, SPR_IMG_BUILD_CANAL,             STR_BUILD_CANALS_TIP},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    22,    43,    14,    35, SPR_IMG_BUILD_LOCK,              STR_BUILD_LOCKS_TIP},

    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,    44,    48,    14,    35, 0x0,                             STR_NULL},

    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    49,    70,    14,    35, SPR_IMG_DYNAMITE,                STR_018D_DEMOLISH_BUILDINGS_ETC},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    71,    92,    14,    35, SPR_IMG_SHIP_DEPOT,              STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    93,   114,    14,    35, SPR_IMG_SHIP_DOCK,               STR_981D_BUILD_SHIP_DOCK},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   115,   136,    14,    35, SPR_IMG_BOUY,                    STR_9834_POSITION_BUOY_WHICH_CAN},
    {     WWT_EMPTY,    RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                             STR_NULL},
    {     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   137,   159,    14,    35, SPR_IMG_AQUEDUCT,                STR_BUILD_AQUEDUCT},
    {   WIDGETS_END},
    }

Definition at line 259 of file dock_gui.cpp.

const WindowDesc _build_docks_toolbar_desc`[static]`

Initial value:

     {
      WDP_ALIGN_TBR, 22, 160, 36, 160, 36,
      WC_BUILD_TOOLBAR, WC_NONE,
      WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
      _build_docks_toolb_widgets,
    }

Definition at line 277 of file dock_gui.cpp.