Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes

editor::editor_controller Class Reference

The editor_controller class contains the mouse and keyboard event handling routines for the editor. More...

#include <editor_controller.hpp>

Inheritance diagram for editor::editor_controller:
Inheritance graph
[legend]
Collaboration diagram for editor::editor_controller:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 editor_controller (const config &game_config, CVideo &video)
 The constructor.
 ~editor_controller ()
EXIT_STATUS main_loop ()
 Editor main loop.
void do_screenshot (const std::string &screenshot_filename="map_screenshot.bmp")
 Takes a screenshot.
void hotkey_quit ()
 Process a hotkey quit command.
void quit_confirm (EXIT_STATUS status)
 Show a quit confirmation dialog and if confirmed quit with the given exit status.
void editor_settings_dialog ()
 Display the settings dialog, used to control e.g.
void save_map ()
 Save the map, open dialog if not named yet.
bool can_execute_command (hotkey::HOTKEY_COMMAND, int index=-1) const
 command_executor override
hotkey::ACTION_STATE get_action_state (hotkey::HOTKEY_COMMAND command, int index) const
 command_executor override
bool execute_command (hotkey::HOTKEY_COMMAND command, int index=-1)
 command_executor override
void show_menu (const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu)
 controller_base override
void preferences ()
 Show the preferences dialog.
void toggle_grid ()
 Grid toggle.
void copy_selection ()
 Copy the selection on the current map to the clipboard.
void cut_selection ()
 Cut the selection from the current map to the clipboard.
void export_selection_coords ()
 Export the WML-compatible list of selected tiles to the system clipboard.
void update_mouse_action_highlights ()
void mouse_motion (int x, int y, const bool browse, bool update, map_location new_loc=map_location::null_location)
 Called when a mouse motion event takes place.
editor_displaygui ()
 Reference to the used display objects.
const editor_displaygui () const
 Const version.
bool allow_mouse_wheel_scroll (int x, int y)
 Derived classes can overrid this to disable mousewheel scrolling under some circumstances, e.g.
bool right_click_show_menu (int x, int y, const bool browse)
 Called in the default right_click when the context menu is about to be shown, can be used for preprocessing and preventing the menu from being displayed without rewriting the right click function.
bool left_click (int x, int y, const bool browse)
 Overridden in derived classes, called on a left click (mousedown).
void left_drag_end (int x, int y, const bool browse)
 Called whenever the left mouse drag has "ended".
void left_mouse_up (int x, int y, const bool browse)
 Called when the left mouse button is up.
bool right_click (int x, int y, const bool browse)
 Overridden in derived classes, called on a right click (mousedown).
void right_drag_end (int x, int y, const bool browse)
 Called whenever the right mouse drag has "ended".
void right_mouse_up (int x, int y, const bool browse)
 Called when the right mouse button is up.

Public Attributes

boost::scoped_ptr
< context_manager
context_manager_

Protected Member Functions

void process_keyup_event (const SDL_Event &event)
mouse_handler_base & get_mouse_handler_base ()
editor_displayget_display ()
mouse_actionget_mouse_action ()
 Get the current mouse action.
void perform_delete (editor_action *action)
 Perform an action, then delete the action object.
void perform_refresh_delete (editor_action *action, bool drag_part=false)
 Peform an action on the current map_context, then refresh the display and delete the pointer.
void editor_settings_dialog_redraw_callback (int r, int g, int b)
 Callback for the editor settings dialog to allow on-the-fly updating of the lighting display on the game map behing the dialog.

Private Member Functions

void init_gui ()
 init the display object and general set-up
void init_tods (const config &game_config)
 init the available time-of-day settings
void init_music (const config &game_config)
 init background music for the editor
void load_tooltips ()
 Load editor-specific tooltips.
void refresh_image_cache ()
 Reload images.
void display_redraw_callback (display &)
 Callback function passed to display to be called on each redraw_everything run.
void undo ()
 Undos an action in the current map context.
void redo ()
 Redos an action in the current map context.

Private Attributes

