hoa_editor::Editor Class Reference

#include <editor.h>

Inheritance diagram for hoa_editor::Editor:

Inheritance graph
[legend]
Collaboration diagram for hoa_editor::Editor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Editor ()
 Macro needed to use Qt's slots and signals.
 ~Editor ()

Protected Member Functions

void closeEvent (QCloseEvent *)

Private Slots

void _FileMenuSetup ()
 This slot is used to gray out items in the File menu.
File Menu Item Slots
These slots process selection for their item in the File menu.

void _FileNew ()
void _FileOpen ()
void _FileQuit ()
void _FileResize ()
void _FileSave ()
void _FileSaveAs ()
Help Menu Item Slots
These slots process selection for their item in the Help menu.

void _HelpAbout ()
void _HelpAboutQt ()
void _HelpHelp ()
Map Menu Item Slots
These slots process selection for their item in the Map menu.

void _MapSelectMusic ()
Tiles Menu Item Slots
These slots process selection for their item in the Tiles menu.

void _TileEditLL ()
void _TileEditML ()
void _TileEditUL ()
void _TileLayerClear ()
void _TileLayerFill ()
void _TileModeDelete ()
void _TileModeMove ()
void _TileModePaint ()
View Menu Item Slots
These slots process selection for their item in the View menu.

void _ViewToggleGrid ()
void _ViewToggleLL ()
void _ViewToggleML ()
void _ViewToggleUL ()

Private Member Functions

bool _EraseOK ()
 Saves the map if it is unsaved.
void _SetEditLayer (LAYER_TYPE new_layer)
 Sets currently edited layer.
void _SetEditMode (TILE_MODE_TYPE new_mode)
 Sets current edit mode.

Private Attributes

Q3BoxLayout * _ed_layout
 Main window layout.
EditorScrollView_ed_scrollview
 Used to add scrollbars to the QGLWidget of the map.
QTabWidget * _ed_tabs
 Tabbed widget of tilesets.
QWidget * _ed_widget
 Needed for _ed_layout for it's children.
Q3PopupMenu * _file_menu
 This is used to represent the File menu.
int _grid_id
 Grid item in View menu.
bool _grid_on
 Grid toggle view switch.
Q3PopupMenu * _help_menu
 This is used to represent the Help menu.
std::map< LAYER_TYPE, int > _layer_ids
 Edit layer items in Tile menu.
int _ll_id
 Lower layer item in View menu.
bool _ll_on
 Lower layer toggle view switch.
Q3PopupMenu * _map_menu
 This is used to represent the Tiles menu.
int _ml_id
 Middle layer item in View menu.
bool _ml_on
 Middle layer toggle view switch.
std::map< TILE_MODE_TYPE,
int > 
_mode_ids
 Mode items in Tile menu.
QStatusBar * _stat_bar
 This is used to display status messages.
Q3PopupMenu * _tiles_menu
 This is used to represent the Tiles menu.
int _ul_id
 Upper layer item in View menu.
bool _ul_on
 Upper layer toggle view switch.
Q3PopupMenu * _view_menu
 This is used to represent the View menu.

Friends

class EditorScrollView
 Needed for tile editing.

Detailed Description

Definition at line 69 of file editor.h.


Constructor & Destructor Documentation

Editor::Editor (  ) 

Macro needed to use Qt's slots and signals.

Definition at line 24 of file editor.cpp.

References _ed_layout, _ed_scrollview, _ed_tabs, _ed_widget, _file_menu, _FileMenuSetup(), _grid_id, _grid_on, _help_menu, _HelpAbout(), _HelpAboutQt(), _HelpHelp(), _layer_ids, _ll_id, _ll_on, _map_menu, _MapSelectMusic(), _ml_id, _ml_on, _mode_ids, _stat_bar, _TileEditLL(), _TileEditML(), _TileEditUL(), _TileLayerClear(), _TileLayerFill(), _TileModeDelete(), _TileModeMove(), _TileModePaint(), _tiles_menu, _ul_id, _ul_on, _view_menu, _ViewToggleGrid(), _ViewToggleLL(), _ViewToggleML(), _ViewToggleUL(), hoa_editor::DELETE_TILE, hoa_editor::LOWER_LAYER, hoa_editor::MIDDLE_LAYER, hoa_editor::MOVE_TILE, hoa_editor::PAINT_TILE, and hoa_editor::UPPER_LAYER.

