Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

# CompanyLeagueWindow Class Reference

Inheritance diagram for CompanyLeagueWindow:

## Public Member Functions
| CompanyLeagueWindow (WindowDesc *desc, WindowNumber window_number)
virtual void | OnPaint ()
| The window must be repainted.
virtual void | DrawWidget (const Rect &r, int widget) const
| Draw the contents of a nested 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 | OnTick ()
| Called once per (game) tick.
virtual void | OnInvalidateData (int data=0, bool gui_scope=true)
| Some data on this window has become invalid.
## Private Member Functions
void | BuildCompanyList ()
| (Re)Build the company league list
## Static Private Member Functions
static int CDECL | PerformanceSorter (const Company *const *c1, const Company *const *c2)
| Sort the company league by performance history.
## Private Attributes
GUIList< const Company * > | companies
uint | ordinal_width
| The width of the ordinal number.
uint | text_width
| The width of the actual text.
uint | icon_width
| The width of the company icon.
int | line_height
| Height of the text lines.

## Detailed Description

Definition at line 1125 of file graph_gui.cpp.

## Member Function Documentation

virtual void CompanyLeagueWindow::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 1173 of file graph_gui.cpp.

References _current_text_dir, DrawCompanyIcon(), DrawString(), FONT_HEIGHT_NORMAL, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, SmallVector< T, S >::Length(), line_height, CompanyProperties::old_economy, ordinal_width, CompanyEconomyEntry::performance_history, SetDParam(), text_width, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, WD_FRAMERECT_TOP, and WID_CL_BACKGROUND.

virtual void CompanyLeagueWindow::OnInvalidateData | ( | int | data = `0`,
|  | bool | gui_scope = `true` |
| ) |  |  | `[inline, virtual]`

Some data on this window has become invalid.

Parameters:

  | data | Information about the changed data.
  | gui_scope | Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See InvalidateWindowData() for details.

Reimplemented from Window.

Definition at line 1252 of file graph_gui.cpp.

References GUIList< T, F >::ForceRebuild(), and GUIList< T, F >::ForceResort().

virtual void CompanyLeagueWindow::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 1165 of file graph_gui.cpp.

References BuildCompanyList(), Window::DrawWidgets(), PerformanceSorter(), and GUIList< T, F >::Sort().

virtual void CompanyLeagueWindow::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 1201 of file graph_gui.cpp.

References GetSpriteSize(), GetStringBoundingBox(), icon_width, lengthof, line_height, max(), ordinal_width, SetDParam(), text_width, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, WD_FRAMERECT_TOP, WID_CL_BACKGROUND, and Window::width.

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

- src/graph_gui.cpp