editor::menu_type active_menu_
boost::scoped_ptr< rand_rng::rngrng_
boost::scoped_ptr
< rand_rng::set_random_generator
rng_setter_
unit_map units_
boost::scoped_ptr< editor_displaygui_
 The display object used and owned by the editor.
std::vector< teamteams_
std::vector< time_of_daytods_
 Pre-defined time of day lighting settings for the settings dialog.
boost::scoped_ptr< editor_toolkittoolkit_
boost::scoped_ptr
< preferences::display_manager
prefs_disp_manager_
tooltips::manager tooltip_manager_
boost::scoped_ptr
< font::floating_label_context
floating_label_manager_
boost::scoped_ptr< halo::managerhalo_manager_
bool do_quit_
 Quit main loop flag.
EXIT_STATUS quit_mode_

Detailed Description

The editor_controller class contains the mouse and keyboard event handling routines for the editor.

It also serves as the main editor class with the general logic.

Definition at line 73 of file editor_controller.hpp.


Constructor & Destructor Documentation

editor::editor_controller::editor_controller ( const config game_config,
CVideo video 
)

The constructor.

A initial map context can be specified here, the controller will assume ownership and delete the pointer during destruction, but changes to the map can be retrieved between the main loop's end and the controller's destruction.

Definition at line 53 of file editor_controller.cpp.

References _, context_manager_, controller_base::game_config_, hotkey::get_hotkey(), gui(), gui_, hotkey::HOTKEY_QUIT_GAME, init_gui(), init_music(), init_tods(), controller_base::key_, cursor::NORMAL, events::raise_draw_event(), display::redraw_everything(), rng_, rng_setter_, cursor::set(), image::set_color_adjustment(), preferences::editor::tod_b(), preferences::editor::tod_g(), preferences::editor::tod_r(), and toolkit_.

Here is the call graph for this function:

editor::editor_controller::~editor_controller (  ) 

Definition at line 142 of file editor_controller.cpp.


Member Function Documentation

bool editor::editor_controller::allow_mouse_wheel_scroll ( int  x,
int  y 
) [virtual]

Derived classes can overrid this to disable mousewheel scrolling under some circumstances, e.g.

when the mouse wheel controls something else, but the event is also received by this class

Reimplemented from events::mouse_handler_base.

Definition at line 702 of file editor_controller.cpp.

References context_manager_, and gui().

Here is the call graph for this function:

bool editor::editor_controller::can_execute_command ( hotkey::HOTKEY_COMMAND  command,
int  index = -1 
) const

command_executor override

Definition at line 216 of file editor_controller.cpp.

