# SaveLoadWindow Struct Reference

Inheritance diagram for SaveLoadWindow:

## Public Member Functions
void | GenerateFileName ()
| SaveLoadWindow (const WindowDesc *desc, SaveLoadDialogMode mode)
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 | OnPaint ()
| The window must be repainted.
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 | OnMouseLoop ()
| Called for every mouse loop run, which is at least once per (game) tick.
virtual EventState | OnKeyPress (uint16 key, uint16 keycode)
| A key has been pressed.
virtual void | OnTimeout ()
| Called when this window's timeout has been reached.
virtual void | OnResize ()
| Called after the window got resized.
virtual void | OnInvalidateData (int data)
| Some data on this window has become invalid.
## Private Attributes
FiosItem | o_dir

## Detailed Description

Definition at line 1669 of file misc_gui.cpp.

## Member Function Documentation

virtual void SaveLoadWindow::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 1755 of file misc_gui.cpp.

References _fios_items, Window::DrawSortButtonState(), DrawString(), FiosGetDescText(), FONT_HEIGHT_NORMAL, Scrollbar::GetCapacity(), Scrollbar::GetPosition(), GfxFillRect(), Window::resize, SBS_DOWN, SBS_UP, SetDParam(), ResizeInfo::step_height, Window::vscroll, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, and WD_FRAMERECT_TOP.

virtual void SaveLoadWindow::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 1824 of file misc_gui.cpp.

References _fios_items, _network_available, _saveload_mode, _switch_mode, Textbuf::buf, CONTENT_TYPE_HEIGHTMAP, CONTENT_TYPE_SCENARIO, Scrollbar::GetCount(), Scrollbar::GetPosition(), INVALID_STRING_ID, lastof, SmallFiosItem::name, Window::resize, Window::SetDirty(), Window::SetWidgetDirty(), ShowErrorMessage(), ShowNetworkContentListWindow(), SLWW_CONTENT_DOWNLOAD, SLWW_DELETE_SELECTION, SLWW_SAVE_GAME, SLWW_SAVE_OSK_TITLE, ResizeInfo::step_height, strecpy(), SmallFiosItem::title, ttd_strlcpy(), UpdateTextBufferSize(), Window::vscroll, and WD_FRAMERECT_TOP.

virtual void SaveLoadWindow::OnInvalidateData | ( | int | data | ) | `[inline, virtual]`

Some data on this window has become invalid.

Parameters:

  | data | information about the changed data.

Reimplemented from Window.

Definition at line 1958 of file misc_gui.cpp.

virtual EventState SaveLoadWindow::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 1911 of file misc_gui.cpp.

References _saveload_mode, Window::ES_HANDLED, Window::ES_NOT_HANDLED, Window::HandleButtonClick(), SLWW_SAVE_GAME, and SLWW_SAVE_OSK_TITLE.

virtual void SaveLoadWindow::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 1809 of file misc_gui.cpp.

References _fios_items, _saveload_mode, Window::DrawWidgets(), Scrollbar::SetCount(), SLWW_SAVE_OSK_TITLE, and Window::vscroll.

virtual void SaveLoadWindow::OnResize | ( |  | ) | `[inline, virtual]`

Called after the window got resized.

For nested windows with a viewport, call NWidgetViewport::UpdateViewportCoordinates.

Reimplemented from Window.

Definition at line 1953 of file misc_gui.cpp.

References Scrollbar::SetCapacityFromWidget(), and Window::vscroll.

virtual void SaveLoadWindow::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 1795 of file misc_gui.cpp.

References FONT_HEIGHT_NORMAL, WD_FRAMERECT_BOTTOM, and WD_FRAMERECT_TOP.

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

- src/misc_gui.cpp