wex  v21.10.0
Public Types | Public Member Functions | List of all members
wex::textctrl_input Class Reference

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.
 

Detailed Description

Offers a class to relate textctrl to values with iterators.

Constructor & Destructor Documentation

◆ textctrl_input()

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.

Parameters
typethe ex_command type used to get config values

Member Function Documentation

◆ set() [1/3]

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.

◆ set() [2/3]

void wex::textctrl_input::set ( const values_t values)

Sets all values (values might be empty).

Sets iterator to begin of list.

◆ set() [3/3]

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.

Parameters
keythe key:
  • WXK_UP
  • WKK_DOWN
  • WXK_HOME
  • WXK_END
  • WXK_PAGEUP
  • WXK_PAGEDOWN
tcthe text control