References active_menu_, editor::AREA, context_manager_, gui2::hotkey(), hotkey::HOTKEY_ANIMATE_MAP, hotkey::HOTKEY_EDITOR_AUTO_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_BRUSH_NEXT, hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_HORIZONTAL, hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_VERTICAL, hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CCW, hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CW, hotkey::HOTKEY_EDITOR_CLOSE_MAP, hotkey::HOTKEY_EDITOR_COPY, hotkey::HOTKEY_EDITOR_CUT, hotkey::HOTKEY_EDITOR_DRAW_COORDINATES, hotkey::HOTKEY_EDITOR_DRAW_TERRAIN_CODES, hotkey::HOTKEY_EDITOR_EXPORT_SELECTION_COORDS, hotkey::HOTKEY_EDITOR_MAP_APPLY_MASK, hotkey::HOTKEY_EDITOR_MAP_CREATE_MASK_TO, hotkey::HOTKEY_EDITOR_MAP_GENERATE, hotkey::HOTKEY_EDITOR_MAP_LOAD, hotkey::HOTKEY_EDITOR_MAP_NEW, hotkey::HOTKEY_EDITOR_MAP_RESIZE, hotkey::HOTKEY_EDITOR_MAP_REVERT, hotkey::HOTKEY_EDITOR_MAP_ROTATE, hotkey::HOTKEY_EDITOR_MAP_SAVE, hotkey::HOTKEY_EDITOR_MAP_SAVE_ALL, hotkey::HOTKEY_EDITOR_MAP_SAVE_AS, hotkey::HOTKEY_EDITOR_PALETTE_DOWNSCROLL, hotkey::HOTKEY_EDITOR_PALETTE_GROUPS, hotkey::HOTKEY_EDITOR_PALETTE_ITEM_SWAP, hotkey::HOTKEY_EDITOR_PALETTE_UPSCROLL, hotkey::HOTKEY_EDITOR_PARTIAL_UNDO, hotkey::HOTKEY_EDITOR_PASTE, hotkey::HOTKEY_EDITOR_QUIT_TO_DESKTOP, hotkey::HOTKEY_EDITOR_REFRESH, hotkey::HOTKEY_EDITOR_REFRESH_IMAGE_CACHE, hotkey::HOTKEY_EDITOR_SELECT_ALL, hotkey::HOTKEY_EDITOR_SELECT_INVERSE, hotkey::HOTKEY_EDITOR_SELECT_NONE, hotkey::HOTKEY_EDITOR_SELECTION_FILL, hotkey::HOTKEY_EDITOR_SELECTION_FLIP, hotkey::HOTKEY_EDITOR_SELECTION_GENERATE, hotkey::HOTKEY_EDITOR_SELECTION_RANDOMIZE, hotkey::HOTKEY_EDITOR_SELECTION_ROTATE, hotkey::HOTKEY_EDITOR_SETTINGS, hotkey::HOTKEY_EDITOR_SWITCH_MAP, hotkey::HOTKEY_EDITOR_TOOL_FILL, hotkey::HOTKEY_EDITOR_TOOL_LABEL, hotkey::HOTKEY_EDITOR_TOOL_NEXT, hotkey::HOTKEY_EDITOR_TOOL_PAINT, hotkey::HOTKEY_EDITOR_TOOL_SELECT, hotkey::HOTKEY_EDITOR_TOOL_STARTING_POSITION, hotkey::HOTKEY_EDITOR_TOOL_UNIT, hotkey::HOTKEY_EDITOR_UPDATE_TRANSITIONS, hotkey::HOTKEY_FULLSCREEN, hotkey::HOTKEY_HELP, hotkey::HOTKEY_MAP_SCREENSHOT, hotkey::HOTKEY_MOUSE_SCROLL, hotkey::HOTKEY_MUTE, hotkey::HOTKEY_NULL, hotkey::HOTKEY_PREFERENCES, hotkey::HOTKEY_QUIT_GAME, hotkey::HOTKEY_REDO, hotkey::HOTKEY_SCREENSHOT, hotkey::HOTKEY_TOGGLE_GRID, hotkey::HOTKEY_UNDO, hotkey::HOTKEY_ZOOM_DEFAULT, hotkey::HOTKEY_ZOOM_IN, hotkey::HOTKEY_ZOOM_OUT, editor::MAP, editor::PALETTE, editor::SIDE, and hotkey::TITLE_SCREEN__RELOAD_WML.

Referenced by show_menu().

Here is the call graph for this function:

Here is the caller graph for this function:

void editor::editor_controller::copy_selection (  ) 

Copy the selection on the current map to the clipboard.

Definition at line 595 of file editor_controller.cpp.

References context_manager_.

Referenced by cut_selection(), and execute_command().

Here is the caller graph for this function:

void editor::editor_controller::cut_selection (  ) 

Cut the selection from the current map to the clipboard.

Definition at line 603 of file editor_controller.cpp.

References context_manager_, copy_selection(), and editor::get_selected_bg_terrain().

Referenced by execute_command().

Here is the call graph for this function:

Here is the caller graph for this function:

void editor::editor_controller::display_redraw_callback ( display  )  [private]

Callback function passed to display to be called on each redraw_everything run.

Redraws toolbar, brush bar and related items.

Definition at line 649 of file editor_controller.cpp.

References toolkit_.

Referenced by init_gui().

Here is the caller graph for this function:

