Public Member Functions | |
ScenarioEditorToolbarWindow (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 | OnHotkey (int hotkey) |
A hotkey 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 HotkeyList | hotkeys |
Definition at line 1969 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 1990 of file toolbar_gui.cpp.
References _settings_game, ConvertYMDToDate(), DrawString(), FONT_HEIGHT_NORMAL, GameSettings::game_creation, Window::height, SA_HOR_CENTER, SetDParam(), GameCreationSettings::starting_year, WID_TE_DATE, and WID_TE_SPACER.
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 2026 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 2033 of file toolbar_gui.cpp.
References _settings_client, SoundSettings::click_beep, last_started_action, ClientSettings::sound, and WID_TE_SMALL_MAP.
virtual EventState ScenarioEditorToolbarWindow::OnHotkey | ( | int | hotkey | ) | [inline, virtual] |
A hotkey has been pressed.
hotkey | Hotkey index, by default a widget index of a button or editbox. |
Reimplemented from Window.
Definition at line 2043 of file toolbar_gui.cpp.
References last_started_action, MenuClickLargeWorldScreenshot(), MenuClickSaveLoad(), SC_DEFAULTZOOM, SC_WORLD, SC_ZOOMEDIN, ShowEditorTerraformToolbar(), ShowExtraViewPortWindowForTileUnderCursor(), ShowGameOptions(), ShowSmallMap(), and ToolbarFastForwardClick().
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 2115 of file toolbar_gui.cpp.
References FindWindowById(), HandleZoomMessage(), Window::viewport, WC_MAIN_WINDOW, WID_TE_ZOOM_IN, and WID_TE_ZOOM_OUT.
virtual void ScenarioEditorToolbarWindow::OnPaint | ( | ) | [inline, virtual] |
The window must be repainted.
Reimplemented from Window.
Definition at line 1982 of file toolbar_gui.cpp.
References _settings_game, Window::DrawWidgets(), GameSettings::game_creation, MAX_YEAR, MIN_YEAR, Window::SetWidgetDisabledState(), GameCreationSettings::starting_year, WID_TE_DATE_BACKWARD, and WID_TE_DATE_FORWARD.
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 2075 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 2121 of file toolbar_gui.cpp.
References DEF_START_YEAR, Window::SetDirty(), SetStartingYear(), 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 2011 of file toolbar_gui.cpp.
References ConvertYMDToDate(), GetSpriteSize(), GetStringBoundingBox(), Window::height, max(), MAX_YEAR, SetDParam(), WD_FRAMERECT_LEFT, WD_IMGBTN_BOTTOM, WD_IMGBTN_TOP, WID_TE_DATE, WID_TE_SPACER, and Window::width.