#include <unit_create.hpp>
Public Member Functions | |
tunit_create () | |
const std::string & | choice () const |
Unit type choice from the user. More... | |
bool | no_choice () const |
Whether the user actually chose a unit type or not. More... | |
unit_race::GENDER | gender () |
Gender choice from the user. More... | |
Public Member Functions inherited from gui2::tdialog | |
tdialog () | |
virtual | ~tdialog () |
bool | show (CVideo &video, const unsigned auto_close_time=0) |
Shows the window. More... | |
int | get_retval () const |
void | set_always_save_fields (const bool always_save_fields) |
void | set_restore (const bool restore) |
Private Member Functions | |
virtual const std::string & | window_id () const |
Inherited from tdialog, implemented by REGISTER_DIALOG. More... | |
void | pre_show (twindow &window) |
Inherited from tdialog. More... | |
bool | compare_type (unsigned i1, unsigned i2) const |
bool | compare_race (unsigned i1, unsigned i2) const |
bool | compare_type_rev (unsigned i1, unsigned i2) const |
bool | compare_race_rev (unsigned i1, unsigned i2) const |
void | post_show (twindow &window) |
Inherited from tdialog. More... | |
void | list_item_clicked (twindow &window) |
Callbacks. More... | |
void | filter_text_changed (ttext_ *textbox, const std::string &text) |
void | gender_toggle_callback (twindow &window) |
Private Attributes | |
std::vector< const unit_type * > | units_ |
unit_race::GENDER | gender_ |
std::string | choice_ |
std::vector< std::string > | last_words_ |
tgroup< unit_race::GENDER > | gender_toggle |
Additional Inherited Members | |
Protected Member Functions inherited from gui2::tdialog | |
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. More... | |
tfield_bool * | register_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>()) |
Creates a new boolean field. More... | |
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. More... | |
tfield_integer * | register_integer (const std::string &id, const bool mandatory, int &linked_variable) |
Creates a new integer field. More... | |
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. More... | |
tfield_text * | register_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false) |
Creates a new text field. More... | |
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. More... | |
tfield_label * | register_image (const std::string &id, const bool mandatory, const std::string &filename) |
Registers a new control as image. More... | |
Definition at line 33 of file unit_create.hpp.
gui2::tunit_create::tunit_create | ( | ) |
Definition at line 83 of file unit_create.cpp.
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 229 of file unit_create.cpp.
References gui2::tgrid::begin(), chars_equal_insensitive(), gui2::tlistbox::get_item_count(), gui2::tlistbox::get_row_grid(), gui2::twidget::get_window(), i, gui2::tcontrol::label(), last_words_, gui2::tlistbox::set_row_shown(), utils::split(), and t_string::str().
Referenced by pre_show().
|
inline |
Definition at line 274 of file unit_create.cpp.
References gender_, gender_toggle, and gui2::tgroup< T >::get_active_member_value().
Callbacks.
Definition at line 216 of file unit_create.cpp.
References units_.
Referenced by pre_show().
|
inline |
Whether the user actually chose a unit type or not.
Definition at line 45 of file unit_create.hpp.
References choice_.
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 192 of file unit_create.cpp.
References choice_, ERR_GUI_G, gender_, gui2::tdialog::get_retval(), gui2::tlistbox::get_selected_row(), last_chosen_type_id, last_gender, gui2::twindow::OK, and units_.
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 90 of file unit_create.cpp.
References gui2::tgroup< T >::add_member(), gui2::tlistbox::add_row(), unit_type_data::build_unit_type(), choice_, gui2::tlistbox::clear(), compare_race(), compare_race_rev(), compare_type(), compare_type_rev(), gui2::event::connect_signal_notify_modified(), ERR_GUI_G, unit_race::FEMALE, filter_text_changed(), unit_type::FULL, gender_toggle, gui2::tlistbox::get_item_count(), i, last_gender, list_item_clicked(), unit_race::MALE, gui2::tlistbox::select_row(), gui2::ttoggle_button::set_callback_state_change(), gui2::tlistbox::set_callback_value_change(), gui2::tlistbox::set_column_order(), gui2::tgroup< T >::set_member_states(), gui2::ttext_::set_text_changed_callback(), unit_type_data::types(), unit_types, and units_.
|
privatevirtual |
Inherited from tdialog, implemented by REGISTER_DIALOG.
Implements gui2::tdialog.
|
private |
Definition at line 61 of file unit_create.hpp.
Referenced by choice(), no_choice(), post_show(), and pre_show().
|
private |
Definition at line 59 of file unit_create.hpp.
Referenced by gender(), gender_toggle_callback(), and post_show().
|
private |
Definition at line 84 of file unit_create.hpp.
Referenced by gender_toggle_callback(), and pre_show().
|
private |
Definition at line 63 of file unit_create.hpp.
Referenced by filter_text_changed().
|
private |
Definition at line 57 of file unit_create.hpp.
Referenced by compare_race(), compare_race_rev(), compare_type(), compare_type_rev(), list_item_clicked(), post_show(), and pre_show().