void editor::editor_controller::do_screenshot ( const std::string &  screenshot_filename = "map_screenshot.bmp"  ) 

Takes a screenshot.

Definition at line 164 of file editor_controller.cpp.

References gui(), display::screenshot(), and twml_exception::show().

Here is the call graph for this function:

void editor::editor_controller::editor_settings_dialog (  ) 

Display the settings dialog, used to control e.g.

the lighting settings

Definition at line 194 of file editor_controller.cpp.

References _, context_manager_, gui2::teditor_settings::execute(), gui(), image::color_adjustment_resetter::reset(), gui2::show_error_message(), and tods_.

Referenced by execute_command().

Here is the call graph for this function:

Here is the caller graph for this function:

void editor::editor_controller::editor_settings_dialog_redraw_callback ( int  r,
int  g,
int  b 
) [protected]

Callback for the editor settings dialog to allow on-the-fly updating of the lighting display on the game map behing the dialog.

Definition at line 209 of file editor_controller.cpp.

References gui(), display::redraw_everything(), and image::set_color_adjustment().

Here is the call graph for this function:

bool editor::editor_controller::execute_command ( hotkey::HOTKEY_COMMAND  command,
int  index = -1 
)

command_executor override

Definition at line 355 of file editor_controller.cpp.

References active_menu_, editor::AREA, context_manager_, copy_selection(), cut_selection(), do_quit_, editor_settings_dialog(), editor::EXIT_NORMAL, editor::EXIT_QUIT_TO_DESKTOP, export_selection_coords(), gui(), gui2::hotkey(), hotkey::HOTKEY_EDITOR_AUTO_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_BRUSH_NEXT, hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_HORIZONTAL, hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_VERTICAL, hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CCW, hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CW, hotkey::HOTKEY_EDITOR_CLOSE_MAP, hotkey::HOTKEY_EDITOR_COPY, hotkey::HOTKEY_EDITOR_CUT, hotkey::HOTKEY_EDITOR_DRAW_COORDINATES, hotkey::HOTKEY_EDITOR_DRAW_TERRAIN_CODES, hotkey::HOTKEY_EDITOR_EXPORT_SELECTION_COORDS, hotkey::HOTKEY_EDITOR_MAP_APPLY_MASK, hotkey::HOTKEY_EDITOR_MAP_CREATE_MASK_TO, hotkey::HOTKEY_EDITOR_MAP_GENERATE, hotkey::HOTKEY_EDITOR_MAP_LOAD, hotkey::HOTKEY_EDITOR_MAP_NEW, hotkey::HOTKEY_EDITOR_MAP_RESIZE, hotkey::HOTKEY_EDITOR_MAP_REVERT, hotkey::HOTKEY_EDITOR_MAP_SAVE, hotkey::HOTKEY_EDITOR_MAP_SAVE_ALL, hotkey::HOTKEY_EDITOR_MAP_SAVE_AS, hotkey::HOTKEY_EDITOR_PALETTE_DOWNSCROLL, hotkey::HOTKEY_EDITOR_PALETTE_GROUPS, hotkey::HOTKEY_EDITOR_PALETTE_ITEM_SWAP, hotkey::HOTKEY_EDITOR_PALETTE_UPSCROLL, hotkey::HOTKEY_EDITOR_PARTIAL_UNDO, hotkey::HOTKEY_EDITOR_PASTE, hotkey::HOTKEY_EDITOR_QUIT_TO_DESKTOP, hotkey::HOTKEY_EDITOR_REFRESH, hotkey::HOTKEY_EDITOR_REFRESH_IMAGE_CACHE, hotkey::HOTKEY_EDITOR_SELECT_ALL, hotkey::HOTKEY_EDITOR_SELECT_INVERSE, hotkey::HOTKEY_EDITOR_SELECT_NONE, hotkey::HOTKEY_EDITOR_SELECTION_FILL, hotkey::HOTKEY_EDITOR_SELECTION_RANDOMIZE, hotkey::HOTKEY_EDITOR_SETTINGS, hotkey::HOTKEY_EDITOR_TOOL_FILL, hotkey::HOTKEY_EDITOR_TOOL_LABEL, hotkey::HOTKEY_EDITOR_TOOL_PAINT, hotkey::HOTKEY_EDITOR_TOOL_SELECT, hotkey::HOTKEY_EDITOR_TOOL_STARTING_POSITION, hotkey::HOTKEY_EDITOR_TOOL_UNIT, hotkey::HOTKEY_EDITOR_UPDATE_TRANSITIONS, hotkey::HOTKEY_NULL, hotkey::HOTKEY_QUIT_GAME, display::invalidate_all(), editor::MAP, editor::PALETTE, quit_confirm(), quit_mode_, refresh_image_cache(), save_map(), display::set_draw_coordinates(), preferences::editor::set_draw_hex_coordinates(), preferences::editor::set_draw_terrain_codes(), display::set_draw_terrain_codes(), editor::SIDE, hotkey::TITLE_SCREEN__RELOAD_WML, toolkit_, and undo().

