# NetworkStartServerWindow Struct Reference

Inheritance diagram for NetworkStartServerWindow:

## Public Member Functions

| NetworkStartServerWindow (const WindowDesc *desc)
virtual void | SetStringParameters (int widget) const
| Initialize string parameters for a 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 | DrawWidget (const Rect &r, int widget) const
| Draw the contents of a nested widget.
virtual void | OnPaint ()
| The window must be repainted.
void | DrawMapSelection (const Rect &r) const
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 | OnDropdownSelect (int widget, int index)
| A dropdown option associated to this window has been selected.
virtual void | OnMouseLoop ()
| Called for every mouse loop run, which is at least once per (game) tick.
virtual EventState | OnKeyPress (uint16 key, uint16 keycode)
| A key has been pressed.
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.

## Data Fields

byte | field
| Selected text-field.
FiosItem * | map
| Selected map.
byte | widget_id
| The widget that has the pop-up input menu.

## Detailed Description

Definition at line 1049 of file network_gui.cpp.

## Member Function Documentation

virtual void NetworkStartServerWindow::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 1113 of file network_gui.cpp.

References _settings_client, DrawString(), ClientSettings::network, NSSW_SELMAP, NSSW_SETPWD, NetworkSettings::server_password, StrEmpty(), WD_FRAMERECT_LEFT, and WD_FRAMERECT_RIGHT.

virtual void NetworkStartServerWindow::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 1158 of file network_gui.cpp.

References _fios_items, _is_network_server, _left_button_clicked, _settings_client, Clamp(), CS_ALPHANUMERAL, CS_NUMERAL, field, SmallFiosItem::filetype, Window::flags4, FONT_HEIGHT_NORMAL, FT_SCENARIO, Scrollbar::GetCount(), Scrollbar::GetPosition(), Window::HandleButtonClick(), lastof, lengthof, map, MAX_CLIENTS, NetworkSettings::max_clients, MAX_COMPANIES, NetworkSettings::max_companies, NetworkSettings::max_spectators, SmallFiosItem::name, ClientSettings::network, NSSW_CANCEL, NSSW_CLIENTS_BTND, NSSW_CLIENTS_BTNU, NSSW_CLIENTS_TXT, NSSW_COMPANIES_BTND, NSSW_COMPANIES_BTNU, NSSW_COMPANIES_TXT, NSSW_CONNTYPE_BTN, NSSW_LANGUAGE_BTN, NSSW_LOAD, NSSW_SELMAP, NSSW_SETPWD, NSSW_SPECTATORS_BTND, NSSW_SPECTATORS_BTNU, NSSW_SPECTATORS_TXT, NSSW_START, NetworkSettings::server_advertise, NetworkSettings::server_lang, NetworkSettings::server_password, Window::SetDirty(), SetDParam(), SetDParamStr(), ShowDropDownMenu(), ShowQueryString(), strecpy(), SmallFiosItem::title, Window::vscroll, WD_FRAMERECT_TOP, WF_TIMEOUT_MASK, WF_TIMEOUT_TRIGGER, and widget_id.

virtual void NetworkStartServerWindow::OnDropdownSelect | ( | int | widget,
|  | int | index |
| ) |  |  | `[inline, virtual]`

A dropdown option associated to this window has been selected.

Parameters:

  | widget | the widget (button) that the dropdown is associated with.
  | index | the element in the dropdown that is selected.

Reimplemented from Window.

Definition at line 1267 of file network_gui.cpp.

References _settings_client, ClientSettings::network, NSSW_CONNTYPE_BTN, NSSW_LANGUAGE_BTN, NetworkSettings::server_advertise, NetworkSettings::server_lang, and Window::SetDirty().

virtual EventState NetworkStartServerWindow::OnKeyPress | ( | uint16 | 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 1288 of file network_gui.cpp.

References _settings_client, Window::ES_NOT_HANDLED, field, lastof, ClientSettings::network, NSSW_GAMENAME, NetworkSettings::server_name, and strecpy().

virtual void NetworkStartServerWindow::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 1126 of file network_gui.cpp.

References Window::DrawWidgets(), and NSSW_GAMENAME.

virtual void NetworkStartServerWindow::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 1311 of file network_gui.cpp.

References _settings_client, Clamp(), lastof, MAX_CLIENTS, NetworkSettings::max_clients, MAX_COMPANIES, NetworkSettings::max_companies, NetworkSettings::max_spectators, ClientSettings::network, NSSW_CLIENTS_TXT, NSSW_COMPANIES_TXT, NSSW_SETPWD, NSSW_SPECTATORS_TXT, NetworkSettings::server_password, Window::SetDirty(), Window::SetWidgetDirty(), strecpy(), and widget_id.

virtual void NetworkStartServerWindow::SetStringParameters | ( | int | widget | ) | const`[inline, virtual]`

Initialize string parameters for a widget.

Calls to this function are made during initialization to measure the size (that is as part of InitNested()), during drawing, and while re-initializing the window. Only for widgets that render text initializing is requested.

Parameters:

  | widget | Widget number.

Reimplemented from Window.

Definition at line 1072 of file network_gui.cpp.

References _settings_client, NetworkSettings::max_clients, NetworkSettings::max_companies, NetworkSettings::max_spectators, ClientSettings::network, NSSW_CLIENTS_TXT, NSSW_COMPANIES_TXT, NSSW_CONNTYPE_BTN, NSSW_LANGUAGE_BTN, NSSW_SPECTATORS_TXT, NetworkSettings::server_advertise, NetworkSettings::server_lang, and SetDParam().

virtual void NetworkStartServerWindow::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 1097 of file network_gui.cpp.

References FONT_HEIGHT_NORMAL, GetStringBoundingBox(), maxdim(), NSSW_CONNTYPE_BTN, NSSW_SELMAP, WD_FRAMERECT_BOTTOM, and WD_FRAMERECT_TOP.

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

- src/network/network_gui.cpp