Public Member Functions | Private Attributes

SaveLoadWindow Struct Reference

Inheritance diagram for SaveLoadWindow:
Window ZeroedMemoryAllocator

Public Member Functions

void GenerateFileName ()
 Generate a default save filename.
 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 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 FiosItemselected
Scrollbarvscroll

Detailed Description

Definition at line 231 of file fios_gui.cpp.


Member Function Documentation

void SaveLoadWindow::GenerateFileName (  )  [inline]

Generate a default save filename.

Definition at line 240 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]
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 666 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_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 618 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 487 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 656 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 465 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: