Public Member Functions | Data Fields | Static Public Attributes

# GameSettingsWindow Struct Reference

Inheritance diagram for GameSettingsWindow:

## 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
SettingEntry * | valuewindow_entry
| If non-NULL, pointer to setting for which a value-entering window has been opened.
SettingEntry * | clicked_entry
| If non-NULL, pointer to a clicked numeric setting (with a depressed left or right button).
Scrollbar * | vscroll
## 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 GameSettings * | settings_ptr = NULL
| Pointer to the game settings being displayed and modified.

## Detailed Description

Definition at line 1577 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 1624 of file settings_gui.cpp.

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

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

References _current_text_dir, _left_button_clicked, _network_server, _networking, clicked_entry, SettingDescBase::cmd, SaveLoad::conv, CS_NUMERAL, SettingEntry::d, SettingDesc::desc, SettingEntry::entry, SettingsPage::FindEntry(), Window::flags, SettingDescBase::flags, SettingEntry::flags, SettingEntrySubtree::folded, Scrollbar::GetScrolledRowFromWidget(), SettingEntrySetting::index, SettingDescBase::interval, SettingsPage::Length(), SettingEntry::level, SettingDescBase::max, min(), SettingDescBase::min, QSF_ENABLE_DEFAULT, ReadValue(), SettingDesc::save, SDT_BOOLX, SDT_NUMX, SDT_ONEOFMANY, SEF_KIND_MASK, SEF_LEFT_DEPRESSED, SEF_RIGHT_DEPRESSED, SEF_SETTING_KIND, SettingEntry::SetButtons(), SetCompanySetting(), Scrollbar::SetCount(), Window::SetDirty(), SetDParam(), SetSettingValue(), Window::SetTimeout(), SettingEntrySetting::setting, SETTINGTREE_LEFT_OFFSET, SETTINGTREE_TOP_OFFSET, SGF_CURRENCY, SGF_MULTISTRING, SGF_NETWORK_ONLY, SGF_NO_NETWORK, SGF_PER_COMPANY, ShowQueryString(), SLF_NO_NETWORK_SYNC, SettingEntry::sub, TD_RTL, Window::timeout_timer, valuewindow_entry, WF_TIMEOUT, WID_GS_OPTIONSPANEL, and Window::width.

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 1749 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 1776 of file settings_gui.cpp.

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

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 1614 of file settings_gui.cpp.

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

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

- src/settings_gui.cpp