Here is the call graph for this function:

void editor::editor_controller::export_selection_coords (  ) 

Export the WML-compatible list of selected tiles to the system clipboard.

Definition at line 609 of file editor_controller.cpp.

References context_manager_, and copy_to_clipboard().

Referenced by execute_command().

Here is the call graph for this function:

Here is the caller graph for this function:

hotkey::ACTION_STATE editor::editor_controller::get_action_state ( hotkey::HOTKEY_COMMAND  command,
int  index 
) const
editor_display& editor::editor_controller::get_display (  )  [inline, protected]

Definition at line 153 of file editor_controller.hpp.

References gui_.

mouse_action* editor::editor_controller::get_mouse_action (  )  [protected]

Get the current mouse action.

mouse_handler_base& editor::editor_controller::get_mouse_handler_base (  )  [inline, protected]

Definition at line 152 of file editor_controller.hpp.

editor_display& editor::editor_controller::gui (  )  [inline, virtual]

Reference to the used display objects.

Derived classes should ensure this is always valid. Note the constructor of this class cannot use this.

Implements events::mouse_handler_base.

Definition at line 137 of file editor_controller.hpp.

References gui_.

Referenced by allow_mouse_wheel_scroll(), do_screenshot(), editor_controller(), editor_settings_dialog(), editor_settings_dialog_redraw_callback(), execute_command(), init_gui(), left_click(), main_loop(), mouse_motion(), process_keyup_event(), quit_confirm(), right_click(), and show_menu().

Here is the caller graph for this function:

const editor_display& editor::editor_controller::gui (  )  const [inline, virtual]

Const version.

Implements events::mouse_handler_base.

Definition at line 138 of file editor_controller.hpp.

References gui_.

void editor::editor_controller::hotkey_quit (  ) 

Process a hotkey quit command.

void editor::editor_controller::init_gui (  )  [private]

init the display object and general set-up

Definition at line 103 of file editor_controller.cpp.

References context_manager_, display_redraw_callback(), preferences::editor::draw_hex_coordinates(), preferences::editor::draw_terrain_codes(), floating_label_manager_, preferences::grid(), gui(), gui_, halo_manager_, prefs_disp_manager_, display::set_draw_coordinates(), and display::set_draw_terrain_codes().

Referenced by editor_controller().

Here is the call graph for this function:

Here is the caller graph for this function:

void editor::editor_controller::init_music ( const config game_config  )  [private]

init background music for the editor

Definition at line 129 of file editor_controller.cpp.

References config::child(), config::child_range(), sound::commit_music_changes(), ERR_ED, and sound::play_music_config().

Referenced by editor_controller().

Here is the call graph for this function:

Here is the caller graph for this function:

void editor::editor_controller::init_tods ( const config game_config  )  [private]

init the available time-of-day settings

Definition at line 117 of file editor_controller.cpp.

References config::child(), config::child_range(), ERR_ED, and tods_.

Referenced by editor_controller().

