NetworkStartServerWindow Struct Reference

Inheritance diagram for NetworkStartServerWindow:
QueryStringBaseWindow Window QueryString 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 OnPaint ()
 The window must be repainted.
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.
byte widget_id
 The widget that has the pop-up input menu.

Detailed Description

Definition at line 1042 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 1095 of file network_gui.cpp.

References _settings_client, DrawString(), ClientSettings::network, 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]
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 1210 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 1231 of file network_gui.cpp.

References _settings_client, 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 1104 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 1254 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 1059 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 1084 of file network_gui.cpp.

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


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

Generated on Wed Apr 13 00:48:45 2011 for OpenTTD by  doxygen 1.6.1