Abstract base class for the fields. More...
#include <field.hpp>
Public Member Functions | |
tfield_ (const std::string &id, const bool mandatory) | |
Constructor. More... | |
virtual | ~tfield_ () |
void | attach_to_window (twindow &window) |
Attaches the field to a window. More... | |
void | widget_init (twindow &window) |
Initializes the widget. More... | |
void | widget_finalize (twindow &window) |
Finalizes the widget. More... | |
void | detach_from_window () |
Detaches the field from a window. More... | |
virtual void | widget_save (twindow &window)=0 |
Saves a widget. More... | |
virtual void | widget_restore (twindow &window)=0 |
Restores a widget. More... | |
void | widget_set_enabled (twindow &window, const bool enable, const bool sync) |
Enables a widget. More... | |
const std::string & | id () const |
bool | is_mandatory () const |
tcontrol * | widget () |
const tcontrol * | widget () const |
Private Member Functions | |
virtual void | init_generic (twindow &window)=0 |
See widget_init. More... | |
virtual void | init_specialized (twindow &) |
See widget_init. More... | |
virtual void | finalize_generic (twindow &window)=0 |
See widget_finalize. More... | |
virtual void | finalize_specialized (twindow &) |
See widget_finalize. More... | |
Private Attributes | |
const std::string | id_ |
The id field of the widget, should be unique in a window. More... | |
const bool | mandatory_ |
Is the widget optional or mandatory in this window. More... | |
tcontrol * | widget_ |
The widget attached to the field. More... | |
Abstract base class for the fields.
|
inline |
Attaches the field to a window.
When attached the widget which we're a wrapper around is stored linked in here.
window | The window to be attached to. |
Definition at line 79 of file field.hpp.
References id(), mandatory_, and widget_.
|
inline |
Detaches the field from a window.
Definition at line 133 of file field.hpp.
References mandatory_, and widget_.
See widget_finalize.
Implemented in gui2::tfield< T, W, CT >, gui2::tfield< bool, tselectable_ >, gui2::tfield< std::string, tcontrol, const std::string & >, and gui2::tfield< std::string, ttext_, const std::string & >.
Referenced by widget_finalize().
See widget_finalize.
Reimplemented in gui2::tfield_text.
Definition at line 241 of file field.hpp.
Referenced by widget_finalize().
|
inline |
Definition at line 198 of file field.hpp.
References id_.
Referenced by attach_to_window(), and gui2::tfield< std::string, ttext_, const std::string & >::validate_widget().
See widget_init.
Implemented in gui2::tfield< T, W, CT >, gui2::tfield< bool, tselectable_ >, gui2::tfield< std::string, tcontrol, const std::string & >, and gui2::tfield< std::string, ttext_, const std::string & >.
Referenced by widget_init().
See widget_init.
Reimplemented in gui2::tfield_label, and gui2::tfield_bool.
Definition at line 232 of file field.hpp.
Referenced by widget_init().
|
inline |
Definition at line 203 of file field.hpp.
References mandatory_.
Referenced by gui2::tfield< std::string, ttext_, const std::string & >::validate_widget().
|
inline |
Definition at line 208 of file field.hpp.
References widget_.
Referenced by gui2::tcustom_tod::pre_show(), and widget_set_enabled().
|
inline |
Finalizes the widget.
This routine is called after the dialog is closed with OK. It's called before post_show(). This routine does the following:
Like widget_init it calls two functions with the same purpose.
window | The window containing the widget. |
Definition at line 122 of file field.hpp.
References finalize_generic(), and finalize_specialized().
Initializes the widget.
This routine is called before the dialog is shown and the pre_show() is called. So the user can override the values set. This routine does the following:
The function calls two functions
window | The window containing the widget. |
Definition at line 103 of file field.hpp.
References init_generic(), and init_specialized().
Restores a widget.
See widget_save for more info.
window | The window containing the widget. |
Implemented in gui2::tfield< T, W, CT >, gui2::tfield< bool, tselectable_ >, gui2::tfield< std::string, tcontrol, const std::string & >, and gui2::tfield< std::string, ttext_, const std::string & >.
Referenced by widget_set_enabled().
Saves a widget.
It can be a window must be recreated, in that case the state needs to be saved and restored. This routine does the following:
window | The window containing the widget. |
Implemented in gui2::tfield< T, W, CT >, gui2::tfield< bool, tselectable_ >, gui2::tfield< std::string, tcontrol, const std::string & >, and gui2::tfield< std::string, ttext_, const std::string & >.
Referenced by widget_set_enabled().
|
inline |
Enables a widget.
window | The window containing the widget. |
enable | If true enables the widget, disables otherwise. |
sync | If the state is changed do we need to synchronize. Upon disabling, write the value of the widget in the variable value_. Upon enabling write the value of value_ in the widget. |
Definition at line 172 of file field.hpp.
References gui2::twindow::find(), gui2::tcontrol::get_active(), gui2::tcontrol::set_active(), widget(), widget_restore(), and widget_save().
Referenced by gui2::tmp_create_game::update_map_settings().
|
private |
|
private |
Is the widget optional or mandatory in this window.
Definition at line 223 of file field.hpp.
Referenced by attach_to_window(), detach_from_window(), and is_mandatory().
|
private |
The widget attached to the field.
Definition at line 226 of file field.hpp.
Referenced by attach_to_window(), detach_from_window(), and widget().