# StatusBarWindow Struct Reference

Inheritance diagram for StatusBarWindow:

## Public Types

enum | { TICKER_STOP = 1640, REMINDER_START = 91, REMINDER_STOP = 0, COUNTER_STEP = 2 }

## 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 | 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 | OnInvalidateData (int data)
| 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

## Detailed Description

Definition at line 81 of file statusbar_gui.cpp.

## Member Enumeration Documentation

anonymous enum

Enumerator:

  TICKER_STOP | scrolling is finished when counter reaches this value
  REMINDER_START | initial value of the reminder counter (right dot on the right)
  REMINDER_STOP | reminder disappears when counter reaches this value
  COUNTER_STEP | this is subtracted from active counters every tick

Definition at line 86 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 139 of file statusbar_gui.cpp.

References _date, _pause_mode, _settings_client, DrawSprite(), DrawString(), FindWindowById(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), ClientSettings::gui, InvalidateWindowData(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), PM_UNPAUSED, SA_CENTER, SBI_NEWS_DELETED, SBW_LEFT, SBW_MIDDLE, SBW_RIGHT, SetDParam(), GUISettings::status_long_date, 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 203 of file statusbar_gui.cpp.

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

References WindowDesc::default_width, and max().

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

References Window::DrawWidgets().

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

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

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

- src/statusbar_gui.cpp