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) |
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 1655 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 1676 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 1712 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 1719 of file toolbar_gui.cpp.
References last_started_action.
virtual void ScenarioEditorToolbarWindow::OnInvalidateData | ( | int | data | ) | [inline, virtual] |
Some data on this window has become invalid.
data | information about the changed data. |
Reimplemented from Window.
Definition at line 1795 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 1729 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.
Reimplemented from Window.
Definition at line 1668 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 1760 of file toolbar_gui.cpp.
References last_started_action, and PlaceProc_Sign().
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 1800 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 1697 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, "town_list", MTEHK_GENLAND), Hotkey<ScenarioEditorToolbarWindow>(WKC_F5, "subsidies", MTEHK_GENTOWN), Hotkey<ScenarioEditorToolbarWindow>(WKC_F6, "station_list", MTEHK_GENINDUSTRY), Hotkey<ScenarioEditorToolbarWindow>(WKC_F7, "finances", MTEHK_BUILD_ROAD), Hotkey<ScenarioEditorToolbarWindow>(WKC_F8, "companies", MTEHK_BUILD_DOCKS), Hotkey<ScenarioEditorToolbarWindow>(WKC_F9, "graphs", MTEHK_BUILD_TREES), Hotkey<ScenarioEditorToolbarWindow>(WKC_F10, "league", MTEHK_SIGN), Hotkey<ScenarioEditorToolbarWindow>(WKC_F11, "industry_list", MTEHK_MUSIC), Hotkey<ScenarioEditorToolbarWindow>(WKC_F12, "train_list", 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 1818 of file toolbar_gui.cpp.