Editor::~Editor (  ) 

Definition at line 100 of file editor.cpp.

References _ed_layout, _ed_scrollview, _ed_tabs, and _ed_widget.


Member Function Documentation

bool Editor::_EraseOK (  )  [private]

Saves the map if it is unsaved.

Definition at line 529 of file editor.cpp.

References _ed_scrollview, _FileSave(), hoa_editor::EditorScrollView::_map, _stat_bar, and hoa_editor::Grid::GetChanged().

Referenced by _FileNew(), _FileOpen(), and _FileQuit().

Here is the call graph for this function:

void Editor::_FileMenuSetup (  )  [private, slot]

This slot is used to gray out items in the File menu.

Definition at line 126 of file editor.cpp.

References _ed_scrollview, _file_menu, _FileNew(), _FileOpen(), _FileQuit(), _FileResize(), _FileSave(), _FileSaveAs(), hoa_editor::EditorScrollView::_map, and hoa_editor::Grid::GetChanged().

Referenced by Editor().

void Editor::_FileNew (  )  [private, slot]

Definition at line 152 of file editor.cpp.

References _ed_layout, _ed_scrollview, _ed_tabs, _ed_widget, _EraseOK(), _grid_on, _ll_on, hoa_editor::EditorScrollView::_map, _ml_on, _SetEditLayer(), _SetEditMode(), _stat_bar, _ul_on, _ViewToggleGrid(), _ViewToggleLL(), _ViewToggleML(), _ViewToggleUL(), EditorScrollView, hoa_editor::NewMapDialog::GetHeight(), hoa_editor::NewMapDialog::GetTilesetListView(), hoa_editor::NewMapDialog::GetWidth(), hoa_editor::LOWER_LAYER, hoa_editor::PAINT_TILE, hoa_editor::TILE_HEIGHT, hoa_editor::TILE_WIDTH, and hoa_editor::Grid::tilesets.

Referenced by _FileMenuSetup().

void Editor::_FileOpen (  )  [private, slot]

Definition at line 210 of file editor.cpp.

References _ed_layout, _ed_scrollview, _ed_tabs, _ed_widget, _EraseOK(), _grid_on, _ll_on, hoa_editor::EditorScrollView::_map, _ml_on, _SetEditLayer(), _SetEditMode(), _stat_bar, _ul_on, _ViewToggleGrid(), _ViewToggleLL(), _ViewToggleML(), _ViewToggleUL(), EditorScrollView, hoa_editor::Grid::GetFileName(), hoa_editor::Grid::GetHeight(), hoa_editor::Grid::GetWidth(), hoa_editor::Grid::LoadMap(), hoa_editor::LOWER_LAYER, hoa_editor::PAINT_TILE, hoa_editor::Grid::SetFileName(), hoa_editor::Grid::tileset_names, and hoa_editor::Grid::tilesets.

Referenced by _FileMenuSetup().

void Editor::_FileQuit (  )  [private, slot]

Definition at line 349 of file editor.cpp.

References _EraseOK().

Referenced by _FileMenuSetup(), and closeEvent().

void Editor::_FileResize (  )  [private, slot]

Definition at line 310 of file editor.cpp.

