#include <resize_map.hpp>
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 ©_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 ©_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::string & | window_id () const |
Inherited from tdialog, implemented by REGISTER_DIALOG. More... | |
Private Attributes | |
tfield_integer * | width_ |
The currently selected width. More... | |
tfield_integer * | height_ |
The currently selected height. More... | |
int | old_width_ |
The original width. More... | |
int | old_height_ |
The original height. More... | |
EXPAND_DIRECTION & | expand_direction_ |
The selected expansion direction. More... | |
ttoggle_button * | direction_buttons_ [9] |
The toggle buttons show the state of expand_direction_. More... | |
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 25 of file resize_map.hpp.
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.
gui2::teditor_resize_map::teditor_resize_map | ( | int & | width, |
int & | height, | ||
EXPAND_DIRECTION & | expand_direction, | ||
bool & | copy_edge_terrain | ||
) |
Constructor.
[in,out] | width | The parameter's usage is:
|
[in,out] | height | The parameter's usage is:
|
[out] | expand_direction | The selected expand direction if the dialog returns twindow::OK undefined otherwise. |
[in,out] | copy_edge_terrain | The parameter's usage is:
|
Definition at line 91 of file resize_map.cpp.
Referenced by execute().
|
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().
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 107 of file resize_map.cpp.
References gui2::event::connect_signal_notify_modified(), gui2::dialog_callback(), direction_buttons_, i, gui2::ttoggle_button::set_callback_state_change(), gui2::ttoggle_button::set_value(), and update_expand_direction().
|
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().
Definition at line 158 of file resize_map.cpp.
References direction_buttons_, expand_direction_, gui2::tfield< T, W, CT >::get_widget_value(), height_, i, ne, nw, old_height_, old_width_, gui2::resize_grid_xy_to_idx(), right, se, set_direction_icon(), gui2::ttoggle_button::set_value(), sw, swap(), and width_.
Referenced by pre_show().
|
privatevirtual |
Inherited from tdialog, implemented by REGISTER_DIALOG.
Implements gui2::tdialog.
|
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().
|
private |
The selected expansion direction.
Definition at line 99 of file resize_map.hpp.
Referenced by update_expand_direction().
|
private |
The currently selected height.
Definition at line 90 of file resize_map.hpp.
Referenced by update_expand_direction().
|
private |
The original height.
Definition at line 96 of file resize_map.hpp.
Referenced by update_expand_direction().
|
private |
The original width.
Definition at line 93 of file resize_map.hpp.
Referenced by update_expand_direction().
|
private |
The currently selected width.
Definition at line 87 of file resize_map.hpp.
Referenced by update_expand_direction().