|
OpenTTD Source 20260421-master-gc2fbc6fdeb
|
Button shown for either a company or client in the client-list. More...
Public Member Functions | |
| ButtonCommon (SpriteID sprite, StringID tooltip, Colours colour, bool disabled=false) | |
| Create the button. | |
| virtual | ~ButtonCommon ()=default |
| Ensure the destructor of the sub classes are called as well. | |
| 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. | |
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 1352 of file network_gui.cpp.
|
inline |
Create the button.
| sprite | The sprite to draw on the button. |
| tooltip | The tooltip of the button. |
| colour | The colour of the button. |
| disabled | Whether the button is disabled or not. |
Definition at line 1368 of file network_gui.cpp.
References colour, disabled, GetScaledSpriteSize(), WidgetDimensions::scaled, sprite, and tooltip.
Referenced by Button< CompanyID >::Button().
|
pure virtual |
OnClick handler for when the button is pressed.
| w | The window the click was in. |
| pt | The location the click was at. |
Implemented in Button< T >, Button< ClientID >, and Button< CompanyID >.
References Point.
Referenced by NetworkClientListWindow::OnClick().
| Colours ButtonCommon::colour |
The colour of the button.
Definition at line 1356 of file network_gui.cpp.
Referenced by Button< CompanyID >::Button(), and ButtonCommon().
| bool ButtonCommon::disabled |
Is the button disabled?
Definition at line 1357 of file network_gui.cpp.
Referenced by Button< CompanyID >::Button(), ButtonCommon(), Button< CompanyID >::OnClick(), and NetworkClientListWindow::RebuildListCompany().
| uint ButtonCommon::height |
Calculated height of the button.
Definition at line 1358 of file network_gui.cpp.
| SpriteID ButtonCommon::sprite |
The sprite to use on the button.
Definition at line 1354 of file network_gui.cpp.
Referenced by Button< CompanyID >::Button(), and ButtonCommon().
| StringID ButtonCommon::tooltip |
The tooltip of the button.
Definition at line 1355 of file network_gui.cpp.
Referenced by Button< CompanyID >::Button(), ButtonCommon(), and ButtonLine::GetTooltip().
| uint ButtonCommon::width |
Calculated width of the button.
Definition at line 1359 of file network_gui.cpp.