Public Member Functions | Data Fields | Static Public Attributes

GameSettingsWindow Struct Reference

Inheritance diagram for GameSettingsWindow:
Window ZeroedMemoryAllocator

Public Member Functions

 GameSettingsWindow (const WindowDesc *desc)
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 DrawWidget (const Rect &r, int widget) const
 Draw the contents of a nested widget.
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 OnTimeout ()
 Called when this window's timeout has been reached.
virtual void OnQueryTextFinished (char *str)
 The query window opened from this window has closed.
virtual void OnResize ()
 Called after the window got resized.

Data Fields

SettingEntryvaluewindow_entry
 If non-NULL, pointer to setting for which a value-entering window has been opened.
SettingEntryclicked_entry
 If non-NULL, pointer to a clicked numeric setting (with a depressed left or right button).
Scrollbarvscroll

Static Public Attributes

static const int SETTINGTREE_LEFT_OFFSET = 5
 Position of left edge of setting values.
static const int SETTINGTREE_RIGHT_OFFSET = 5
 Position of right edge of setting values.
static const int SETTINGTREE_TOP_OFFSET = 5
 Position of top edge of setting values.
static const int SETTINGTREE_BOTTOM_OFFSET = 5
 Position of bottom edge of setting values.
static GameSettingssettings_ptr = NULL
 Pointer to the game settings being displayed and modified.

Detailed Description

Definition at line 1620 of file settings_gui.cpp.


Member Function Documentation

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

References SettingsPage::Draw(), Scrollbar::GetCapacity(), Scrollbar::GetPosition(), SETTINGSEL_OPTIONSPANEL, SETTINGTREE_LEFT_OFFSET, SETTINGTREE_RIGHT_OFFSET, and SETTINGTREE_TOP_OFFSET.

virtual void GameSettingsWindow::OnClick ( Point  pt,
int  widget,
int  click_count 
) [inline, virtual]
virtual void GameSettingsWindow::OnQueryTextFinished ( char *  str  )  [inline, virtual]

The query window opened from this window has closed.

Parameters:
str the new value of the string, NULL if the window was cancelled or an empty string when the default button was pressed, i.e. StrEmpty(str).

Reimplemented from Window.

Definition at line 1792 of file settings_gui.cpp.

References SettingEntry::d, SettingDescBase::def, SettingDesc::desc, SettingEntry::entry, SettingDescBase::flags, SettingEntry::flags, SettingEntrySetting::index, SEF_KIND_MASK, SEF_SETTING_KIND, SetCompanySetting(), Window::SetDirty(), SetSettingValue(), SettingEntrySetting::setting, SGF_CURRENCY, SGF_PER_COMPANY, StrEmpty(), and valuewindow_entry.

virtual void GameSettingsWindow::OnResize (  )  [inline, virtual]

Called after the window got resized.

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

Reimplemented from Window.

Definition at line 1819 of file settings_gui.cpp.

References Scrollbar::SetCapacityFromWidget(), SETTINGSEL_OPTIONSPANEL, SETTINGTREE_BOTTOM_OFFSET, and SETTINGTREE_TOP_OFFSET.

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

References FONT_HEIGHT_NORMAL, max(), SETTINGSEL_OPTIONSPANEL, SETTINGTREE_BOTTOM_OFFSET, and SETTINGTREE_TOP_OFFSET.


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