ScenarioEditorToolbarWindow Struct Reference

Inheritance diagram for ScenarioEditorToolbarWindow:
Window ZeroedMemoryAllocator

Public Member Functions

 ScenarioEditorToolbarWindow (const WindowDesc *desc)
virtual void OnPaint ()
 The window must be repainted.
virtual void DrawWidget (const Rect &r, int widget) const
 Draw the contents of a nested widget.
virtual void UpdateWidgetSize (int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
 Update size and resize step of a widget in the window.
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 OnDropdownSelect (int widget, int index)
 A dropdown option associated to this window has been selected.
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 OnTimeout ()
 Called when this window's timeout has been reached.
virtual void OnTick ()
 Called once per (game) tick.
virtual void OnInvalidateData (int data=0, bool gui_scope=true)
 Some data on this window has become invalid.
virtual void OnQueryTextFinished (char *str)
 The query window opened from this window has closed.

Data Fields

CallBackFunction last_started_action
 Last started user action.

Static Public Attributes

static Hotkey
< ScenarioEditorToolbarWindow
scenedit_maintoolbar_hotkeys []

Detailed Description

Definition at line 1661 of file toolbar_gui.cpp.


Member Function Documentation

virtual void ScenarioEditorToolbarWindow::DrawWidget ( const Rect r,
int  widget 
) const [inline, virtual]

Draw the contents of a nested widget.

Parameters:
r Rectangle occupied by the widget.
widget Number of the widget to draw.
Note:
This method may not change any state, it may only use drawing functions.

Reimplemented from Window.

Definition at line 1682 of file toolbar_gui.cpp.

References _settings_game, ConvertYMDToDate(), DrawString(), FONT_HEIGHT_NORMAL, GameSettings::game_creation, Window::height, SA_HOR_CENTER, SetDParam(), and GameCreationSettings::starting_year.

virtual void ScenarioEditorToolbarWindow::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 1718 of file toolbar_gui.cpp.

References last_started_action.

virtual void ScenarioEditorToolbarWindow::OnDropdownSelect ( int  widget,
int  index 
) [inline, virtual]

A dropdown option associated to this window has been selected.

Parameters:
widget the widget (button) that the dropdown is associated with.
index the element in the dropdown that is selected.

Reimplemented from Window.

Definition at line 1725 of file toolbar_gui.cpp.

References last_started_action.

virtual void ScenarioEditorToolbarWindow::OnInvalidateData ( int  data = 0,
bool  gui_scope = true 
) [inline, virtual]

Some data on this window has become invalid.

Parameters:
data Information about the changed data.
gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See InvalidateWindowData() for details.

Reimplemented from Window.

Definition at line 1806 of file toolbar_gui.cpp.

References FindWindowById(), HandleZoomMessage(), and Window::viewport.

virtual EventState ScenarioEditorToolbarWindow::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 1735 of file toolbar_gui.cpp.

References CheckHotkeyMatch(), ES_HANDLED, ES_NOT_HANDLED, last_started_action, ShowExtraViewPortWindowForTileUnderCursor(), and ShowGameOptions().

virtual void ScenarioEditorToolbarWindow::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 1674 of file toolbar_gui.cpp.

References _settings_game, Window::DrawWidgets(), GameSettings::game_creation, MAX_YEAR, MIN_YEAR, Window::SetWidgetDisabledState(), and GameCreationSettings::starting_year.

virtual void ScenarioEditorToolbarWindow::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 1766 of file toolbar_gui.cpp.

References last_started_action, PlaceProc_Sign(), and ShowLandInfo().

virtual void ScenarioEditorToolbarWindow::OnQueryTextFinished ( char *  str  )  [inline, virtual]

The query window opened from this window has closed.

Parameters:
str the new value of the string, NULL if the window was cancelled or an empty string when the default button was pressed, i.e. StrEmpty(str).

Reimplemented from Window.

Definition at line 1812 of file toolbar_gui.cpp.

References _settings_game, Clamp(), ConvertYMDToDate(), DEF_START_YEAR, GameSettings::game_creation, MAX_YEAR, MIN_YEAR, SetDate(), Window::SetDirty(), GameCreationSettings::starting_year, and StrEmpty().

virtual void ScenarioEditorToolbarWindow::UpdateWidgetSize ( int  widget,
Dimension size,
const Dimension padding,
Dimension fill,
Dimension resize 
) [inline, virtual]

Update size and resize step of a widget in the window.

After retrieval of the minimal size and the resize-steps of a widget, this function is called to allow further refinement, typically by computing the real maximal size of the content. Afterwards, size is taken to be the minimal size of the widget and resize is taken to contain the resize steps. For the convenience of the callee, padding contains the amount of padding between the content and the edge of the widget. This should be added to the returned size.

Parameters:
widget Widget number.
size Size of the widget.
padding Recommended amount of space between the widget content and the widget edge.
fill Fill step of the widget.
resize Resize step of the widget.

Reimplemented from Window.

Definition at line 1703 of file toolbar_gui.cpp.

References ConvertYMDToDate(), GetSpriteSize(), GetStringBoundingBox(), Window::height, max(), MAX_YEAR, SetDParam(), WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, WD_IMGBTN_BOTTOM, WD_IMGBTN_TOP, and Window::width.


Field Documentation

Hotkey< ScenarioEditorToolbarWindow > ScenarioEditorToolbarWindow::scenedit_maintoolbar_hotkeys [static]
Initial value:
 {
  Hotkey<ScenarioEditorToolbarWindow>(_maintoolbar_pause_keys, "pause", MTEHK_PAUSE),
  Hotkey<ScenarioEditorToolbarWindow>((uint16)0, "fastforward", MTEHK_FASTFORWARD),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_F2, "settings", MTEHK_SETTINGS),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_F3, "saveload", MTEHK_SAVEGAME),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_F4, "gen_land", MTEHK_GENLAND),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_F5, "gen_town", MTEHK_GENTOWN),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_F6, "gen_industry", MTEHK_GENINDUSTRY),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_F7, "build_road", MTEHK_BUILD_ROAD),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_F8, "build_docks", MTEHK_BUILD_DOCKS),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_F9, "build_trees", MTEHK_BUILD_TREES),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_F10, "build_sign", MTEHK_SIGN),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_F11, "music", MTEHK_MUSIC),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_F12, "land_info", MTEHK_LANDINFO),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_CTRL  | 'S', "small_screenshot", MTEHK_SMALL_SCREENSHOT),
  Hotkey<ScenarioEditorToolbarWindow>(WKC_CTRL  | 'P', "zoomedin_screenshot", MTEHK_ZOOMEDIN_SCREENSHOT),
  Hotkey<ScenarioEditorToolbarWindow>((uint16)0, "giant_screenshot", MTEHK_GIANT_SCREENSHOT),
  Hotkey<ScenarioEditorToolbarWindow>(_maintoolbar_zoomin_keys, "zoomin", MTEHK_ZOOM_IN),
  Hotkey<ScenarioEditorToolbarWindow>(_maintoolbar_zoomout_keys, "zoomout", MTEHK_ZOOM_OUT),
  Hotkey<ScenarioEditorToolbarWindow>('L', "terraform", MTEHK_TERRAFORM),
  Hotkey<ScenarioEditorToolbarWindow>('M', "smallmap", MTEHK_SMALLMAP),
  Hotkey<ScenarioEditorToolbarWindow>('V', "extra_viewport", MTEHK_EXTRA_VIEWPORT),

}

Definition at line 1830 of file toolbar_gui.cpp.


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

Generated on Thu Apr 14 00:49:25 2011 for OpenTTD by  doxygen 1.6.1