The Battle for Wesnoth  1.15.1+dev
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
gui2::dialogs::editor_resize_map Class Reference

#include <resize_map.hpp>

Inheritance diagram for gui2::dialogs::editor_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

 editor_resize_map (int &width, int &height, EXPAND_DIRECTION &expand_direction, bool &copy_edge_terrain)
 Constructor. More...
 
- Public Member Functions inherited from gui2::dialogs::modal_dialog
 modal_dialog ()
 
virtual ~modal_dialog ()
 
bool show (const unsigned auto_close_time=0)
 Shows the window. More...
 
windowget_window () const
 Returns a pointer to the dialog's window. More...
 
int get_retval () const
 
void set_always_save_fields (const bool always_save_fields)
 
void set_restore (const bool restore)
 
void set_allow_plugin_skip (const bool allow_plugin_skip)
 
void set_show_even_without_video (const bool show_even_without_video)
 

Private Member Functions

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

Private Attributes

field_integerwidth_
 The execute function. More...
 
field_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...
 
toggle_buttondirection_buttons_ [9]
 The toggle buttons show the state of expand_direction_. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gui2::dialogs::modal_dialog
field_boolregister_bool (const std::string &id, const bool mandatory, const std::function< bool()> callback_load_value=nullptr, const std::function< void(bool)> callback_save_value=nullptr, const std::function< void(widget &)> callback_change=nullptr, const bool initial_fire=false)
 Creates a new boolean field. More...
 
field_boolregister_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(widget &)> callback_change=nullptr, const bool initial_fire=false)
 Creates a new boolean field. More...
 
field_integerregister_integer (const std::string &id, const bool mandatory, const std::function< int()> callback_load_value=nullptr, const std::function< void(int)> callback_save_value=nullptr)
 Creates a new integer field. More...
 
field_integerregister_integer (const std::string &id, const bool mandatory, int &linked_variable)
 Creates a new integer field. More...
 
field_textregister_text (const std::string &id, const bool mandatory, const std::function< std::string()> callback_load_value=nullptr, const std::function< void(const std::string &)> callback_save_value=nullptr, const bool capture_focus=false)
 Creates a new text field. More...
 
field_textregister_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false)
 Creates a new text field. More...
 
field_labelregister_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false)
 Registers a new styled_widget as a label. More...
 
field_labelregister_image (const std::string &id, const bool mandatory, const std::string &filename)
 Registers a new styled_widget as image. More...
 
- Protected Attributes inherited from gui2::dialogs::modal_dialog
std::unique_ptr< windowwindow_
 The window object build for this dialog. More...
 

Detailed Description

Definition at line 27 of file resize_map.hpp.

Member Enumeration Documentation

◆ EXPAND_DIRECTION

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 30 of file resize_map.hpp.

Constructor & Destructor Documentation

◆ editor_resize_map()

gui2::dialogs::editor_resize_map::editor_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 retval::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 retval::OK undefined otherwise.
[out]expand_directionThe selected expand direction if the dialog returns retval::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 retval::OK undefined otherwise.

Definition at line 92 of file resize_map.cpp.

Member Function Documentation

◆ pre_show()

void gui2::dialogs::editor_resize_map::pre_show ( window window)
overrideprivatevirtual

◆ set_direction_icon()

void gui2::dialogs::editor_resize_map::set_direction_icon ( int  index,
std::string  icon 
)
private

◆ update_expand_direction()

void gui2::dialogs::editor_resize_map::update_expand_direction ( window window)
private

◆ window_id()

virtual const std::string& gui2::dialogs::editor_resize_map::window_id ( ) const
overrideprivatevirtual

Inherited from modal_dialog, implemented by REGISTER_DIALOG.

Implements gui2::dialogs::modal_dialog.

Member Data Documentation

◆ direction_buttons_

toggle_button* gui2::dialogs::editor_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 100 of file resize_map.hpp.

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

◆ expand_direction_

EXPAND_DIRECTION& gui2::dialogs::editor_resize_map::expand_direction_
private

The selected expansion direction.

Definition at line 92 of file resize_map.hpp.

Referenced by update_expand_direction().

◆ height_

field_integer* gui2::dialogs::editor_resize_map::height_
private

The currently selected height.

Definition at line 83 of file resize_map.hpp.

Referenced by update_expand_direction().

◆ old_height_

int gui2::dialogs::editor_resize_map::old_height_
private

The original height.

Definition at line 89 of file resize_map.hpp.

Referenced by update_expand_direction().

◆ old_width_

int gui2::dialogs::editor_resize_map::old_width_
private

The original width.

Definition at line 86 of file resize_map.hpp.

Referenced by update_expand_direction().

◆ width_

field_integer* gui2::dialogs::editor_resize_map::width_
private

The execute function.

See modal_dialog for more information. The currently selected width.

Definition at line 80 of file resize_map.hpp.

Referenced by update_expand_direction().


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