Here is the call graph for this function:

Here is the caller graph for this function:

bool editor::editor_controller::left_click ( int  x,
int  y,
const bool  browse 
) [virtual]

Overridden in derived classes, called on a left click (mousedown).

Defaults to process (initiate) minimap scrolling.

Returns:
true when the click should not process the event further. This means do not treat the call as a start of drag movement. FIXME: This return value is currently ignored

Reimplemented from events::mouse_handler_base.

Definition at line 712 of file editor_controller.cpp.

References context_manager_, gui(), gui_, display::hex_clicked_on(), LOG_ED, perform_refresh_delete(), toolkit_, map_location::x, and map_location::y.

Here is the call graph for this function:

void editor::editor_controller::left_drag_end ( int  x,
int  y,
const bool  browse 
) [virtual]

Called whenever the left mouse drag has "ended".

Reimplemented from events::mouse_handler_base.

Definition at line 726 of file editor_controller.cpp.

References gui_, perform_delete(), and toolkit_.

Here is the call graph for this function:

void editor::editor_controller::left_mouse_up ( int  x,
int  y,
const bool  browse 
) [virtual]

Called when the left mouse button is up.

Reimplemented from events::mouse_handler_base.

Definition at line 732 of file editor_controller.cpp.

References context_manager_, gui_, perform_delete(), and toolkit_.

Here is the call graph for this function:

void editor::editor_controller::load_tooltips (  )  [private]

Load editor-specific tooltips.

EXIT_STATUS editor::editor_controller::main_loop (  ) 

Editor main loop.

Definition at line 149 of file editor_controller.cpp.

References _, do_quit_, gui(), controller_base::play_slice(), quit_mode_, twml_exception::show(), gui2::show_transient_message(), and game::error::what().

Here is the call graph for this function:

void editor::editor_controller::mouse_motion ( int  x,
int  y,
const bool  browse,
bool  update,
map_location  new_loc = map_location::null_location 
) [virtual]
void editor::editor_controller::perform_delete ( editor_action action  )  [protected]

Perform an action, then delete the action object.

The pointer can be NULL, in which case nothing will happen.

Definition at line 627 of file editor_controller.cpp.

References context_manager_.

Referenced by left_drag_end(), left_mouse_up(), right_drag_end(), and right_mouse_up().

Here is the caller graph for this function:

void editor::editor_controller::perform_refresh_delete ( editor_action action,
bool  drag_part = false 
) [protected]

Peform an action on the current map_context, then refresh the display and delete the pointer.

The pointer can be NULL, in which case nothing will happen.

Definition at line 635 of file editor_controller.cpp.

References context_manager_.

Referenced by left_click(), process_keyup_event(), and right_click().

Here is the caller graph for this function:

void editor::editor_controller::preferences (  ) 

Show the preferences dialog.

Definition at line 583 of file editor_controller.cpp.

References controller_base::game_config_, gui_, and preferences::show_preferences_dialog().

Here is the call graph for this function:

void editor::editor_controller::process_keyup_event ( const SDL_Event &  event  )  [protected]

Definition at line 768 of file editor_controller.cpp.

References gui(), perform_refresh_delete(), and toolkit_.

Here is the call graph for this function:

void editor::editor_controller::quit_confirm ( EXIT_STATUS  status  ) 

Show a quit confirmation dialog and if confirmed quit with the given exit status.

Definition at line 173 of file editor_controller.cpp.

References _, gui2::twindow::CANCEL, context_manager_, do_quit_, gui(), quit_mode_, gui2::show_message(), and gui2::tmessage::yes_no_buttons.

Referenced by execute_command().

Here is the call graph for this function:

Here is the caller graph for this function:

void editor::editor_controller::redo (  )  [private]

Redos an action in the current map context.

Definition at line 662 of file editor_controller.cpp.

References context_manager_.

void editor::editor_controller::refresh_image_cache (  )  [private]

Reload images.

Definition at line 643 of file editor_controller.cpp.

References context_manager_, and image::flush_cache().

