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 [] |
Definition at line 1663 of file toolbar_gui.cpp.
virtual void ScenarioEditorToolbarWindow::DrawWidget | ( | const Rect & | r, | |
int | widget | |||
) | const [inline, virtual] |
Draw the contents of a nested widget.
r | Rectangle occupied by the widget. | |
widget | Number of the widget to draw. |
Reimplemented from Window.
Definition at line 1684 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.
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 1720 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.
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 1727 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.
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 1808 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.
key | the Unicode value of the key. | |
keycode | the untranslated key code including shift state. |
Reimplemented from Window.
Definition at line 1737 of file toolbar_gui.cpp.
References CheckHotkeyMatch(), ES_HANDLED, ES_NOT_HANDLED, last_started_action, ShowEditorTerraformToolbar(), ShowExtraViewPortWindowForTileUnderCursor(), ShowGameOptions(), and ShowSmallMap().
virtual void ScenarioEditorToolbarWindow::OnPaint | ( | ) | [inline, virtual] |
The window must be repainted.
Reimplemented from Window.
Definition at line 1676 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.
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 1768 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.
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 1814 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.
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 1705 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.
Hotkey< ScenarioEditorToolbarWindow > ScenarioEditorToolbarWindow::scenedit_maintoolbar_hotkeys [static] |
{ 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 1832 of file toolbar_gui.cpp.