CompanyWindow Struct Reference

Window with general information about a company. More...

Inheritance diagram for CompanyWindow:
Window ZeroedMemoryAllocator

Public Types

enum  CompanyWindowPlanes {
  CWP_MP_EMPTY = 0, CWP_MP_C_PWD, 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

CompanyWindowWidgets query_widget

Detailed Description

Window with general information about a company.

Definition at line 1720 of file company_gui.cpp.


Member Enumeration Documentation

Display planes in the company window.

Enumerator:
CWP_MP_EMPTY 

Do not display any multiplayer button.

CWP_MP_C_PWD 

Display the company password button.

CWP_MP_C_JOIN 

Display the join company button.

CWP_VB_VIEW 

Display the view button.

CWP_VB_BUILD 

Display the build button.

CWP_RELOCATE_SHOW 

Show the relocate HQ button.

CWP_RELOCATE_HIDE 

Hide the relocate HQ button.

CWP_BUTTONS_LOCAL 

Buttons of the local company.

CWP_BUTTONS_OTHER 

Buttons of the other companies.

Definition at line 1725 of file company_gui.cpp.


Member Function Documentation

virtual void CompanyWindow::DrawWidget ( const Rect r,
int  widget 
) const [inline, virtual]
virtual void CompanyWindow::OnClick ( Point  pt,
int  widget,
int  click_count 
) [inline, virtual]
virtual void CompanyWindow::OnPaint (  )  [inline, virtual]
virtual void CompanyWindow::OnPlaceObject ( Point  pt,
TileIndex  tile 
) [inline, virtual]

The user clicked some place on the map when a tile highlight mode has been set.

Parameters:
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 2021 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.

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 2034 of file company_gui.cpp.

References CMD_MSG, CMD_RENAME_COMPANY, CMD_RENAME_PRESIDENT, DoCommandP(), NetworkClientRequestMove(), 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.

Parameters:
widget Widget number.

Reimplemented from Window.

Definition at line 1918 of file company_gui.cpp.

References CalculateCompanyValue(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), SetDParam(), 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.

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 1818 of file company_gui.cpp.

References CW_WIDGET_HAS_PASSWORD, GetSpriteSize(), GetStringBoundingBox(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, lengthof, max(), maxdim(), SetDParam(), and Window::width.


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

Generated on Sun Jan 9 16:02:45 2011 for OpenTTD by  doxygen 1.6.1