# StatusBarWindow Struct Reference

Inheritance diagram for StatusBarWindow:

## Public Member Functions
| StatusBarWindow (const WindowDesc *desc)
virtual Point | OnInitialPosition (const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
| Compute the initial position of the window.
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 | OnInvalidateData (int data=0, bool gui_scope=true)
| Some data on this window has become invalid.
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 | OnTick ()
| Called once per (game) tick.
## Data Fields
bool | saving
int | ticker_scroll
int | reminder_timeout
## Static Public Attributes
static const int | TICKER_STOP = 1640
| scrolling is finished when counter reaches this value
static const int | REMINDER_START = 91
| initial value of the reminder counter (right dot on the right)
static const int | REMINDER_STOP = 0
| reminder disappears when counter reaches this value
static const int | COUNTER_STEP = 2
| this is subtracted from active counters every tick

## Detailed Description

Definition at line 80 of file statusbar_gui.cpp.

## Member Function Documentation

virtual void StatusBarWindow::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 133 of file statusbar_gui.cpp.

References _date, _do_autosave, _local_company, _pause_mode, DrawSprite(), DrawString(), FindWindowById(), FONT_HEIGHT_NORMAL, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), GetSpriteSize(), InvalidateWindowData(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), CompanyProperties::money, PM_UNPAUSED, SA_HOR_CENTER, SBI_NEWS_DELETED, SBW_LEFT, SBW_MIDDLE, SBW_RIGHT, SetDParam(), NewsItem::string_id, TICKER_STOP, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, and WD_FRAMERECT_TOP.

virtual void StatusBarWindow::OnClick | ( | Point | pt,
|  | int | widget,
|  | int | click_count |
| ) |  |  | `[inline, virtual]`

A click with the left mouse button has been made on the window.

Parameters:

  | 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 207 of file statusbar_gui.cpp.

References _local_company, COMPANY_SPECTATOR, SBW_MIDDLE, SBW_RIGHT, ShowCompanyFinances(), and ShowLastNewsMessage().

virtual Point StatusBarWindow::OnInitialPosition | ( | const WindowDesc * | desc,
|  | int16 | sm_width,
|  | int16 | sm_height,
|  | int | window_number |
| ) |  |  | `[inline, virtual]`

Compute the initial position of the window.

Parameters:

  | *desc | The pointer to the WindowDesc of the window to create.
  | sm_width | Smallest width of the window.
  | sm_height | Smallest height of the window.
  | window_number | The window number of the new window.

Returns:
  Initial position of the top-left corner of the window.

Reimplemented from Window.

Definition at line 100 of file statusbar_gui.cpp.

virtual void StatusBarWindow::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 191 of file statusbar_gui.cpp.

References REMINDER_START, REMINDER_STOP, SBI_NEWS_DELETED, SBI_SAVELOAD_FINISH, SBI_SAVELOAD_START, SBI_SHOW_REMINDER, SBI_SHOW_TICKER, and TICKER_STOP.

virtual void StatusBarWindow::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 106 of file statusbar_gui.cpp.

References DAYS_IN_YEAR, GetStringBoundingBox(), MAX_YEAR, maxdim(), CompanyProperties::money, SBW_LEFT, SBW_RIGHT, and SetDParam().

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

- src/statusbar_gui.cpp