diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/mapedit/src/frame.cpp | 13 | ||||
-rw-r--r-- | tools/mapedit/src/frame.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tools/mapedit/src/frame.cpp b/tools/mapedit/src/frame.cpp index 500f2c4..934e0f8 100644 --- a/tools/mapedit/src/frame.cpp +++ b/tools/mapedit/src/frame.cpp | |||
@@ -52,6 +52,7 @@ wxBEGIN_EVENT_TABLE(MapeditFrame, wxFrame) | |||
52 | EVT_TREE_SEL_CHANGED(MAP_EDITOR_TREE, MapeditFrame::OnDidSelectMap) | 52 | EVT_TREE_SEL_CHANGED(MAP_EDITOR_TREE, MapeditFrame::OnDidSelectMap) |
53 | EVT_TREE_BEGIN_DRAG(MAP_EDITOR_TREE, MapeditFrame::OnWillDragMap) | 53 | EVT_TREE_BEGIN_DRAG(MAP_EDITOR_TREE, MapeditFrame::OnWillDragMap) |
54 | EVT_TREE_END_DRAG(MAP_EDITOR_TREE, MapeditFrame::OnDidDragMap) | 54 | EVT_TREE_END_DRAG(MAP_EDITOR_TREE, MapeditFrame::OnDidDragMap) |
55 | EVT_TREE_ITEM_RIGHT_CLICK(MAP_EDITOR_TREE, MapeditFrame::OnRightClickTree) | ||
55 | EVT_TEXT(MAP_TITLE_TEXTBOX, MapeditFrame::OnTitleChange) | 56 | EVT_TEXT(MAP_TITLE_TEXTBOX, MapeditFrame::OnTitleChange) |
56 | EVT_BUTTON(ADD_ENTITY_BUTTON, MapeditFrame::OnAddEntity) | 57 | EVT_BUTTON(ADD_ENTITY_BUTTON, MapeditFrame::OnAddEntity) |
57 | EVT_BUTTON(CANCEL_ENTITY_BUTTON, MapeditFrame::OnCancelAddEntity) | 58 | EVT_BUTTON(CANCEL_ENTITY_BUTTON, MapeditFrame::OnCancelAddEntity) |
@@ -84,6 +85,10 @@ MapeditFrame::MapeditFrame(std::unique_ptr<World> world) : wxFrame(NULL, wxID_AN | |||
84 | 85 | ||
85 | SetMenuBar(menuBar); | 86 | SetMenuBar(menuBar); |
86 | 87 | ||
88 | mapTreePopup = new wxMenu; | ||
89 | mapTreePopup->Append(MENU_MAP_ADD_ROOT, "Add Sibling Map"); | ||
90 | mapTreePopup->Append(MENU_MAP_ADD_CHILD, "Add Child Map"); | ||
91 | |||
87 | // Layout 1: Splitter between map tree and layout 2 | 92 | // Layout 1: Splitter between map tree and layout 2 |
88 | // Layout 2: Non-splitter between layout 3 and notebook | 93 | // Layout 2: Non-splitter between layout 3 and notebook |
89 | // Layout 3: Splitter between map editor and properties editor | 94 | // Layout 3: Splitter between map editor and properties editor |
@@ -411,6 +416,14 @@ void MapeditFrame::OnDidDragMap(wxTreeEvent& event) | |||
411 | mapTree->SelectItem(newChild); | 416 | mapTree->SelectItem(newChild); |
412 | } | 417 | } |
413 | 418 | ||
419 | void MapeditFrame::OnRightClickTree(wxTreeEvent& event) | ||
420 | { | ||
421 | if (event.GetItem().IsOk()) | ||
422 | { | ||
423 | PopupMenu(mapTreePopup); | ||
424 | } | ||
425 | } | ||
426 | |||
414 | void MapeditFrame::NewWorld() | 427 | void MapeditFrame::NewWorld() |
415 | { | 428 | { |
416 | LaunchWindow(std::unique_ptr<World>(new World())); | 429 | LaunchWindow(std::unique_ptr<World>(new World())); |
diff --git a/tools/mapedit/src/frame.h b/tools/mapedit/src/frame.h index f1e4efc..4844485 100644 --- a/tools/mapedit/src/frame.h +++ b/tools/mapedit/src/frame.h | |||
@@ -62,6 +62,7 @@ class MapeditFrame : public wxFrame { | |||
62 | void OnWillSelectMap(wxTreeEvent& event); | 62 | void OnWillSelectMap(wxTreeEvent& event); |
63 | void OnWillDragMap(wxTreeEvent& event); | 63 | void OnWillDragMap(wxTreeEvent& event); |
64 | void OnDidDragMap(wxTreeEvent& event); | 64 | void OnDidDragMap(wxTreeEvent& event); |
65 | void OnRightClickTree(wxTreeEvent& event); | ||
65 | 66 | ||
66 | std::unique_ptr<World> world; | 67 | std::unique_ptr<World> world; |
67 | Map* currentMap; | 68 | Map* currentMap; |
@@ -77,6 +78,7 @@ class MapeditFrame : public wxFrame { | |||
77 | wxMenu* menuFile; | 78 | wxMenu* menuFile; |
78 | wxTreeCtrl* mapTree; | 79 | wxTreeCtrl* mapTree; |
79 | wxTreeItemId dragMap; | 80 | wxTreeItemId dragMap; |
81 | wxMenu* mapTreePopup; | ||
80 | 82 | ||
81 | bool addingEntity = false; | 83 | bool addingEntity = false; |
82 | 84 | ||