wex
v21.04.0
|
Offers user data to be used by ctrl classes (as listctrl, styledtextctrl). More...
#include <wex/control-data.h>
Public Types | |
enum | action_t { } |
Determine how flags value are set. More... | |
Public Member Functions | |
const auto & | col () const |
Returns column. | |
control & | col (int col) |
Sets column. More... | |
const auto & | command () const |
Returns command. | |
control & | command (const std::string &command) |
Sets command. More... | |
const auto & | find () const |
Returns find. | |
control & | find (const std::string &text, int find_flags=0) |
Sets find. More... | |
const auto | find_flags () const |
Returns find flags. | |
template<std::size_t N> | |
control & | flags (const std::bitset< N > &flags, std::bitset< N > &result, action_t action=SET) |
Sets specified flags. More... | |
bool | inject (std::function< bool(void)> line=nullptr, std::function< bool(void)> col=nullptr, std::function< bool(void)> find=nullptr, std::function< bool(void)> command=nullptr) const |
injects data. More... | |
const auto | is_required () const |
Returns required. | |
control & | is_required (bool required) |
Sets required. | |
const auto | line () const |
Returns line number. | |
control & | line (int line, std::function< int(int)> valid=nullptr) |
Sets line number. More... | |
void | reset () |
Resets members to default state. | |
const auto | validator () const |
Returns validator. | |
control & | validator (wxValidator *validator) |
Sets validator. | |
const auto & | window () const |
Returns window data. | |
control & | window (const data::window &data) |
Sets window data. | |
Offers user data to be used by ctrl classes (as listctrl, styledtextctrl).
First you can set the data using Col, Line, Find etc., then call inject to perform the action. You can set several items, inject prioritizes the actions.
control& wex::data::control::col | ( | int | col | ) |
Sets column.
Goes to column if col_number > 0
control& wex::data::control::command | ( | const std::string & | command | ) |
Sets command.
This is a vi command to execute.
control& wex::data::control::find | ( | const std::string & | text, |
int | find_flags = 0 |
||
) |
Sets find.
If not empty selects the text on that line (if line was specified) or finds text from begin (if line was 0) or end (line was -1).
text | text to find |
find_flags | find flags to be used |
|
inline |
Sets specified flags.
This is used by the other data classes as generic method to operate on flags.
bool wex::data::control::inject | ( | std::function< bool(void)> | line = nullptr , |
std::function< bool(void)> | col = nullptr , |
||
std::function< bool(void)> | find = nullptr , |
||
std::function< bool(void)> | command = nullptr |
||
) | const |
injects data.
If there is a callback specified, injects current data in it:
line | callback to inject line number |
col | callback to inject column number |
find | callback to inject find text |
command | callback to inject vi command |
control& wex::data::control::line | ( | int | line, |
std::function< int(int)> | valid = nullptr |
||
) |
Sets line number.
Goes to the line if > 0, if -1 goes to end of file