OpenTTD Source: src/statusbar_gui.cpp File Reference

OpenTTD Source 15.3

Data Structures | Functions | Variables
statusbar_gui.cpp File Reference

The GUI for the bottom status bar. More...

`#include "stdafx.h"`
`#include "core/backup_type.hpp"`
`#include "gfx_func.h"`
`#include "news_func.h"`
`#include "company_func.h"`
`#include "string_func.h"`
`#include "strings_func.h"`
`#include "company_base.h"`
`#include "tilehighlight_func.h"`
`#include "news_gui.h"`
`#include "company_gui.h"`
`#include "window_gui.h"`
`#include "saveload/saveload.h"`
`#include "window_func.h"`
`#include "statusbar_gui.h"`
`#include "toolbar_gui.h"`
`#include "core/geometry_func.hpp"`
`#include "zoom_func.h"`
`#include "timer/timer.h"`
`#include "timer/timer_game_calendar.h"`
`#include "timer/timer_window.h"`
`#include "widgets/statusbar_widget.h"`
`#include "table/strings.h"`
`#include "table/sprites.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | StatusBarWindow

## Functions
static bool | DrawScrollingStatusText (const NewsItem &ni, int scroll_pos, int left, int right, int top, int bottom)
bool | IsNewsTickerShown ()
| Checks whether the news ticker is currently being used.
void | ShowStatusBar ()
| Show our status bar.

## Variables
static constexpr std::initializer_list< NWidgetPart > | _nested_main_status_widgets
static WindowDesc | _main_status_desc (WDP_MANUAL, {}, 0, 0, WC_STATUS_BAR, WC_NONE, {WindowDefaultFlag::NoFocus, WindowDefaultFlag::NoClose}, _nested_main_status_widgets)

## Detailed Description

The GUI for the bottom status bar.

Definition in file statusbar_gui.cpp.

## Function Documentation

## ◆ DrawScrollingStatusText()

static bool DrawScrollingStatusText | ( | const NewsItem & | ni,
|  | int | scroll_pos,
|  | int | left,
|  | int | right,
|  | int | top,
|  | int | bottom
| ) |  |
| static

Definition at line 39 of file statusbar_gui.cpp.

## ◆ IsNewsTickerShown()

bool IsNewsTickerShown | ( |  | ) |

Checks whether the news ticker is currently being used.

Definition at line 231 of file statusbar_gui.cpp.

References FindWindowById(), StatusBarWindow::TICKER_STOP, and WC_STATUS_BAR.

Referenced by ReadyForNextTickerItem().

## ◆ ShowStatusBar()

void ShowStatusBar | ( |  | ) |

Show our status bar.

Definition at line 240 of file statusbar_gui.cpp.

Referenced by ShowVitalWindows().

## Variable Documentation

## ◆ _nested_main_status_widgets

constexpr std::initializer_list<NWidgetPart> _nested_main_status_widgets
| staticconstexpr

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_PANEL, COLOUR_GREY, WID_S_LEFT), SetMinimalSize(140, 12), EndContainer(),
NWidget(WWT_PUSHBTN, COLOUR_GREY, WID_S_MIDDLE), SetMinimalSize(40, 12), SetToolTip(STR_STATUSBAR_TOOLTIP_SHOW_LAST_NEWS), SetResize(1, 0),
NWidget(WWT_PUSHBTN, COLOUR_GREY, WID_S_RIGHT), SetMinimalSize(140, 12),
EndContainer(),
}
SetMinimalSize
constexpr NWidgetPart SetMinimalSize(int16_t x, int16_t y)
Widget part function for setting the minimal size.
Definition widget_type.h:1159
SetToolTip
constexpr NWidgetPart SetToolTip(StringID tip)
Widget part function for setting tooltip and clearing the widget data.
Definition widget_type.h:1321
EndContainer
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition widget_type.h:1232
NWidget
constexpr NWidgetPart NWidget(WidgetType tp, Colours col, WidgetID idx=INVALID_WIDGET)
Widget part function for starting a new 'real' widget.
Definition widget_type.h:1427
SetResize
constexpr NWidgetPart SetResize(int16_t dx, int16_t dy)
Widget part function for setting the resize step.
Definition widget_type.h:1148
WID_S_LEFT
@ WID_S_LEFT
Left part of the statusbar; date is shown there.
Definition statusbar_widget.h:15
WID_S_MIDDLE
@ WID_S_MIDDLE
Middle part; current news or company name or *** SAVING *** or *** PAUSED ***.
Definition statusbar_widget.h:16
WID_S_RIGHT
@ WID_S_RIGHT
Right part; bank balance.
Definition statusbar_widget.h:17
WWT_PUSHBTN
@ WWT_PUSHBTN
Normal push-button (no toggle button) with custom drawing.
Definition widget_type.h:104
NWID_HORIZONTAL
@ NWID_HORIZONTAL
Horizontal container.
Definition widget_type.h:66
WWT_PANEL
@ WWT_PANEL
Simple depressed panel.
Definition widget_type.h:39

Definition at line 213 of file statusbar_gui.cpp.