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=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. |
Definition at line 1153 of file graph_gui.cpp.
virtual void CompanyLeagueWindow::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 1199 of file graph_gui.cpp.
References _current_text_dir, DrawCompanyIcon(), DrawString(), FONT_HEIGHT_NORMAL, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, SmallVector< T, S >::Length(), CompanyProperties::old_economy, ordinal_width, CompanyEconomyEntry::performance_history, SetDParam(), TD_RTL, text_width, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, and WD_FRAMERECT_TOP.
virtual void CompanyLeagueWindow::OnInvalidateData | ( | int | data = 0 , |
|
bool | gui_scope = true | |||
) | [inline, virtual] |
Some data on this window has become invalid.
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 1273 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.
Reimplemented from Window.
Definition at line 1191 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.
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 1227 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.