Referenced by execute_command().

Here is the call graph for this function:

Here is the caller graph for this function:

bool editor::editor_controller::right_click ( int  x,
int  y,
const bool  browse 
) [virtual]

Overridden in derived classes, called on a right click (mousedown).

Defaults to displaying the menu (by setting the appropriate flag) if right_click_show_menu returns true.

Returns:
true when the click should not process the event further. This means do not treat the call as a start of drag movement.

Reimplemented from events::mouse_handler_base.

Definition at line 740 of file editor_controller.cpp.

References context_manager_, gui(), gui_, display::hex_clicked_on(), LOG_ED, perform_refresh_delete(), toolkit_, map_location::x, and map_location::y.

Here is the call graph for this function:

bool editor::editor_controller::right_click_show_menu ( int  x,
int  y,
const bool  browse 
) [virtual]

Called in the default right_click when the context menu is about to be shown, can be used for preprocessing and preventing the menu from being displayed without rewriting the right click function.

Returns:
true when the menu should be displayed and false otherwise FIXME: This return value is currently ignored

Reimplemented from events::mouse_handler_base.

Definition at line 707 of file editor_controller.cpp.

References toolkit_.

void editor::editor_controller::right_drag_end ( int  x,
int  y,
const bool  browse 
) [virtual]

Called whenever the right mouse drag has "ended".

Reimplemented from events::mouse_handler_base.

Definition at line 754 of file editor_controller.cpp.

References gui_, perform_delete(), and toolkit_.

Here is the call graph for this function:

void editor::editor_controller::right_mouse_up ( int  x,
int  y,
const bool  browse 
) [virtual]

Called when the right mouse button is up.

Reimplemented from events::mouse_handler_base.

Definition at line 760 of file editor_controller.cpp.

References context_manager_, gui_, perform_delete(), and toolkit_.

Here is the call graph for this function:

void editor::editor_controller::save_map (  )  [inline]

Save the map, open dialog if not named yet.

Definition at line 104 of file editor_controller.hpp.

References context_manager_.

Referenced by execute_command().

Here is the caller graph for this function:

void editor::editor_controller::show_menu ( const std::vector< std::string > &  items_arg,
int  xloc,
int  yloc,
bool  context_menu 
)
void editor::editor_controller::toggle_grid (  ) 

Grid toggle.

Definition at line 589 of file editor_controller.cpp.

References preferences::grid(), gui_, and preferences::set_grid().

Here is the call graph for this function:

void editor::editor_controller::undo (  )  [private]

Undos an action in the current map context.

Definition at line 656 of file editor_controller.cpp.

References context_manager_.

Referenced by execute_command().

Here is the caller graph for this function:

void editor::editor_controller::update_mouse_action_highlights (  ) 

Member Data Documentation

Quit main loop flag.

Definition at line 239 of file editor_controller.hpp.

Referenced by execute_command(), main_loop(), and quit_confirm().

Definition at line 234 of file editor_controller.hpp.

Referenced by init_gui().

boost::scoped_ptr<editor_display> editor::editor_controller::gui_ [private]

Definition at line 236 of file editor_controller.hpp.

Referenced by init_gui().

Definition at line 232 of file editor_controller.hpp.

Referenced by init_gui().

Definition at line 240 of file editor_controller.hpp.

Referenced by execute_command(), main_loop(), and quit_confirm().

boost::scoped_ptr<rand_rng::rng> editor::editor_controller::rng_ [private]

Definition at line 213 of file editor_controller.hpp.

Referenced by editor_controller().

Definition at line 215 of file editor_controller.hpp.

Referenced by editor_controller().

std::vector<team> editor::editor_controller::teams_ [private]

Definition at line 222 of file editor_controller.hpp.

Pre-defined time of day lighting settings for the settings dialog.

Definition at line 225 of file editor_controller.hpp.

Referenced by editor_settings_dialog(), and init_tods().

Definition at line 233 of file editor_controller.hpp.

Definition at line 217 of file editor_controller.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:19:38 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs