Public Member Functions | Data Fields | Static Public Attributes

TerraformToolbarWindow Struct Reference

Terra form toolbar managing class. More...

Inheritance diagram for TerraformToolbarWindow:
Window ZeroedMemoryAllocator

Public Member Functions

 TerraformToolbarWindow (WindowDesc *desc, WindowNumber window_number)
virtual void OnInit ()
 Notification that the nested widget tree gets initialized.
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 Point OnInitialPosition (int16 sm_width, int16 sm_height, int window_number)
 Compute the initial position of the window.
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.

Data Fields

int last_user_action
 Last started user action.

Static Public Attributes

static HotkeyList hotkeys

Detailed Description

Terra form toolbar managing class.

Definition at line 148 of file terraform_gui.cpp.


Member Function Documentation

virtual void TerraformToolbarWindow::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 170 of file terraform_gui.cpp.

References ANIMCURSOR_DEMOLISH, ANIMCURSOR_LOWERLAND, ANIMCURSOR_RAISELAND, HandlePlacePushButton(), HT_DIAGONAL, HT_POINT, HT_RECT, last_user_action, ShowBuildObjectPicker(), WID_TT_BUTTONS_START, WID_TT_BUY_LAND, WID_TT_DEMOLISH, WID_TT_LEVEL_LAND, WID_TT_LOWER_LAND, WID_TT_PLACE_OBJECT, WID_TT_PLACE_SIGN, WID_TT_PLANT_TREES, and WID_TT_RAISE_LAND.

virtual void TerraformToolbarWindow::OnInit (  )  [inline, virtual]

Notification that the nested widget tree gets initialized.

The event can be used to perform general computations.

Note:
nested_root and/or nested_array (normally accessed via GetWidget()) may not exist during this call.

Reimplemented from Window.

Definition at line 163 of file terraform_gui.cpp.

References NWidgetStacked::SetDisplayedPlane(), and SZSP_NONE.

virtual Point TerraformToolbarWindow::OnInitialPosition ( int16  sm_width,
int16  sm_height,
int  window_number 
) [inline, virtual]

Compute the initial position of the window.

Parameters:
sm_width Smallest width of the window.
sm_height Smallest height of the window.
window_number The window number of the new window.
Returns:
Initial position of the top-left corner of the window.

Reimplemented from Window.

Definition at line 262 of file terraform_gui.cpp.

References GetToolbarAlignedWindowPosition().

virtual void TerraformToolbarWindow::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 257 of file terraform_gui.cpp.

References VpSelectTilesWithMethod().

virtual void TerraformToolbarWindow::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 269 of file terraform_gui.cpp.

References DDSP_DEMOLISH_AREA, DDSP_LEVEL_AREA, DDSP_LOWER_AND_LEVEL_AREA, DDSP_RAISE_AND_LEVEL_AREA, and GUIPlaceProcDragXY().

virtual void TerraformToolbarWindow::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 222 of file terraform_gui.cpp.

References CMD_BUILD_OBJECT, CMD_MSG, DDSP_LEVEL_AREA, DDSP_LOWER_AND_LEVEL_AREA, DDSP_RAISE_AND_LEVEL_AREA, DoCommandP(), last_user_action, OBJECT_OWNED_LAND, PlaceProc_DemolishArea(), PlaceProc_Object(), PlaceProc_Sign(), VPM_X_AND_Y, VpStartPlaceSizing(), WID_TT_BUY_LAND, WID_TT_DEMOLISH, WID_TT_LEVEL_LAND, WID_TT_LOWER_LAND, WID_TT_PLACE_OBJECT, WID_TT_PLACE_SIGN, and WID_TT_RAISE_LAND.


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