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

#include <resize_map.hpp>

Inheritance diagram for gui2::teditor_resize_map:
Inheritance graph

Public Types

enum  EXPAND_DIRECTION {
  EXPAND_BOTTOM_RIGHT, EXPAND_BOTTOM, EXPAND_BOTTOM_LEFT, EXPAND_RIGHT,
  EXPAND_CENTER, EXPAND_LEFT, EXPAND_TOP_RIGHT, EXPAND_TOP,
  EXPAND_TOP_LEFT
}
 

Public Member Functions

 teditor_resize_map (int &width, int &height, EXPAND_DIRECTION &expand_direction, bool &copy_edge_terrain)
 Constructor. 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)
 

Static Public Member Functions

static bool execute (int &width, int &height, EXPAND_DIRECTION &expand_direction, bool &copy_edge_terrain, CVideo &video)
 The execute function see tdialog for more information. More...
 

Private Member Functions

void update_expand_direction (twindow &window)
 
void set_direction_icon (int index, std::string icon)
 
void pre_show (twindow &window)
 Inherited from tdialog. More...
 
virtual const std::stringwindow_id () const
 Inherited from tdialog, implemented by REGISTER_DIALOG. More...
 

Private Attributes

tfield_integerwidth_
 The currently selected width. More...
 
tfield_integerheight_
 The currently selected height. More...
 
int old_width_
 The original width. More...
 
int old_height_
 The original height. More...
 
EXPAND_DIRECTIONexpand_direction_
 The selected expansion direction. More...
 
ttoggle_buttondirection_buttons_ [9]
 The toggle buttons show the state of expand_direction_. 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

Definition at line 25 of file resize_map.hpp.

Member Enumeration Documentation

Enumerator
EXPAND_BOTTOM_RIGHT 
EXPAND_BOTTOM 
EXPAND_BOTTOM_LEFT 
EXPAND_RIGHT 
EXPAND_CENTER 
EXPAND_LEFT 
EXPAND_TOP_RIGHT 
EXPAND_TOP 
EXPAND_TOP_LEFT 

Definition at line 28 of file resize_map.hpp.

Constructor & Destructor Documentation

gui2::teditor_resize_map::teditor_resize_map ( int width,
int height,
EXPAND_DIRECTION expand_direction,
bool &  copy_edge_terrain 
)

Constructor.

Parameters
[in,out]widthThe parameter's usage is:
  • Input: The initial width of the map.
  • Output: The selected width of the map if the dialog returns twindow::OK undefined otherwise.
[in,out]heightThe parameter's usage is:
  • Input: The initial height of the map.
  • Output: The selected height of the map if the dialog returns twindow::OK undefined otherwise.
[out]expand_directionThe selected expand direction if the dialog returns twindow::OK undefined otherwise.
[in,out]copy_edge_terrainThe parameter's usage is:
  • Input: The initial value of the copy edge toggle.
  • Output: The final value of the copy edge toggle if the dialog returns twindow::OK undefined otherwise.

Definition at line 91 of file resize_map.cpp.

Referenced by execute().

Member Function Documentation

static bool gui2::teditor_resize_map::execute ( int width,
int height,
EXPAND_DIRECTION expand_direction,
bool &  copy_edge_terrain,
CVideo video 
)
inlinestatic

The execute function see tdialog for more information.

Definition at line 74 of file resize_map.hpp.

References teditor_resize_map().

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

void gui2::teditor_resize_map::pre_show ( twindow window)
privatevirtual
void gui2::teditor_resize_map::set_direction_icon ( int  index,
std::string  icon 
)
private

Definition at line 150 of file resize_map.cpp.

References direction_buttons_, and gui2::ttoggle_button::set_icon_name().

Referenced by update_expand_direction().

void gui2::teditor_resize_map::update_expand_direction ( twindow window)
private
virtual const std::string& gui2::teditor_resize_map::window_id ( ) const
privatevirtual

Inherited from tdialog, implemented by REGISTER_DIALOG.

Implements gui2::tdialog.

Member Data Documentation

ttoggle_button* gui2::teditor_resize_map::direction_buttons_[9]
private

The toggle buttons show the state of expand_direction_.

Allows both so select a direction and visually show the effect of the selection.

Definition at line 107 of file resize_map.hpp.

Referenced by pre_show(), set_direction_icon(), and update_expand_direction().

EXPAND_DIRECTION& gui2::teditor_resize_map::expand_direction_
private

The selected expansion direction.

Definition at line 99 of file resize_map.hpp.

Referenced by update_expand_direction().

tfield_integer* gui2::teditor_resize_map::height_
private

The currently selected height.

Definition at line 90 of file resize_map.hpp.

Referenced by update_expand_direction().

int gui2::teditor_resize_map::old_height_
private

The original height.

Definition at line 96 of file resize_map.hpp.

Referenced by update_expand_direction().

int gui2::teditor_resize_map::old_width_
private

The original width.

Definition at line 93 of file resize_map.hpp.

Referenced by update_expand_direction().

tfield_integer* gui2::teditor_resize_map::width_
private

The currently selected width.

Definition at line 87 of file resize_map.hpp.

Referenced by update_expand_direction().


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