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

The dialog for selecting which random generator to use in the editor. More...

#include <generate_map.hpp>

Inheritance diagram for gui2::teditor_generate_map:
Inheritance graph

Public Member Functions

 teditor_generate_map ()
 
void set_map_generators (std::vector< map_generator * > mg)
 
std::vector< map_generator * > get_map_generators ()
 
map_generatorget_selected_map_generator ()
 
void select_map_generator (map_generator *mg)
 
boost::optional< boost::uint32_tget_seed ()
 
- 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::stringwindow_id () const
 Inherited from tdialog, implemented by REGISTER_DIALOG. More...
 
void pre_show (twindow &window)
 Inherited from tdialog. More...
 
void do_generator_selected (twindow &window)
 Callback for generator list selection changes. More...
 
void do_settings (twindow &window)
 Callback for the generator settings button. More...
 

Private Attributes

std::vector< map_generator * > map_generators_
 Available map generators. More...
 
map_generatorlast_map_generator_
 Last used map generator, must be in map_generators_. More...
 
int current_map_generator_
 Current map generator index. More...
 
std::string random_seed_
 random seed integer input More...
 

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

The dialog for selecting which random generator to use in the editor.

Definition at line 32 of file generate_map.hpp.

Constructor & Destructor Documentation

gui2::teditor_generate_map::teditor_generate_map ( )

Definition at line 64 of file generate_map.cpp.

Member Function Documentation

void gui2::teditor_generate_map::do_generator_selected ( twindow window)
private

Callback for generator list selection changes.

Definition at line 72 of file generate_map.cpp.

References current_map_generator_, gui2::tlistbox::get_selected_row(), map_generators_, and gui2::tbutton::set_active().

Referenced by pre_show().

void gui2::teditor_generate_map::do_settings ( twindow window)
private

Callback for the generator settings button.

Definition at line 87 of file generate_map.cpp.

References get_selected_map_generator(), map_generator::user_config(), and gui2::twindow::video().

Referenced by pre_show().

std::vector<map_generator*> gui2::teditor_generate_map::get_map_generators ( )
inline

Definition at line 42 of file generate_map.hpp.

References map_generators_.

boost::optional< boost::uint32_t > gui2::teditor_generate_map::get_seed ( )

Definition at line 145 of file generate_map.cpp.

References lexical_cast(), and random_seed_.

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

map_generator * gui2::teditor_generate_map::get_selected_map_generator ( )
void gui2::teditor_generate_map::pre_show ( twindow window)
privatevirtual
void gui2::teditor_generate_map::select_map_generator ( map_generator mg)

Definition at line 99 of file generate_map.cpp.

References last_map_generator_.

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

void gui2::teditor_generate_map::set_map_generators ( std::vector< map_generator * >  mg)
inline

Definition at line 37 of file generate_map.hpp.

References map_generators_.

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

virtual const std::string& gui2::teditor_generate_map::window_id ( ) const
privatevirtual

Inherited from tdialog, implemented by REGISTER_DIALOG.

Implements gui2::tdialog.

Member Data Documentation

int gui2::teditor_generate_map::current_map_generator_
private

Current map generator index.

Definition at line 73 of file generate_map.hpp.

Referenced by do_generator_selected(), and get_selected_map_generator().

map_generator* gui2::teditor_generate_map::last_map_generator_
private

Last used map generator, must be in map_generators_.

Definition at line 70 of file generate_map.hpp.

Referenced by pre_show(), and select_map_generator().

std::vector<map_generator*> gui2::teditor_generate_map::map_generators_
private

Available map generators.

Definition at line 67 of file generate_map.hpp.

Referenced by do_generator_selected(), get_map_generators(), get_selected_map_generator(), pre_show(), and set_map_generators().

std::string gui2::teditor_generate_map::random_seed_
private

random seed integer input

Definition at line 76 of file generate_map.hpp.

Referenced by get_seed(), and pre_show().


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