OpenTTD Source: DropDownString< TBase, TFs, TEnd > Class Template Reference

OpenTTD Source 14.0-beta3

Public Member Functions | Static Public Member Functions | Private Attributes
DropDownString< TBase, TFs, TEnd > Class Template Reference

Drop down string component. More...

`#include <dropdown_type.h>`

Inheritance diagram for DropDownString< TBase, TFs, TEnd >:

## Public Member Functions
template<typename... Args>
| DropDownString (StringID string, Args &&... args)
template<typename... Args>
| DropDownString (const std::string &string, Args &&... args)
void | SetString (std::string &&string)
uint | Height () const override
uint | Width () const override
void | Draw (const Rect &full, const Rect &r, bool sel, Colours bg_colour) const override

## Static Public Member Functions
static bool | NatSortFunc (std::unique_ptr< const DropDownListItem > const &first, std::unique_ptr< const DropDownListItem > const &second)
| Natural sorting comparator function for DropDownList::sort(). More...

## Private Attributes
std::string | string
| String to be drawn.
Dimension | dim
| Dimensions of string.

## Detailed Description

### template<class TBase, FontSize TFs = FS_NORMAL, bool TEnd = false>
class DropDownString< TBase, TFs, TEnd >

Drop down string component.

Template Parameters

  TBase | Base component.
  TFs | Font size.
  TEnd | Position string at end if true, or start if false.

Definition at line 82 of file dropdown_type.h.

## Member Function Documentation

## ◆ NatSortFunc()

template<class TBase , FontSize TFs = FS_NORMAL, bool TEnd = false>

static bool DropDownString< TBase, TFs, TEnd >::NatSortFunc | ( | std::unique_ptr< const DropDownListItem > const & | first,
|  | std::unique_ptr< const DropDownListItem > const & | second
| ) |  |
| inlinestatic

Natural sorting comparator function for DropDownList::sort().

Parameters

  first | Left side of comparison.
  second | Right side of comparison.

Returns
  true if first precedes second.

Warning
  All items in the list need to be derivates of DropDownListStringItem.

Definition at line 126 of file dropdown_type.h.

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

- src/widgets/dropdown_type.h