# BuildRailToolbarWindow Struct Reference

Based on the widget clicked, update the status of the 'remove' button. More...

Inheritance diagram for BuildRailToolbarWindow:

## Public Member Functions
| BuildRailToolbarWindow (const WindowDesc *desc, WindowNumber window_number)
void | UpdateRemoveWidgetStatus (int clicked_widget)
virtual void | OnPaint ()
| This window is currently being repainted.
virtual void | OnClick (Point pt, int widget)
| 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)
| 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.

## Detailed Description

Based on the widget clicked, update the status of the 'remove' button.

Parameters:

  | w | Rail toolbar window
  | clicked_widget | Widget clicked in the toolbar

Definition at line 608 of file rail_gui.cpp.

## Member Function Documentation

virtual void BuildRailToolbarWindow::OnClick | ( | Point | pt,
|  | int | widget |
| ) |  |  | `[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.

Reimplemented from Window.

Definition at line 657 of file rail_gui.cpp.

References _ctrl_pressed, _remove_button_clicked, RailBuildingGUIButtonData::click_proc, and RailToolbar_CtrlChanged().

virtual EventState BuildRailToolbarWindow::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 667 of file rail_gui.cpp.

References _ctrl_pressed, _remove_button_clicked, RailBuildingGUIButtonData::click_proc, Window::ES_HANDLED, Window::ES_NOT_HANDLED, lengthof, MarkTileDirty(), and RailToolbar_CtrlChanged().

virtual void BuildRailToolbarWindow::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 684 of file rail_gui.cpp.

virtual void BuildRailToolbarWindow::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 689 of file rail_gui.cpp.

References _convert_signal_button, FindWindowById(), Window::IsWidgetLowered(), VpSelectTilesWithMethod(), Point::x, and Point::y.

virtual void BuildRailToolbarWindow::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 697 of file rail_gui.cpp.

References _cur_railtype, _remove_button_clicked, _settings_client, CMD_CONVERT_RAIL, CMD_MSG, CMD_REMOVE_FROM_RAILROAD_STATION, DoCommandP(), ClientSettings::gui, GUIPlaceProcDragXY(), HandleAutoSignalPlacement(), GUISettings::persistent_buildingtools, ShowBuildBridgeWindow(), TRACK_X, TRACK_Y, TRANSPORT_RAIL, and Point::x.

virtual void BuildRailToolbarWindow::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 753 of file rail_gui.cpp.

References _cur_railtype, CMD_BUILD_TUNNEL, DC_AUTO, DoCommand(), and VpSetPresizeRange().

virtual EventState BuildRailToolbarWindow::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 759 of file rail_gui.cpp.

References Window::ES_HANDLED, Window::ES_NOT_HANDLED, Window::IsWidgetLowered(), and RailToolbar_CtrlChanged().

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

- src/rail_gui.cpp