References _ed_layout, _ed_scrollview, _ed_tabs, _ed_widget, hoa_editor::EditorScrollView::_map, _stat_bar, hoa_editor::NewMapDialog::GetHeight(), hoa_editor::NewMapDialog::GetTilesetListView(), hoa_editor::NewMapDialog::GetWidth(), hoa_editor::Grid::SetHeight(), hoa_editor::Grid::SetWidth(), hoa_editor::TILE_HEIGHT, hoa_editor::TILE_WIDTH, hoa_editor::Grid::tileset_names, and hoa_editor::Grid::tilesets.

Referenced by _FileMenuSetup().

void Editor::_FileSave (  )  [private, slot]

Definition at line 295 of file editor.cpp.

References _ed_scrollview, _FileSaveAs(), hoa_editor::EditorScrollView::_map, _stat_bar, hoa_editor::Grid::GetFileName(), and hoa_editor::Grid::SaveMap().

Referenced by _EraseOK(), _FileMenuSetup(), and _FileSaveAs().

void Editor::_FileSaveAs (  )  [private, slot]

Definition at line 267 of file editor.cpp.

References _ed_scrollview, _FileSave(), hoa_editor::EditorScrollView::_map, _stat_bar, and hoa_editor::Grid::SetFileName().

Referenced by _FileMenuSetup(), and _FileSave().

void Editor::_HelpAbout (  )  [private, slot]

Definition at line 510 of file editor.cpp.

Referenced by Editor().

void Editor::_HelpAboutQt (  )  [private, slot]

Definition at line 520 of file editor.cpp.

Referenced by Editor().

void Editor::_HelpHelp (  )  [private, slot]

Definition at line 505 of file editor.cpp.

References _stat_bar.

Referenced by Editor().

void Editor::_MapSelectMusic (  )  [private, slot]

Definition at line 492 of file editor.cpp.

References _ed_scrollview, hoa_editor::EditorScrollView::_map, hoa_editor::Grid::GetMusic(), hoa_editor::MusicDialog::GetSelectedFile(), hoa_editor::Grid::SetChanged(), and hoa_editor::Grid::SetMusic().

Referenced by Editor().

void Editor::_SetEditLayer ( LAYER_TYPE  new_layer  )  [private]

Sets currently edited layer.

Definition at line 461 of file editor.cpp.

References _ed_scrollview, hoa_editor::EditorScrollView::_layer_edit, _layer_ids, and _tiles_menu.

Referenced by _FileNew(), _FileOpen(), _TileEditLL(), _TileEditML(), and _TileEditUL().

void Editor::_SetEditMode ( TILE_MODE_TYPE  new_mode  )  [private]

Sets current edit mode.

Definition at line 430 of file editor.cpp.

References _ed_scrollview, _mode_ids, hoa_editor::EditorScrollView::_tile_mode, and _tiles_menu.

Referenced by _FileNew(), _FileOpen(), _TileModeDelete(), _TileModeMove(), and _TileModePaint().

void Editor::_TileEditLL (  )  [private, slot]

Definition at line 474 of file editor.cpp.

References _ed_scrollview, _SetEditLayer(), and hoa_editor::LOWER_LAYER.

Referenced by Editor().

void Editor::_TileEditML (  )  [private, slot]

Definition at line 480 of file editor.cpp.

References _ed_scrollview, _SetEditLayer(), and hoa_editor::MIDDLE_LAYER.

Referenced by Editor().

void Editor::_TileEditUL (  )  [private, slot]

Definition at line 486 of file editor.cpp.

References _ed_scrollview, _SetEditLayer(), and hoa_editor::UPPER_LAYER.

Referenced by Editor().

void Editor::_TileLayerClear (  )  [private, slot]

Definition at line 419 of file editor.cpp.

References _ed_scrollview, hoa_editor::EditorScrollView::_map, and hoa_editor::EditorScrollView::GetCurrentLayer().

Referenced by Editor().

void Editor::_TileLayerFill (  )  [private, slot]

Definition at line 396 of file editor.cpp.

