wex v24.10.0
|
Offers user data to be used by ctrl classes (as listview, stc). More...
#include <wex/factory/control.h>
Public Types | |
enum | action_t { INV , NOT , OR , SET , XOR } |
Determine how flags value are set. More... | |
Public Member Functions | |
const auto | col () const |
Returns col. | |
control & | col (int col) |
Sets column. | |
const auto & | command () const |
Returns command. | |
control & | command (const std::string &rhs) |
Sets command. | |
control & | is_ctag (bool rhs) |
Sets is_ctag. | |
const auto & | find () const |
Returns find. | |
control & | find (const std::string &text, int find_flags=0) |
Sets find. | |
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. | |
bool | inject (const std::function< bool(void)> &line=nullptr, const std::function< bool(void)> &col=nullptr, const std::function< bool(void)> &find=nullptr, const std::function< bool(void)> &command=nullptr) const |
injects data. | |
const auto | is_required () const |
Returns required. | |
control & | is_required (bool required) |
Sets required. | |
const auto | line () const |
Returns line. | |
control & | line (int line, std::function< int(int)> f=nullptr) |
Sets line number. | |
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. | |
void | reset () override |
Resets members to default state. | |
Public Member Functions inherited from wex::line_data | |
const auto | col () const |
Returns column. | |
line_data & | col (int col) |
Sets column. | |
const auto & | command () const |
Returns command. | |
line_data & | command (const std::string &command) |
Sets command. | |
auto | is_ctag () const |
Returns true if command is a ctag command. | |
line_data & | is_ctag (bool rhs) |
Sets ctag. | |
const auto | line () const |
Returns line number. | |
line_data & | line (int line, std::function< int(int)> f=nullptr) |
Sets line number. | |
Offers user data to be used by ctrl classes (as listview, stc).
First you can set the data using col, command, line, etc., then call inject to perform the action. You can set several items, inject prioritizes the actions.
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 | ( | const std::function< bool(void)> & | line = nullptr, |
const std::function< bool(void)> & | col = nullptr, | ||
const std::function< bool(void)> & | find = nullptr, | ||
const 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 |
|
inline |
Sets line number.
Goes to the line if > 0, if -1 goes to end of file