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. |
Definition at line 1048 of file network_gui.cpp.
virtual void NetworkStartServerWindow::DrawWidget | ( | const Rect & | r, | |
int | widget | |||
) | const [inline, virtual] |
Draw the contents of a nested widget.
r | Rectangle occupied by the widget. | |
widget | Number of the widget to draw. |
Reimplemented from Window.
Definition at line 1099 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::OnClick | ( | Point | pt, | |
int | widget, | |||
int | click_count | |||
) | [inline, virtual] |
A click with the left mouse button has been made on the window.
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 1108 of file network_gui.cpp.
References _ctrl_pressed, _is_network_server, _left_button_clicked, _settings_client, Clamp(), CS_ALPHANUMERAL, CS_NUMERAL, Window::flags, GENERATE_NEW_SEED, Window::HandleButtonClick(), lengthof, MAX_CLIENTS, NetworkSettings::max_clients, MAX_COMPANIES, NetworkSettings::max_companies, NetworkSettings::max_spectators, ClientSettings::network, NetworkSettings::server_advertise, NetworkSettings::server_lang, NetworkSettings::server_password, Window::SetDirty(), SetDParam(), SetDParamStr(), ShowDropDownMenu(), ShowGenerateLandscape(), ShowQueryString(), ShowSaveLoadDialog(), SLD_LOAD_GAME, SLD_LOAD_HEIGHTMAP, SLD_LOAD_SCENARIO, StartNewGameWithoutGUI(), Window::timeout_timer, WF_TIMEOUT, WID_NSS_CANCEL, WID_NSS_CLIENTS_BTND, WID_NSS_CLIENTS_BTNU, WID_NSS_CLIENTS_TXT, WID_NSS_COMPANIES_BTND, WID_NSS_COMPANIES_BTNU, WID_NSS_COMPANIES_TXT, WID_NSS_CONNTYPE_BTN, WID_NSS_GENERATE_GAME, WID_NSS_LANGUAGE_BTN, WID_NSS_LOAD_GAME, WID_NSS_PLAY_HEIGHTMAP, WID_NSS_PLAY_SCENARIO, WID_NSS_SETPWD, WID_NSS_SPECTATORS_BTND, WID_NSS_SPECTATORS_BTNU, WID_NSS_SPECTATORS_TXT, and widget_id.
virtual void NetworkStartServerWindow::OnDropdownSelect | ( | int | widget, | |
int | index | |||
) | [inline, virtual] |
A dropdown option associated to this window has been selected.
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 1204 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.
widget | The widget of the editbox. |
Reimplemented from Window.
Definition at line 1220 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.
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 1238 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.
widget | Widget number. |
Reimplemented from Window.
Definition at line 1063 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.
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 1088 of file network_gui.cpp.
References GetStringBoundingBox(), maxdim(), and WID_NSS_CONNTYPE_BTN.