wex v24.04.0
Public Types | Public Member Functions | List of all members
wex::ex_commandline_input Class Reference

Offers a class to relate ex_commandline to values with iterators. More...

#include <wex/ui/ex-commandline-input.h>

Public Types

typedef wex::strings_t values_t
 Type for keeping the values.
 

Public Member Functions

 ex_commandline_input (ex_command::type_t type, const std::string &name="ex-cmd.other")
 Constructor, fills values from config.
 
 ~ex_commandline_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.
 
void set (const ex_commandline *cl)
 Sets first value on the list from specified commandline.
 
bool set (int key, wxTextEntryBase *te=nullptr)
 Sets iterator according to specified key, and then sets value of text control (if not nullptr) to the list value related to iterator.
 
void set (const values_t &values)
 Sets all values (values might be empty).
 
auto type () const
 Returns type.
 
const auto & values () const
 Returns the values.
 

Detailed Description

Offers a class to relate ex_commandline to values with iterators.

Constructor & Destructor Documentation

◆ ex_commandline_input()

wex::ex_commandline_input::ex_commandline_input ( ex_command::type_t type,
const std::string & name = "ex-cmd.other" )

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
namethe name, as used in config to store values

Member Function Documentation

◆ set() [1/3]

void wex::ex_commandline_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::ex_commandline_input::set ( const values_t & values)

Sets all values (values might be empty).

Sets iterator to begin of list.

◆ set() [3/3]

bool wex::ex_commandline_input::set ( int key,
wxTextEntryBase * te = 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
tethe text entry