Public Member Functions | Data Fields

# CopyPasteWindow Struct Reference

Inheritance diagram for CopyPasteWindow:

## Public Member Functions
| CopyPasteWindow (const WindowDesc *desc, WindowNumber window_number)
virtual void | OnPaint ()
| The window must be repainted.
virtual void | OnClick (Point pt, int widget, int click_count)
| A click with the left mouse button has been made on the window.
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 | OnTimeout ()
| Called when this window's timeout has been reached.
virtual void | OnTick ()
| Called once per (game) tick.
## Data Fields
int | last_user_action
| Last started user action.

## Detailed Description

Definition at line 62 of file copy_paste_gui.cpp.

## Member Function Documentation

virtual void CopyPasteWindow::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 94 of file copy_paste_gui.cpp.

References Window::HandleButtonClick(), HandlePlacePushButton(), HT_PREVIEW, HT_RECT, CopyPaste::IsSomethingCopied(), Window::IsWidgetDisabled(), Window::IsWidgetLowered(), last_user_action, CopyPaste::m_clear_before_build, CopyPaste::m_convert_rail, CopyPaste::m_copy_with_other, CopyPaste::m_copy_with_rail, CopyPaste::m_copy_with_road, CopyPaste::m_paste_vacant_terrain, CopyPaste::m_toggle_signal_direction, CopyPaste::RotateSelectionCCW(), CopyPaste::RotateSelectionCW(), Window::SetDirty(), SetTileSelectSize(), Window::SetWidgetsDisabledState(), ShowSaveLoadDialog(), Window::ToggleWidgetLoweredState(), and WIDGET_LIST_END.

Referenced by OnPlaceMouseUp().

virtual void CopyPasteWindow::OnPaint | ( |  | ) | `[inline, virtual]`

The window must be repainted.

Note:
  This method should not change any state, it should only use drawing functions.

Reimplemented from Window.

Definition at line 79 of file copy_paste_gui.cpp.

References _current_company, DrawSprite(), CopyPaste::IsSomethingCopied(), Window::IsWidgetLowered(), CopyPaste::m_paste_vacant_terrain, Window::SetWidgetsDisabledState(), and WIDGET_LIST_END.

virtual void CopyPasteWindow::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 190 of file copy_paste_gui.cpp.

References VpSelectTilesWithMethod().

virtual void CopyPasteWindow::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 195 of file copy_paste_gui.cpp.

References CopyPaste::CopyArea(), DDSP_COPY_AREA, CopyPaste::m_toggle_signal_direction, OnClick(), and Window::SetDirty().

virtual void CopyPasteWindow::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 176 of file copy_paste_gui.cpp.

References DDSP_COPY_AREA, last_user_action, CopyPaste::PasteArea(), VPM_X_AND_Y_LIMITED, and VpStartPlaceSizing().

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

- src/copy_paste_gui.cpp