References _ed_scrollview, _ed_tabs, hoa_editor::EditorScrollView::_map, hoa_editor::EditorScrollView::GetCurrentLayer(), and hoa_editor::Grid::tileset_names.

Referenced by Editor().

void Editor::_TileModeDelete (  )  [private, slot]

Definition at line 455 of file editor.cpp.

References _ed_scrollview, _SetEditMode(), and hoa_editor::DELETE_TILE.

Referenced by Editor().

void Editor::_TileModeMove (  )  [private, slot]

Definition at line 449 of file editor.cpp.

References _ed_scrollview, _SetEditMode(), and hoa_editor::MOVE_TILE.

Referenced by Editor().

void Editor::_TileModePaint (  )  [private, slot]

Definition at line 443 of file editor.cpp.

References _ed_scrollview, _SetEditMode(), and hoa_editor::PAINT_TILE.

Referenced by Editor().

void Editor::_ViewToggleGrid (  )  [private, slot]

Definition at line 356 of file editor.cpp.

References _ed_scrollview, _grid_id, _grid_on, hoa_editor::EditorScrollView::_map, _view_menu, and hoa_editor::Grid::SetGridOn().

Referenced by _FileNew(), _FileOpen(), and Editor().

void Editor::_ViewToggleLL (  )  [private, slot]

Definition at line 366 of file editor.cpp.

References _ed_scrollview, _ll_id, _ll_on, hoa_editor::EditorScrollView::_map, _view_menu, and hoa_editor::Grid::SetLLOn().

Referenced by _FileNew(), _FileOpen(), and Editor().

void Editor::_ViewToggleML (  )  [private, slot]

Definition at line 376 of file editor.cpp.

References _ed_scrollview, hoa_editor::EditorScrollView::_map, _ml_id, _ml_on, _view_menu, and hoa_editor::Grid::SetMLOn().

Referenced by _FileNew(), _FileOpen(), and Editor().

void Editor::_ViewToggleUL (  )  [private, slot]

Definition at line 386 of file editor.cpp.

References _ed_scrollview, hoa_editor::EditorScrollView::_map, _ul_id, _ul_on, _view_menu, and hoa_editor::Grid::SetULOn().

Referenced by _FileNew(), _FileOpen(), and Editor().

void Editor::closeEvent ( QCloseEvent *   )  [protected]

Handles close and/or quit events.

Note:
Reimplemented from QMainWindow.
Parameters:
QCloseEvent* A pointer to a Qt close event.

Definition at line 117 of file editor.cpp.

References _FileQuit().


Friends And Related Function Documentation

friend class EditorScrollView [friend]

Needed for tile editing.

Definition at line 79 of file editor.h.

Referenced by _FileNew(), and _FileOpen().


Member Data Documentation

Q3BoxLayout* hoa_editor::Editor::_ed_layout [private]

Main window layout.

Definition at line 165 of file editor.h.

Referenced by _FileNew(), _FileOpen(), _FileResize(), Editor(), and ~Editor().

EditorScrollView* hoa_editor::Editor::_ed_scrollview [private]

Used to add scrollbars to the QGLWidget of the map.

Definition at line 163 of file editor.h.

Referenced by _EraseOK(), _FileMenuSetup(), _FileNew(), _FileOpen(), _FileResize(), _FileSave(), _FileSaveAs(), _MapSelectMusic(), _SetEditLayer(), _SetEditMode(), _TileEditLL(), _TileEditML(), _TileEditUL(), _TileLayerClear(), _TileLayerFill(), _TileModeDelete(), _TileModeMove(), _TileModePaint(), _ViewToggleGrid(), _ViewToggleLL(), _ViewToggleML(), _ViewToggleUL(), Editor(), and ~Editor().

QTabWidget* hoa_editor::Editor::_ed_tabs [private]

Tabbed widget of tilesets.

Definition at line 161 of file editor.h.

