Combo box

class CComboUnitParameter : public CBaseUnitParameter

Class for combobox unit parameters.

Public Functions

size_t GetValue() const

Returns currently selected item.

Returns

Currently selected item.

std::vector<size_t> GetItems() const

Returns all items.

Returns

All items.

std::vector<std::string> GetNames() const

Returns all items’ names.

Returns

All items’ names.

size_t GetItemByName(const std::string &_name) const

Returns item by its name.

Parameters

_name – Name of the item.

Returns

Item value.

std::string GetNameByItem(size_t _item) const

Returns name of the item.

Parameters

_item – Item value.

Returns

Name of the item.

bool HasItem(size_t _item) const

Returns true if the combobox contains the given item.

Parameters

_item – Item value.

Returns

Whether combobox contains the given item.

bool HasName(const std::string &_name) const

Returns true if the combobox contains an item with the given name.

Parameters

_name – Name of the item.

Returns

Whether combobox contains an item with the given name.

virtual bool IsInBounds() const override

Checks whether the selected item is one of the allowed items.

Returns

Whether the selected item is in allowed bounds.