Public Member Functions | Data Fields

NetworkStartServerWindow Struct Reference

Inheritance diagram for NetworkStartServerWindow:
Window ZeroedMemoryAllocator

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 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 OnEditboxChanged (int wid)
 The text in an editbox has been edited.
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 widget_id
 The widget that has the pop-up input menu.
QueryString name_editbox
 Server name editbox.

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 1100 of file network_gui.cpp.

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

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 1205 of file network_gui.cpp.

References _settings_client, ClientSettings::network, NetworkSettings::server_advertise, NetworkSettings::server_lang, Window::SetDirty(), WID_NSS_CONNTYPE_BTN, and WID_NSS_LANGUAGE_BTN.

virtual void NetworkStartServerWindow::OnEditboxChanged ( int  widget  )  [inline, virtual]

The text in an editbox has been edited.

Parameters:
widget The widget of the editbox.

Reimplemented from Window.

Definition at line 1221 of file network_gui.cpp.

References _settings_client, lastof, ClientSettings::network, NetworkSettings::server_name, strecpy(), and WID_NSS_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 1239 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, NetworkSettings::server_password, Window::SetDirty(), Window::SetWidgetDirty(), strecpy(), WID_NSS_CLIENTS_TXT, WID_NSS_COMPANIES_TXT, WID_NSS_SETPWD, WID_NSS_SPECTATORS_TXT, 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 1064 of file network_gui.cpp.

References _settings_client, NetworkSettings::max_clients, NetworkSettings::max_companies, NetworkSettings::max_spectators, ClientSettings::network, NetworkSettings::server_advertise, NetworkSettings::server_lang, SetDParam(), WID_NSS_CLIENTS_TXT, WID_NSS_COMPANIES_TXT, WID_NSS_CONNTYPE_BTN, WID_NSS_LANGUAGE_BTN, and WID_NSS_SPECTATORS_TXT.

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 1089 of file network_gui.cpp.

References GetStringBoundingBox(), maxdim(), and WID_NSS_CONNTYPE_BTN.


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