Public Member Functions | Private Attributes

# SaveLoadWindow Struct Reference

Inheritance diagram for SaveLoadWindow:

## Public Member Functions
void | GenerateFileName ()
| Generate a default save filename.
| SaveLoadWindow (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 EventState | OnKeyPress (WChar 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=0, bool gui_scope=true)
| Some data on this window has become invalid.
## Private Attributes
QueryString | filename_editbox
| Filename editbox.
FiosItem | o_dir
const FiosItem * | selected
Scrollbar * | vscroll

## Detailed Description

Definition at line 236 of file fios_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 331 of file fios_gui.cpp.

References _fios_colours, SmallVector< T, S >::Begin(), LoadCheckData::checkable, LoadCheckData::companies, ConvertYMDToDate(), Window::DrawSortButtonState(), DrawString(), DrawStringMultiLine(), SmallVector< T, S >::End(), LoadCheckData::error, LoadCheckData::error_data, FiosGetDescText(), FONT_HEIGHT_NORMAL, GameSettings::game_creation, GfxFillRect(), LoadCheckData::grf_compatibility, LoadCheckData::grfconfig, INVALID_STRING_ID, GameCreationSettings::landscape, CompanyProperties::name, CompanyProperties::name_1, CompanyProperties::name_2, PC_BLACK, PC_DARK_BLUE, PC_GREY, Window::resize, SA_HOR_CENTER, SBS_DOWN, SBS_UP, SetDParam(), SetDParamStr(), SLD_LOAD_GAME, SLD_LOAD_SCENARIO, SLD_SAVE_SCENARIO, GameCreationSettings::starting_year, ResizeInfo::step_height, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, WD_FRAMERECT_TOP, WD_PAR_VSEP_NORMAL, WID_SL_BACKGROUND, WID_SL_DETAILS, WID_SL_DRIVES_DIRECTORIES_LIST, WID_SL_SORT_BYDATE, and WID_SL_SORT_BYNAME.

void SaveLoadWindow::GenerateFileName | ( |  | ) | `[inline]`

Generate a default save filename.

Definition at line 245 of file fios_gui.cpp.

References Textbuf::buf, filename_editbox, GenerateDefaultSaveName(), and Textbuf::UpdateSize().

Referenced by OnTimeout().

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 503 of file fios_gui.cpp.

References _network_available, _settings_client, _switch_mode, Textbuf::Assign(), LoadCheckData::Clear(), ClearErrorMessages(), CONTENT_TYPE_HEIGHTMAP, CONTENT_TYPE_SCENARIO, filename_editbox, FiosBrowseTo(), GLC_NOT_FOUND, LoadCheckData::grf_compatibility, LoadCheckData::grfconfig, ClientSettings::gui, Window::HandleButtonClick(), LoadCheckData::HasErrors(), LoadCheckData::HasNewGrfs(), INVALID_STRING_ID, Window::InvalidateData(), lastof, SmallFiosItem::name, NO_DIRECTORY, SaveOrLoad(), Window::SetDirty(), Window::SetWidgetDirty(), ShowErrorMessage(), ShowHeightmapLoad(), ShowMissingContentWindow(), ShowNetworkContentListWindow(), ShowNewGRFSettings(), SL_LOAD_CHECK, SLD_LOAD_GAME, SLD_LOAD_HEIGHTMAP, SLD_LOAD_SCENARIO, SLD_SAVE_GAME, SLD_SAVE_HEIGHTMAP, SLD_SAVE_SCENARIO, SM_LOAD_GAME, SM_LOAD_SCENARIO, strecpy(), SmallFiosItem::title, GUISettings::UserIsAllowedToChangeNewGRFs(), WD_FRAMERECT_TOP, WID_SL_CONTENT_DOWNLOAD, WID_SL_DELETE_SELECTION, WID_SL_DRIVES_DIRECTORIES_LIST, WID_SL_HOME_BUTTON, WID_SL_LOAD_BUTTON, WID_SL_MISSING_NEWGRFS, WID_SL_NEWGRF_INFO, WID_SL_SAVE_GAME, WID_SL_SAVE_OSK_TITLE, WID_SL_SORT_BYDATE, WID_SL_SORT_BYNAME, and WL_ERROR.

virtual void SaveLoadWindow::OnInvalidateData | ( | int | data = `0`,
|  | bool | gui_scope = `true` |
| ) |  |  | `[inline, virtual]`

Some data on this window has become invalid.

Parameters:

  | 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 676 of file fios_gui.cpp.

References _settings_client, LoadCheckData::Clear(), GLC_NOT_FOUND, LoadCheckData::grf_compatibility, ClientSettings::gui, LoadCheckData::HasErrors(), LoadCheckData::HasNewGrfs(), Window::SetWidgetDisabledState(), SLD_LOAD_GAME, SLD_LOAD_HEIGHTMAP, SLD_LOAD_SCENARIO, GUISettings::UserIsAllowedToChangeNewGRFs(), WID_SL_LOAD_BUTTON, WID_SL_MISSING_NEWGRFS, and WID_SL_NEWGRF_INFO.

virtual EventState SaveLoadWindow::OnKeyPress | ( | WChar | 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 628 of file fios_gui.cpp.

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 492 of file fios_gui.cpp.

References Window::DrawWidgets().

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 666 of file fios_gui.cpp.

References WID_SL_DRIVES_DIRECTORIES_LIST.

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 470 of file fios_gui.cpp.

References FONT_HEIGHT_NORMAL, GetStringBoundingBox(), maxdim(), WD_FRAMERECT_TOP, WD_SORTBUTTON_ARROW_WIDTH, WID_SL_BACKGROUND, WID_SL_DRIVES_DIRECTORIES_LIST, WID_SL_SORT_BYDATE, and WID_SL_SORT_BYNAME.

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

- src/fios_gui.cpp