OpenTTD Source 20260311-master-g511d3794ce
DropDownIcon< TBase, TEnd > Class Template Reference

Drop down icon component. More...

#include <dropdown_common_type.h>

Inheritance diagram for DropDownIcon< TBase, TEnd >:

Public Member Functions

template<typename... Args>
 DropDownIcon (SpriteID sprite, PaletteID palette, Args &&... args)
template<typename... Args>
 DropDownIcon (const Dimension &dim, SpriteID sprite, PaletteID palette, Args &&... args)
uint Height () const override
uint Width () const override
int OnClick (const Rect &r, const Point &pt) const override
void Draw (const Rect &full, const Rect &r, bool sel, int click_result, Colours bg_colour) const override

Private Attributes

SpriteID sprite
 Sprite ID to be drawn.
PaletteID palette
 Palette ID to use.
Dimension dsprite
 Bounding box dimensions of sprite.
Dimension dbounds
 Bounding box dimensions of bounds.

Detailed Description

template<class TBase, bool TEnd = false>
class DropDownIcon< TBase, TEnd >

Drop down icon component.

Template Parameters
TBaseBase component.
TEndPosition icon at end if true, or start if false.

Definition at line 121 of file dropdown_common_type.h.

Constructor & Destructor Documentation

◆ DropDownIcon() [1/2]

template<class TBase, bool TEnd = false>
template<typename... Args>
DropDownIcon< TBase, TEnd >::DropDownIcon ( SpriteID sprite,
PaletteID palette,
Args &&... args )
inlineexplicit

Definition at line 128 of file dropdown_common_type.h.

◆ DropDownIcon() [2/2]

template<class TBase, bool TEnd = false>
template<typename... Args>
DropDownIcon< TBase, TEnd >::DropDownIcon ( const Dimension & dim,
SpriteID sprite,
PaletteID palette,
Args &&... args )
inlineexplicit

Definition at line 135 of file dropdown_common_type.h.

Member Function Documentation

◆ Draw()

template<class TBase, bool TEnd = false>
void DropDownIcon< TBase, TEnd >::Draw ( const Rect & full,
const Rect & r,
bool sel,
int click_result,
Colours bg_colour ) const
inlineoverride

Definition at line 149 of file dropdown_common_type.h.

◆ Height()

template<class TBase, bool TEnd = false>
uint DropDownIcon< TBase, TEnd >::Height ( ) const
inlineoverride

Definition at line 140 of file dropdown_common_type.h.

◆ OnClick()

template<class TBase, bool TEnd = false>
int DropDownIcon< TBase, TEnd >::OnClick ( const Rect & r,
const Point & pt ) const
inlineoverride

Definition at line 143 of file dropdown_common_type.h.

◆ Width()

template<class TBase, bool TEnd = false>
uint DropDownIcon< TBase, TEnd >::Width ( ) const
inlineoverride

Definition at line 141 of file dropdown_common_type.h.

Field Documentation

◆ dbounds

template<class TBase, bool TEnd = false>
Dimension DropDownIcon< TBase, TEnd >::dbounds
private

Bounding box dimensions of bounds.

Definition at line 125 of file dropdown_common_type.h.

◆ dsprite

template<class TBase, bool TEnd = false>
Dimension DropDownIcon< TBase, TEnd >::dsprite
private

Bounding box dimensions of sprite.

Definition at line 124 of file dropdown_common_type.h.

◆ palette

template<class TBase, bool TEnd = false>
PaletteID DropDownIcon< TBase, TEnd >::palette
private

Palette ID to use.

Definition at line 123 of file dropdown_common_type.h.

◆ sprite

template<class TBase, bool TEnd = false>
SpriteID DropDownIcon< TBase, TEnd >::sprite
private

Sprite ID to be drawn.

Definition at line 122 of file dropdown_common_type.h.


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