Referenced by _FileNew(), _FileOpen(), _FileResize(), _TileLayerFill(), Editor(), and ~Editor().

QWidget* hoa_editor::Editor::_ed_widget [private]

Needed for _ed_layout for it's children.

Definition at line 167 of file editor.h.

Referenced by _FileNew(), _FileOpen(), _FileResize(), Editor(), and ~Editor().

Q3PopupMenu* hoa_editor::Editor::_file_menu [private]

This is used to represent the File menu.

Definition at line 148 of file editor.h.

Referenced by _FileMenuSetup(), and Editor().

int hoa_editor::Editor::_grid_id [private]

Grid item in View menu.

Definition at line 170 of file editor.h.

Referenced by _ViewToggleGrid(), and Editor().

bool hoa_editor::Editor::_grid_on [private]

Grid toggle view switch.

Definition at line 178 of file editor.h.

Referenced by _FileNew(), _FileOpen(), _ViewToggleGrid(), and Editor().

Q3PopupMenu* hoa_editor::Editor::_help_menu [private]

This is used to represent the Help menu.

Definition at line 156 of file editor.h.

Referenced by Editor().

std::map<LAYER_TYPE, int> hoa_editor::Editor::_layer_ids [private]

Edit layer items in Tile menu.

Definition at line 187 of file editor.h.

Referenced by _SetEditLayer(), and Editor().

int hoa_editor::Editor::_ll_id [private]

Lower layer item in View menu.

Definition at line 172 of file editor.h.

Referenced by _ViewToggleLL(), and Editor().

bool hoa_editor::Editor::_ll_on [private]

Lower layer toggle view switch.

Definition at line 180 of file editor.h.

Referenced by _FileNew(), _FileOpen(), _ViewToggleLL(), and Editor().

Q3PopupMenu* hoa_editor::Editor::_map_menu [private]

This is used to represent the Tiles menu.

Definition at line 154 of file editor.h.

Referenced by Editor().

int hoa_editor::Editor::_ml_id [private]

Middle layer item in View menu.

Definition at line 174 of file editor.h.

Referenced by _ViewToggleML(), and Editor().

bool hoa_editor::Editor::_ml_on [private]

Middle layer toggle view switch.

Definition at line 182 of file editor.h.

Referenced by _FileNew(), _FileOpen(), _ViewToggleML(), and Editor().

std::map<TILE_MODE_TYPE, int> hoa_editor::Editor::_mode_ids [private]

Mode items in Tile menu.

Definition at line 189 of file editor.h.

Referenced by _SetEditMode(), and Editor().

QStatusBar* hoa_editor::Editor::_stat_bar [private]

This is used to display status messages.

Definition at line 159 of file editor.h.

Referenced by _EraseOK(), _FileNew(), _FileOpen(), _FileResize(), _FileSave(), _FileSaveAs(), _HelpHelp(), and Editor().

Q3PopupMenu* hoa_editor::Editor::_tiles_menu [private]

This is used to represent the Tiles menu.

Definition at line 152 of file editor.h.

Referenced by _SetEditLayer(), _SetEditMode(), and Editor().

int hoa_editor::Editor::_ul_id [private]

Upper layer item in View menu.

Definition at line 176 of file editor.h.

Referenced by _ViewToggleUL(), and Editor().

bool hoa_editor::Editor::_ul_on [private]

Upper layer toggle view switch.

Definition at line 184 of file editor.h.

Referenced by _FileNew(), _FileOpen(), _ViewToggleUL(), and Editor().

Q3PopupMenu* hoa_editor::Editor::_view_menu [private]

This is used to represent the View menu.

Definition at line 150 of file editor.h.

Referenced by _ViewToggleGrid(), _ViewToggleLL(), _ViewToggleML(), _ViewToggleUL(), and Editor().


The documentation for this class was generated from the following files:
Generated on Fri Jul 6 23:13:50 2007 for Hero of Allacrost by  doxygen 1.5.1