# CompanyLeagueWindow Class Reference

Inheritance diagram for CompanyLeagueWindow:

## Public Member Functions

| CompanyLeagueWindow (const 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)
| 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.

## Detailed Description

Definition at line 1025 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 1071 of file graph_gui.cpp.

References _dynlang, DrawString(), FONT_HEIGHT_NORMAL, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, SmallVector< T, S >::Length(), ordinal_width, CompanyEconomyEntry::performance_history, SetDParam(), TD_RTL, DynamicLanguages::text_dir, text_width, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, and WD_FRAMERECT_TOP.

virtual void CompanyLeagueWindow::OnInvalidateData | ( | int | data | ) | `[inline, virtual]`

Some data on this window has become invalid.

Parameters:

  | data | information about the changed data.

Reimplemented from Window.

Definition at line 1140 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 1063 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 1099 of file graph_gui.cpp.

References GetStringBoundingBox(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, lengthof, max(), MAX_COMPANIES, ordinal_width, SetDParam(), text_width, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, and Window::width.

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

- src/graph_gui.cpp