OpenTTD Source: ButtonCommon Class Reference

OpenTTD Source 15.0-beta1

Public Member Functions | Data Fields
ButtonCommon Class Referenceabstract

Button shown for either a company or client in the client-list. More...

Inheritance diagram for ButtonCommon:

## Public Member Functions
| ButtonCommon (SpriteID sprite, StringID tooltip, Colours colour, bool disabled=false)
virtual void | OnClick (struct NetworkClientListWindow *w, Point pt)=0
| OnClick handler for when the button is pressed.

## Data Fields
SpriteID | sprite
| The sprite to use on the button.
StringID | tooltip
| The tooltip of the button.
Colours | colour
| The colour of the button.
bool | disabled
| Is the button disabled?
uint | height
| Calculated height of the button.
uint | width
| Calculated width of the button.

## Detailed Description

Button shown for either a company or client in the client-list.

These buttons are dynamic and strongly depends on which company/client what buttons are available. This class allows dynamically creating them as the current Widget system does not.

Definition at line 1360 of file network_gui.cpp.

## Constructor & Destructor Documentation

## ◆ ButtonCommon()

ButtonCommon::ButtonCommon | ( | SpriteID | sprite,
|  | StringID | tooltip,
|  | Colours | colour,
|  | bool | disabled = `false`
| ) |  |
| inline

Definition at line 1369 of file network_gui.cpp.

## Member Function Documentation

## ◆ OnClick()

virtual void ButtonCommon::OnClick | ( | struct NetworkClientListWindow * | w,
|  | Point | pt
| ) |  |
| pure virtual

OnClick handler for when the button is pressed.

Implemented in Button< T >.

Referenced by NetworkClientListWindow::OnClick().

## Field Documentation

## ◆ colour

Colours ButtonCommon::colour

The colour of the button.

Definition at line 1364 of file network_gui.cpp.

## ◆ disabled

bool ButtonCommon::disabled

Is the button disabled?

Definition at line 1365 of file network_gui.cpp.

Referenced by Button< T >::OnClick(), and NetworkClientListWindow::RebuildListCompany().

## ◆ height

uint ButtonCommon::height

Calculated height of the button.

Definition at line 1366 of file network_gui.cpp.

## ◆ sprite

SpriteID ButtonCommon::sprite

The sprite to use on the button.

Definition at line 1362 of file network_gui.cpp.

## ◆ tooltip

StringID ButtonCommon::tooltip

The tooltip of the button.

Definition at line 1363 of file network_gui.cpp.

Referenced by NetworkClientListWindow::OnTooltip().

## ◆ width

uint ButtonCommon::width

Calculated width of the button.

Definition at line 1367 of file network_gui.cpp.

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

- src/network/network_gui.cpp