|
OpenTTD Source 20251104-master-g3befbdd52f
|
Base interface for a network client list line. More...
Public Member Functions | |
| virtual void | Draw (Rect r) const =0 |
| Draw the button line. | |
| template<typename T , typename... TArgs> | |
| T & | AddButton (TArgs &&... args) |
| ButtonCommon * | GetButton (Rect r, const Point &pt) const |
| Get the button at a given point on the line. | |
| virtual std::optional< EncodedString > | GetTooltip (Rect r, const Point &pt) const |
| Get tooptip for a given point on the line. | |
Data Fields | |
| std::vector< std::unique_ptr< ButtonCommon > > | buttons {} |
| Buttons for this line. | |
Protected Member Functions | |
| Rect | DrawButtons (Rect r) const |
| Draw the buttons for this line. | |
Base interface for a network client list line.
Definition at line 1387 of file network_gui.cpp.
|
inline |
Definition at line 1400 of file network_gui.cpp.
|
pure virtual |
Draw the button line.
| r | Rect to draw within. |
Implemented in CompanyButtonLine, and ClientButtonLine.
References buttons.
Draw the buttons for this line.
| r | Rect to draw within. |
Definition at line 1441 of file network_gui.cpp.
References _current_text_dir, WidgetDimensions::bevel, buttons, Rect::CentreToHeight(), DrawFrameRect(), FILLRECT_CHECKER, GetColourGradient(), GfxFillRect(), WidgetDimensions::hsep_normal, Rect::Indent(), SA_CENTER, WidgetDimensions::scaled, Rect::Shrink(), TD_RTL, and Rect::WithWidth().
Referenced by CompanyButtonLine::Draw(), and ClientButtonLine::Draw().
|
inline |
Get the button at a given point on the line.
| r | Rect of line. |
| pt | Point of interest. |
nullptr if button isn't pressed. Definition at line 1412 of file network_gui.cpp.
References _current_text_dir, buttons, Rect::Contains(), WidgetDimensions::hsep_normal, Rect::Indent(), WidgetDimensions::scaled, TD_RTL, and Rect::WithWidth().
Referenced by GetTooltip().
|
inlinevirtual |
Get tooptip for a given point on the line.
| r | Rect of line. |
| pt | Point of interest. |
std::nullopt if none. Reimplemented in ClientButtonLine.
Definition at line 1428 of file network_gui.cpp.
References GetButton(), GetEncodedString(), and ButtonCommon::tooltip.
Referenced by ClientButtonLine::GetTooltip().
| std::vector<std::unique_ptr<ButtonCommon> > ButtonLine::buttons {} |
Buttons for this line.
Definition at line 1389 of file network_gui.cpp.
Referenced by Draw(), DrawButtons(), and GetButton().