wex
v21.10.0
|
Offers a class to relate textctrl to values with iterators. More...
#include <wex/textctrl-input.h>
Public Types | |
typedef std::list< std::string > | values_t |
Type for keeping the values. | |
Public Member Functions | |
textctrl_input (ex_command::type_t type) | |
Constructor, fills values from config. More... | |
~textctrl_input () | |
Destructor, writes values (with a max for integers on the list) to config. | |
const std::string | get () const |
Returns value on the list pointed to by iterator, or empty string, if iterator is at end. | |
void | set (const std::string &value) |
Sets first value on the list, and removes it at other positions if present. More... | |
void | set (const textctrl *tc) |
Sets first value on the list from specified text control. | |
bool | set (int key, textctrl *tc=nullptr) |
Sets iterator according to specified key, and then sets value of text control (if not nullptr) to the list value related to iterator. More... | |
void | set (const values_t &values) |
Sets all values (values might be empty). More... | |
auto | type () const |
Returns type. | |
const auto & | values () const |
Returns the values. | |
Offers a class to relate textctrl to values with iterators.
wex::textctrl_input::textctrl_input | ( | ex_command::type_t | type | ) |
Constructor, fills values from config.
The specified type determines which key to use to retrieve the values.
type | the ex_command type used to get config values |
void wex::textctrl_input::set | ( | const std::string & | value | ) |
Sets first value on the list, and removes it at other positions if present.
Sets iterator to begin of list.
void wex::textctrl_input::set | ( | const values_t & | values | ) |
Sets all values (values might be empty).
Sets iterator to begin of list.
bool wex::textctrl_input::set | ( | int | key, |
textctrl * | tc = nullptr |
||
) |
Sets iterator according to specified key, and then sets value of text control (if not nullptr) to the list value related to iterator.
Returns false if current list is empty, or key not ok.
key | the key:
|
tc | the text control |