OpenTTD Source: DropDownToggle< TBase, TEnd > Class Template Reference

OpenTTD Source 15.3

Public Member Functions | Private Attributes
DropDownToggle< TBase, TEnd > Class Template Reference

Drop down boolean toggle component. More...

`#include <dropdown_common_type.h>`

Inheritance diagram for DropDownToggle< TBase, TEnd >:

## Public Member Functions
template<typename... Args>
| DropDownToggle (bool on, int click, Colours button_colour, Colours background_colour, 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
bool | on
| Is item on.
int | click
| Click result when toggle used.
Colours | button_colour
| Colour of toggle button.
Colours | background_colour
| Colour of toggle background.

## Detailed Description

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

Drop down boolean toggle component.

Template Parameters

  TBase | Base component.
  TEnd | Position toggle at end if true, or start if false.

Definition at line 192 of file dropdown_common_type.h.

## Constructor & Destructor Documentation

## ◆ DropDownToggle()

template<class TBase , bool TEnd = false>
template<typename... Args>

DropDownToggle< TBase, TEnd >::DropDownToggle | ( | bool | on,
|  | int | click,
|  | Colours | button_colour,
|  | Colours | background_colour,
|  | Args &&... | args
| ) |  |
| inlineexplicit

Definition at line 199 of file dropdown_common_type.h.

## Member Function Documentation

## ◆ Draw()

template<class TBase , bool TEnd = false>

void DropDownToggle< TBase, TEnd >::Draw | ( | const Rect & | full,
|  | const Rect & | r,
|  | bool | sel,
|  | int | click_result,
|  | Colours | bg_colour
| ) |  | const
| inlineoverride

Definition at line 224 of file dropdown_common_type.h.

## ◆ Height()

template<class TBase , bool TEnd = false>

uint DropDownToggle< TBase, TEnd >::Height | ( |  | ) | const
| inlineoverride

Definition at line 204 of file dropdown_common_type.h.

## ◆ OnClick()

template<class TBase , bool TEnd = false>

int DropDownToggle< TBase, TEnd >::OnClick | ( | const Rect & | r,
|  | const Point & | pt
| ) |  | const
| inlineoverride

Definition at line 214 of file dropdown_common_type.h.

## ◆ Width()

template<class TBase , bool TEnd = false>

uint DropDownToggle< TBase, TEnd >::Width | ( |  | ) | const
| inlineoverride

Definition at line 209 of file dropdown_common_type.h.

## Field Documentation

## ◆ background_colour

template<class TBase , bool TEnd = false>

Colours DropDownToggle< TBase, TEnd >::background_colour
| private

Colour of toggle background.

Definition at line 196 of file dropdown_common_type.h.

## ◆ button_colour

template<class TBase , bool TEnd = false>

Colours DropDownToggle< TBase, TEnd >::button_colour
| private

Colour of toggle button.

Definition at line 195 of file dropdown_common_type.h.

## ◆ click

template<class TBase , bool TEnd = false>

int DropDownToggle< TBase, TEnd >::click
| private

Click result when toggle used.

Definition at line 194 of file dropdown_common_type.h.

## ◆ on

template<class TBase , bool TEnd = false>

bool DropDownToggle< TBase, TEnd >::on
| private

Is item on.

Definition at line 193 of file dropdown_common_type.h.

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

- src/dropdown_common_type.h