15 #define GETTEXT_DOMAIN "wesnoth-lib"
45 window->set_owner(
this);
77 const std::function<
bool()>& callback_load_value,
78 const std::function<
void(
const bool)>& callback_save_value,
79 const std::function<
void(
twidget&)>& callback_change)
94 bool& linked_variable,
95 const std::function<
void(
twidget&)>& callback_change)
98 =
new tfield_bool(
id, mandatory, linked_variable, callback_change);
106 const bool mandatory,
107 const std::function<
int()>& callback_load_value,
108 const std::function<
void(
const int)>& callback_save_value)
111 id, mandatory, callback_load_value, callback_save_value);
118 const bool mandatory,
119 int& linked_variable)
129 const bool mandatory,
130 const std::function<
std::string()>& callback_load_value,
131 const std::function<
void(
const std::string&)>& callback_save_value,
132 const bool capture_focus)
135 id, mandatory, callback_load_value, callback_save_value);
146 const bool mandatory,
148 const bool capture_focus)
161 const bool mandatory,
163 const bool use_markup)
195 field->attach_to_window(window);
196 field->widget_init(window);
211 field->widget_finalize(window);
213 field->detach_from_window();
twidget * find(const std::string &id, const bool must_be_active) override
See twidget::find.
virtual void pre_show(twindow &window)
Actions to be taken before showing the window.
bool always_save_fields_
Always save the fields upon closing.
twindow * build(CVideo &video, const twindow_builder::tresolution *definition)
Builds a window.
virtual void post_build(twindow &window)
Actions to be taken directly after the window is build.
int retval_
Returns the window exit status, 0 means not shown.
bool show(CVideo &video, const unsigned auto_close_time=0)
Shows the window.
Template class to implement the generic field implementation.
Implements some helper classes to ease adding fields to a dialog and hide the synchronization needed...
base class of top level items, the only item which needs to store the final canvases to draw on ...
A class inherited from ttext_box that displays its input as stars.
Dialog is closed with ok button.
virtual void post_show(twindow &window)
Actions to be taken after the window has been shown.
tfield_integer * register_integer(const std::string &id, const bool mandatory, const std::function< int()> &callback_load_value=std::function< int()>(), const std::function< void(const int)> &callback_save_value=std::function< void(const int)>())
Creates a new integer field.
static void field(LexState *ls, struct ConsControl *cc)
static size_t id
Ids for the timers.
#define DOUBLE_CLICK_EVENT
bool restore_
Restore the screen after showing?
virtual void init_fields(twindow &window)
Initializes all fields in the dialog and set the keyboard focus.
tfield_label * register_label(const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false)
Registers a new control as a label.
twindow * build_window(CVideo &video) const
Builds the window.
std::vector< tfield_ * > fields_
Contains the automatically managed fields.
tfield_bool * register_bool(const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value=std::function< bool()>(), const std::function< void(const bool)> &callback_save_value=std::function< void(const bool)>(), const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>())
Creates a new boolean field.
virtual void finalize_fields(twindow &window, const bool save_fields)
When the dialog is closed with the OK status saves all fields.
std::string focus_
Contains the widget that should get the focus when the window is shown.
void keyboard_capture(twidget *widget)
virtual const std::string & window_id() const =0
The id of the window to build.
Specialized field class for boolean.
tfield_text * register_text(const std::string &id, const bool mandatory, const std::function< std::string()> &callback_load_value=std::function< std::string()>(), const std::function< void(const std::string &)> &callback_save_value=std::function< void(const std::string &)>(), const bool capture_focus=false)
Creates a new text field.
GLsizei const GLcharARB ** string
Specialized field class for a control, used for labels and images.
Specialized field class for text.
tfield< int, tinteger_selector_ > tfield_integer