The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
gui2::teditor_edit_side Class Reference

#include <edit_side.hpp>

Inheritance diagram for gui2::teditor_edit_side:
Inheritance graph

Public Member Functions

 teditor_edit_side (int side, std::string &team_name, std::string &user_team_name, int &gold, int &income, int &village_income, int &village_support, bool &fog, bool &shroud, team::SHARE_VISION &share_vision, team::CONTROLLER &controller, bool &no_leader, bool &hidden)
 
- 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)
 

Static Public Member Functions

static bool execute (int side, std::string &team_name, std::string &user_team_name, int &gold, int &income, int &village_income, int &village_support, bool &fog, bool &shroud, team::SHARE_VISION &share_vision, team::CONTROLLER &controller, bool &no_leader, bool &hidden, CVideo &video)
 The execute function see tdialog for more information. More...
 

Private Member Functions

void pre_show (twindow &window)
 Actions to be taken before showing the window. More...
 
void post_show (twindow &window)
 Actions to be taken after the window has been shown. More...
 
template<typename T >
void register_radio_toggle (const std::string &toggle_id, tgroup< T > &group, const T &enum_value, T &current_value, twindow &window)
 
virtual const std::stringwindow_id () const
 Inherited from tdialog, implemented by REGISTER_DIALOG. More...
 

Private Attributes

team::CONTROLLER & controller_
 
tgroup< team::CONTROLLER > controller_group
 
team::SHARE_VISION & share_vision_
 
tgroup< team::SHARE_VISION > vision_group
 

Additional Inherited Members

- Protected Member Functions inherited from gui2::tdialog
tfield_boolregister_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_boolregister_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_integerregister_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_integerregister_integer (const std::string &id, const bool mandatory, int &linked_variable)
 Creates a new integer field. More...
 
tfield_textregister_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_textregister_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false)
 Creates a new text field. More...
 
tfield_labelregister_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_labelregister_image (const std::string &id, const bool mandatory, const std::string &filename)
 Registers a new control as image. More...
 

Detailed Description

Definition at line 27 of file edit_side.hpp.

Constructor & Destructor Documentation

gui2::teditor_edit_side::teditor_edit_side ( int  side,
std::string team_name,
std::string user_team_name,
int gold,
int income,
int village_income,
int village_support,
bool &  fog,
bool &  shroud,
team::SHARE_VISION &  share_vision,
team::CONTROLLER &  controller,
bool &  no_leader,
bool &  hidden 
)

Definition at line 53 of file edit_side.cpp.

Referenced by execute().

Member Function Documentation

static bool gui2::teditor_edit_side::execute ( int  side,
std::string team_name,
std::string user_team_name,
int gold,
int income,
int village_income,
int village_support,
bool &  fog,
bool &  shroud,
team::SHARE_VISION &  share_vision,
team::CONTROLLER &  controller,
bool &  no_leader,
bool &  hidden,
CVideo video 
)
inlinestatic

The execute function see tdialog for more information.

Definition at line 45 of file edit_side.hpp.

References teditor_edit_side().

Referenced by editor::context_manager::edit_side_dialog().

void gui2::teditor_edit_side::post_show ( twindow window)
privatevirtual

Actions to be taken after the window has been shown.

At this point the registered fields already stored their values (if the OK has been pressed).

Parameters
windowThe window which has been shown.

Reimplemented from gui2::tdialog.

Definition at line 110 of file edit_side.cpp.

References controller_, controller_group, gui2::tgroup< T >::get_active_member_value(), share_vision_, and vision_group.

void gui2::teditor_edit_side::pre_show ( twindow window)
privatevirtual

Actions to be taken before showing the window.

At this point the registered fields are registered and initialized with their initial values.

Parameters
windowThe window to be shown.

Reimplemented from gui2::tdialog.

Definition at line 89 of file edit_side.cpp.

References controller_, controller_group, compression::NONE, share_vision_, and vision_group.

template<typename T >
void gui2::teditor_edit_side::register_radio_toggle ( const std::string toggle_id,
tgroup< T > &  group,
const T &  enum_value,
T &  current_value,
twindow window 
)
private
virtual const std::string& gui2::teditor_edit_side::window_id ( ) const
privatevirtual

Inherited from tdialog, implemented by REGISTER_DIALOG.

Implements gui2::tdialog.

Member Data Documentation

team::CONTROLLER& gui2::teditor_edit_side::controller_
private

Definition at line 82 of file edit_side.hpp.

Referenced by post_show(), and pre_show().

tgroup<team::CONTROLLER> gui2::teditor_edit_side::controller_group
private

Definition at line 83 of file edit_side.hpp.

Referenced by post_show(), and pre_show().

team::SHARE_VISION& gui2::teditor_edit_side::share_vision_
private

Definition at line 85 of file edit_side.hpp.

Referenced by post_show(), and pre_show().

tgroup<team::SHARE_VISION> gui2::teditor_edit_side::vision_group
private

Definition at line 86 of file edit_side.hpp.

Referenced by post_show(), and pre_show().


The documentation for this class was generated from the following files: