Window with general information about a company. More...
Public Types | |
enum | CompanyWindowPlanes { CWP_MP_C_PWD = 0, CWP_MP_C_JOIN, CWP_VB_VIEW = 0, CWP_VB_BUILD, CWP_RELOCATE_SHOW = 0, CWP_RELOCATE_HIDE, CWP_BUTTONS_LOCAL = 0, CWP_BUTTONS_OTHER } |
Display planes in the company window. More... | |
Public Member Functions | |
CompanyWindow (const WindowDesc *desc, WindowNumber window_number) | |
virtual void | OnPaint () |
The window must be repainted. | |
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 | SetStringParameters (int widget) const |
Initialize string parameters for a 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 | OnHundredthTick () |
Called once every 100 (game) ticks. | |
virtual void | OnPlaceObject (Point pt, TileIndex tile) |
The user clicked some place on the map when a tile highlight mode has been set. | |
virtual void | OnPlaceObjectAbort () |
The user cancelled a tile highlight mode that has been set. | |
virtual void | OnQueryTextFinished (char *str) |
The query window opened from this window has closed. | |
Data Fields | |
CompanyWidgets | query_widget |
Window with general information about a company.
Definition at line 1962 of file company_gui.cpp.
Display planes in the company window.
Definition at line 1967 of file company_gui.cpp.
virtual void CompanyWindow::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 2133 of file company_gui.cpp.
References _networking, CompanyInfrastructure::airport, CompanyProperties::colour, DrawCompanyManagerFace(), DrawSprite(), DrawString(), DrawStringMultiLine(), CompanyProperties::face, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), GetSpriteSize(), Company::group_all, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, Company::infrastructure, lengthof, NetworkCompanyIsPassworded(), GroupStatistics::num_vehicle, CompanyInfrastructure::rail, CompanyInfrastructure::road, SA_HOR_CENTER, SetDParam(), CompanyInfrastructure::signal, CompanyInfrastructure::station, CompanyInfrastructure::water, WID_C_DESC_COLOUR_SCHEME_EXAMPLE, WID_C_DESC_INFRASTRUCTURE_COUNTS, WID_C_DESC_OWNERS, WID_C_DESC_VEHICLE_COUNTS, WID_C_FACE, WID_C_FACE_TITLE, WID_C_HAS_PASSWORD, and Window::window_number.
virtual void CompanyWindow::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 2264 of file company_gui.cpp.
References _ctrl_pressed, _local_company, _network_server, BringWindowToFrontById(), CLIENT_ID_SERVER, CMD_BUY_SHARE_IN_COMPANY, CMD_MSG, CMD_SELL_SHARE_IN_COMPANY, CS_ALPHANUMERAL, DoCommandP(), DoSelectCompanyManagerFace(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), HT_RECT, Window::IsWidgetLowered(), Window::LowerWidget(), MarkWholeScreenDirty(), MAX_LENGTH_COMPANY_NAME_CHARS, MAX_LENGTH_PRESIDENT_NAME_CHARS, NETWORK_PASSWORD_LENGTH, NetworkClientRequestMove(), NetworkCompanyIsPassworded(), NetworkServerDoMove(), QSF_ENABLE_DEFAULT, QSF_LEN_IN_CHARS, Window::RaiseButtons(), ScrollMainWindowToTile(), SetDParam(), SetTileSelectSize(), Window::SetWidgetDirty(), ShowCompanyInfrastructure(), ShowExtraViewPortWindow(), ShowQueryString(), WC_COMPANY_COLOUR, WID_C_BUILD_HQ, WID_C_BUY_SHARE, WID_C_COLOUR_SCHEME, WID_C_COMPANY_JOIN, WID_C_COMPANY_NAME, WID_C_COMPANY_PASSWORD, WID_C_NEW_FACE, WID_C_PRESIDENT_NAME, WID_C_RELOCATE_HQ, WID_C_SELL_SHARE, WID_C_VIEW_HQ, WID_C_VIEW_INFRASTRUCTURE, and Window::window_number.
virtual void CompanyWindow::OnPaint | ( | ) | [inline, virtual] |
The window must be repainted.
Reimplemented from Window.
Definition at line 1991 of file company_gui.cpp.
References _local_company, _networking, _settings_game, EconomySettings::allow_shares, COMPANY_SPECTATOR, CWP_BUTTONS_LOCAL, CWP_MP_C_JOIN, CWP_MP_C_PWD, CWP_RELOCATE_HIDE, CWP_RELOCATE_SHOW, CWP_VB_BUILD, CWP_VB_VIEW, Window::DisableWidget(), Window::DrawWidgets(), GameSettings::economy, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), INVALID_COMPANY, INVALID_OWNER, INVALID_TILE, CompanyProperties::is_ai, Window::IsShaded(), lengthof, CompanyProperties::location_of_HQ, Window::ReInit(), Window::SetDirty(), NWidgetStacked::SetDisplayedPlane(), Window::SetWidgetDisabledState(), CompanyProperties::share_owners, NWidgetStacked::shown_plane, SZSP_NONE, WID_C_BUY_SHARE, WID_C_COMPANY_JOIN, WID_C_SELL_SHARE, WID_C_VIEW_HQ, and Window::window_number.
The user clicked some place on the map when a tile highlight mode has been set.
pt | the exact point on the map that has been clicked. | |
tile | the tile on the map that has been clicked. |
Reimplemented from Window.
Definition at line 2363 of file company_gui.cpp.
References CMD_BUILD_OBJECT, CMD_MSG, DoCommandP(), OBJECT_HQ, and Window::RaiseButtons().
virtual void CompanyWindow::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 2376 of file company_gui.cpp.
References CMD_MSG, CMD_RENAME_COMPANY, CMD_RENAME_PRESIDENT, DoCommandP(), NetworkClientRequestMove(), WID_C_COMPANY_JOIN, WID_C_COMPANY_NAME, WID_C_PRESIDENT_NAME, and Window::window_number.
virtual void CompanyWindow::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 2246 of file company_gui.cpp.
References CalculateCompanyValue(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), SetDParam(), WID_C_CAPTION, WID_C_DESC_COMPANY_VALUE, WID_C_DESC_INAUGURATION, and Window::window_number.
virtual void CompanyWindow::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 2079 of file company_gui.cpp.
References GetSpriteSize(), GetStringBoundingBox(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, lengthof, max(), maxdim(), SetDParam(), WID_C_DESC_COLOUR_SCHEME_EXAMPLE, WID_C_DESC_COMPANY_VALUE, WID_C_DESC_INFRASTRUCTURE_COUNTS, WID_C_DESC_OWNERS, WID_C_DESC_VEHICLE_COUNTS, WID_C_HAS_PASSWORD, and Window::width.