Add a register_text2 function.
The original version has an optional flag the new version a mandatory flag. The latter feels better. At some point all register functions need to be changed.
This commit is contained in:
parent
0a649850c6
commit
62ed384d10
2 changed files with 24 additions and 0 deletions
|
@ -185,6 +185,24 @@ tfield_text* tdialog::register_text2(const std::string& id
|
|||
return tdialog::register_text(id, !mandatory, linked_variable);
|
||||
}
|
||||
|
||||
tfield_text* tdialog::register_text2(const std::string& id
|
||||
, const bool mandatory
|
||||
, std::string (*callback_load_value) ()
|
||||
, void (*callback_save_value) (const std::string& value)
|
||||
, const bool capture_focus)
|
||||
{
|
||||
assert(!capture_focus || focus_.empty());
|
||||
|
||||
if(capture_focus) {
|
||||
focus_ = id;
|
||||
}
|
||||
|
||||
return tdialog::register_text(id
|
||||
, !mandatory
|
||||
, callback_load_value
|
||||
, callback_save_value);
|
||||
}
|
||||
|
||||
tfield_label* tdialog::register_label2(const std::string& id
|
||||
, const bool mandatory
|
||||
, const std::string& text
|
||||
|
|
|
@ -298,6 +298,12 @@ protected:
|
|||
, std::string& linked_variable
|
||||
, const bool capture_focus = false);
|
||||
|
||||
tfield_text* register_text2(const std::string& id
|
||||
, const bool mandatory
|
||||
, std::string (*callback_load_value) () = NULL
|
||||
, void (*callback_save_value) (const std::string& value) = NULL
|
||||
, const bool capture_focus = false);
|
||||
|
||||
/**
|
||||
* Registers a new control as a label.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue