Public Member Functions | Data Fields

GameOptionsWindow Struct Reference

Inheritance diagram for GameOptionsWindow:
Window ZeroedMemoryAllocator

Public Member Functions

 GameOptionsWindow (WindowDesc *desc)
DropDownListBuildDropDownList (int widget, int *selected_index) const
 Build the dropdown list for a specific widget.
virtual void SetStringParameters (int widget) const
 Initialize string parameters for a widget.
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.
template<class T >
void SetMediaSet (int index)
 Set the base media set.
virtual void OnDropdownSelect (int widget, int index)
 A dropdown option associated to this window has been selected.
virtual void OnInvalidateData (int data=0, bool gui_scope=true)
 Some data on this window has become invalid.

Data Fields

GameSettingsopt
bool reload

Detailed Description

Definition at line 152 of file settings_gui.cpp.


Member Function Documentation

DropDownList* GameOptionsWindow::BuildDropDownList ( int  widget,
int *  selected_index 
) const [inline]
virtual void GameOptionsWindow::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 323 of file settings_gui.cpp.

References DrawStringMultiLine(), GetCurrentLanguageIsoCode(), BaseMedia< MusicSet >::GetUsedSet(), BaseMedia< SoundsSet >::GetUsedSet(), BaseMedia< GraphicsSet >::GetUsedSet(), SetDParamStr(), WID_GO_BASE_GRF_DESCRIPTION, WID_GO_BASE_MUSIC_DESCRIPTION, and WID_GO_BASE_SFX_DESCRIPTION.

virtual void GameOptionsWindow::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 410 of file settings_gui.cpp.

References BuildDropDownList(), BaseMedia< MusicSet >::GetUsedSet(), BaseMedia< SoundsSet >::GetUsedSet(), BaseMedia< GraphicsSet >::GetUsedSet(), INVALID_STRING_ID, Window::SetDirty(), Window::SetWidgetLoweredState(), ShowBaseSetTextfileWindow(), ShowDropDownList(), ShowErrorMessage(), WID_GO_BASE_GRF_TEXTFILE, WID_GO_BASE_MUSIC_TEXTFILE, WID_GO_BASE_SFX_TEXTFILE, WID_GO_FULLSCREEN_BUTTON, WID_GO_RESOLUTION_DROPDOWN, and WL_ERROR.

virtual void GameOptionsWindow::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.
See also:
GameOptionsInvalidationData
Parameters:
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 541 of file settings_gui.cpp.

References BaseSet< T, Tnum_files, Tsearch_in_tars >::GetNumInvalid(), BaseSet< T, Tnum_files, Tsearch_in_tars >::GetNumMissing(), GetTextfile(), BaseMedia< MusicSet >::GetUsedSet(), BaseMedia< SoundsSet >::GetUsedSet(), BaseMedia< GraphicsSet >::GetUsedSet(), SetDataTip(), Window::SetWidgetDisabledState(), Window::SetWidgetLoweredState(), WID_GO_BASE_GRF_TEXTFILE, WID_GO_BASE_MUSIC_TEXTFILE, WID_GO_BASE_SFX_TEXTFILE, and WID_GO_FULLSCREEN_BUTTON.

template<class T >
void GameOptionsWindow::SetMediaSet ( int  index  )  [inline]

Set the base media set.

Parameters:
index the index of the media set
Template Parameters:
T class of media set

Definition at line 459 of file settings_gui.cpp.

References free(), and Window::InvalidateData().

virtual void GameOptionsWindow::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 343 of file settings_gui.cpp.

References SmallVector< T, S >::Begin(), BuildDropDownList(), SmallVector< T, S >::End(), GetCurrentLanguageIsoCode(), BaseSet< T, Tnum_files, Tsearch_in_tars >::GetNumInvalid(), BaseMedia< MusicSet >::GetNumSets(), BaseMedia< SoundsSet >::GetNumSets(), BaseMedia< GraphicsSet >::GetNumSets(), BaseMedia< MusicSet >::GetSet(), BaseMedia< SoundsSet >::GetSet(), BaseMedia< GraphicsSet >::GetSet(), GetStringBoundingBox(), GetStringHeight(), max(), maxdim(), SetDParam(), SetDParamStr(), WID_GO_BASE_GRF_DESCRIPTION, WID_GO_BASE_GRF_STATUS, WID_GO_BASE_MUSIC_DESCRIPTION, WID_GO_BASE_MUSIC_STATUS, WID_GO_BASE_SFX_DESCRIPTION, and Window::width.


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