Public Member Functions | |
MainWindow (WindowDesc *desc) | |
virtual void | OnTick () |
Called once per (game) tick. | |
virtual void | OnPaint () |
The window must be repainted. | |
virtual EventState | OnHotkey (int hotkey) |
A hotkey has been pressed. | |
virtual void | OnScroll (Point delta) |
Handle the request for (viewport) scrolling. | |
virtual void | OnMouseWheel (int wheel) |
The mouse wheel has been turned. | |
virtual void | OnResize () |
Called after the window got resized. | |
virtual void | OnInvalidateData (int data=0, bool gui_scope=true) |
Some data on this window has become invalid. | |
Data Fields | |
uint | refresh |
Static Public Attributes | |
static const uint | LINKGRAPH_REFRESH_PERIOD = 0xff |
static const uint | LINKGRAPH_DELAY = 0xf |
static HotkeyList | hotkeys |
Definition at line 234 of file main_gui.cpp.
virtual EventState MainWindow::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 283 of file main_gui.cpp.
References _network_own_client_id, _network_server, _networking, _settings_client, _switch_mode, GUISettings::autosave_on_exit, CLIENT_ID_SERVER, NetworkClientInfo::client_playas, CMD_MONEY_CHEAT, DeleteAllNonVitalWindows(), DeleteNonVitalWindows(), DESTTYPE_BROADCAST, DESTTYPE_CLIENT, DESTTYPE_TEAM, DoCommandP(), DoExitSave(), NetworkClientInfo::GetByClientID(), ClientSettings::gui, HasModalProgress(), IConsoleSwitch(), MarkWholeScreenDirty(), MaxZoomInOut(), NetworkClientPreferTeamChat(), ResetRestoreAllTransparency(), ScrollMainWindowTo(), ShowNetworkChatQueryWindow(), ShowTransparencyToolbar(), ToggleBoundingBoxes(), ToggleDirtyBlocks(), ToggleInvisibilityWithTransparency(), ToggleTransparency(), UpdateAllVirtCoords(), Window::viewport, ViewPort::zoom, ZOOM_IN, and GUISettings::zoom_min.
virtual void MainWindow::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 453 of file main_gui.cpp.
References InvalidateWindowData(), and WC_MAIN_TOOLBAR.
virtual void MainWindow::OnMouseWheel | ( | int | wheel | ) | [inline, virtual] |
The mouse wheel has been turned.
wheel | the amount of movement of the mouse wheel. |
Reimplemented from Window.
Definition at line 432 of file main_gui.cpp.
References _settings_client, ClientSettings::gui, and GUISettings::scrollwheel_scrolling.
virtual void MainWindow::OnPaint | ( | ) | [inline, virtual] |
The window must be repainted.
Reimplemented from Window.
Definition at line 263 of file main_gui.cpp.
References DrawSprite(), Window::DrawWidgets(), GetSpriteSize(), lengthof, and Window::width.
virtual void MainWindow::OnResize | ( | ) | [inline, virtual] |
Called after the window got resized.
For nested windows with a viewport, call NWidgetViewport::UpdateViewportCoordinates.
Reimplemented from Window.
Definition at line 439 of file main_gui.cpp.
References NWidgetViewport::UpdateViewportCoordinates(), and Window::viewport.
virtual void MainWindow::OnScroll | ( | Point | delta | ) | [inline, virtual] |
Handle the request for (viewport) scrolling.
delta | the amount the viewport must be scrolled. |
Reimplemented from Window.
Definition at line 423 of file main_gui.cpp.
References ViewportData::dest_scrollpos_x, ViewportData::dest_scrollpos_y, ScaleByZoom(), ViewportData::scrollpos_x, ViewportData::scrollpos_y, and Window::viewport.