2 #include "wxCDMMainFrame.h"
4 #include "creaDevManagerIds.h"
5 #include "wxCDMMainDescriptionPanel.h"
6 #include "wxCDMProjectActionsPanel.h"
7 #include "wxCDMNewProjectDialog.h"
14 BEGIN_EVENT_TABLE(wxCDMMainFrame, wxFrame)
15 EVT_MENU(ID_MENU_NEW_PROJECT, wxCDMMainFrame::OnMenuNewProject)
16 EVT_MENU(ID_MENU_OPEN_PROJECT, wxCDMMainFrame::OnMenuOpenProject)
17 EVT_MENU(ID_MENU_OPEN_RECENT, wxCDMMainFrame::OnMenuOpenRecent)
18 EVT_MENU(ID_MENU_CLOSE_PROJECT, wxCDMMainFrame::OnMenuCloseProject)
19 EVT_MENU(ID_MENU_CLOSE_ALL_PROJECTS, wxCDMMainFrame::OnMenuCloseAllProjects)
20 EVT_MENU(ID_MENU_EXPORT_HIERARCHY, wxCDMMainFrame::OnMenuExportHierarchy)
21 EVT_MENU(ID_MENU_EXIT, wxCDMMainFrame::OnMenuExit)
22 EVT_MENU(ID_MENU_REFRESH_PROJECT, wxCDMMainFrame::OnMenuRefreshProject)
23 EVT_MENU(ID_MENU_CUT, wxCDMMainFrame::OnMenuMenuCut)
24 EVT_MENU(ID_MENU_COPY, wxCDMMainFrame::OnMenuMenuCopy)
25 EVT_MENU(ID_MENU_PASTE, wxCDMMainFrame::OnMenuMenuPaste)
26 EVT_MENU(ID_MENU_DELETE, wxCDMMainFrame::OnMenuMenuDelete)
27 EVT_MENU(ID_MENU_SELECT_ALL, wxCDMMainFrame::OnMenuSelectAll)
28 EVT_MENU(ID_MENU_SELECT_NONE, wxCDMMainFrame::OnMenuSelectNone)
29 EVT_MENU(ID_MENU_EVENT_LOG, wxCDMMainFrame::OnMenuEventLog)
30 EVT_MENU(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxCDMMainFrame::OnMenuBBTKGraphicalEditor)
31 EVT_MENU(ID_MENU_MINITOOLS, wxCDMMainFrame::OnMenuMiniTools)
32 EVT_MENU(ID_MENU_CODE_EDITOR, wxCDMMainFrame::OnMenuCodeEditor)
33 EVT_MENU(ID_MENU_COMMAND_LINE, wxCDMMainFrame::OnMenuCommandLine)
34 EVT_MENU(ID_MENU_HELP, wxCDMMainFrame::OnMenuHelp)
35 EVT_MENU(ID_MENU_REPORT_BUG, wxCDMMainFrame::OnMenuReportBug)
36 EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCDMMainFrame::OnMenuAboutCreaDevManager)
37 EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
38 EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCDMMainFrame::OnMenuNewProject)
39 EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMMainFrame::OnMenuOpenProject)
42 wxCDMMainFrame::wxCDMMainFrame(
45 const wxString& caption,
51 Create(parent, id, caption, pos, size, style);
54 wxCDMMainFrame::~wxCDMMainFrame()
59 bool wxCDMMainFrame::Create(
62 const wxString& caption,
68 wxFrame::Create(parent, id, caption, pos, size, style);
69 this->model = new modelCDMMain();
75 void wxCDMMainFrame::CreateMenus()
77 wxMenuBar* menuBar = new wxMenuBar;
80 menu_File = new wxMenu();
81 menu_File->Append(ID_MENU_NEW_PROJECT, wxString("&New Project..."));
82 menu_File->Append(ID_MENU_OPEN_PROJECT, wxString("&Open Project..."));
83 menu_File->Append(ID_MENU_OPEN_RECENT, wxString("Open &Recent"));
84 menu_File->AppendSeparator();
85 menu_File->Append(ID_MENU_CLOSE_PROJECT, wxString("&Close Project"));
86 menu_File->Append(ID_MENU_CLOSE_ALL_PROJECTS, wxString("C&lose All Projects"));
87 menu_File->AppendSeparator();
88 menu_File->Append(ID_MENU_EXPORT_HIERARCHY, wxString("&Export Project Hierarchy..."));
89 menu_File->AppendSeparator();
90 menu_File->Append(ID_MENU_EXIT, wxString("E&xit"));
92 menuBar->Append(menu_File, wxString("&File"));
95 menu_Edit = new wxMenu();
96 menu_Edit->Append(ID_MENU_REFRESH_PROJECT, wxString("&Refresh Project"));
97 menu_Edit->AppendSeparator();
98 menu_Edit->Append(ID_MENU_CUT, wxString("Cu&t"));
99 menu_Edit->Append(ID_MENU_COPY, wxString("&Copy"));
100 menu_Edit->Append(ID_MENU_PASTE, wxString("&Paste"));
101 menu_Edit->AppendSeparator();
102 menu_Edit->Append(ID_MENU_DELETE, wxString("&Delete"));
103 menu_Edit->Append(ID_MENU_SELECT_ALL, wxString("Select &All"));
104 menu_Edit->Append(ID_MENU_SELECT_NONE, wxString("Ca&ncel Selection"));
106 menuBar->Append(menu_Edit, wxString("&Edit"));
109 menu_Tools = new wxMenu();
110 menu_Tools->Append(ID_MENU_EVENT_LOG, wxString("Event &Log"));
111 menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxString("BBTK &Graphical Editor"));
112 menu_Tools->Append(ID_MENU_MINITOOLS, wxString("&MiniTools"));
113 menu_Tools->Append(ID_MENU_CODE_EDITOR, wxString("&Code Editor"));
114 menu_Tools->Append(ID_MENU_COMMAND_LINE, wxString("&Command Line"));
116 menuBar->Append(menu_Tools, wxString("&Tools"));
119 menu_Help = new wxMenu();
120 menu_Help->Append(ID_MENU_HELP, wxString("&Help"));
121 menu_Help->Append(ID_MENU_REPORT_BUG, wxString("Report &Bug"));
122 menu_Help->Append(ID_MENU_ABOUT_CREADEVMANAGER, wxString("&About CreaDevManager"));
123 menu_Help->Append(ID_MENU_ABOUT_CREATIS, wxString("A&bout CREATIS"));
125 menuBar->Append(menu_Help, wxString("&Help"));
130 wxStatusBar* statusBar = new wxStatusBar(this, ID_STATUS_BAR, wxST_SIZEGRIP);
131 statusBar->SetFieldsCount(1);
132 SetStatusBar(statusBar);
136 void wxCDMMainFrame::CreateControls()
139 auiManager.SetManagedWindow(this);
142 tree_Projects = new wxCDMProjectsTreeCtrl(
147 wxTR_HAS_BUTTONS | wxTR_AQUA_BUTTONS
149 tree_Projects->SetMinSize(wxSize(200,200));
151 panel_Properties = new wxCDMMainDescriptionPanel(
153 ID_WINDOW_PROPERTIES,
154 wxString("Description Panel"),
162 panel_ProjectActions = new wxCDMProjectActionsPanel(
164 ID_WINDOW_PROJ_ACTIONS,
165 wxString("Project Actions Panel"),
170 panel_ProjectActions->SetMinSize(wxSize(500, 100));
172 auiManager.AddPane(tree_Projects, wxLEFT, wxString("Projects Tree"));
173 auiManager.AddPane(panel_ProjectActions, wxBOTTOM, wxString("Project Actions"));
174 auiManager.AddPane(panel_Properties, wxCENTER, wxString("Properties"));
177 auiManager.GetPane(tree_Projects).CloseButton(false).MaximizeButton(true);
178 auiManager.GetPane(panel_Properties).CloseButton(false);
183 void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event)
185 wxCDMNewProjectDialog* dialog = new wxCDMNewProjectDialog(this);
187 userResponse = dialog->ShowModal();
189 if(userResponse == wxID_FORWARD)
192 std::cerr << "should create Project here" << std::endl;
193 //tree_Projects->BuildTree(this->model->GetActiveProjects());
198 void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event)
201 long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
202 wxDirDialog* FD = new wxDirDialog(this, wxString("Select the project directory"), wxString(""), style);
204 userResponse = FD->ShowModal();
205 if(userResponse == wxID_OK)
207 switch(this->controller->OpenProject(crea::wx2std (FD->GetPath())))
210 wxMessageBox( wxT("No project selected."), wxT("Open Project - Error"), wxICON_ERROR);
214 wxMessageBox( wxString("Sources not found."), wxString("Open Project - Error"), wxICON_ERROR);
221 ((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(controller->GetActiveProjects());
228 void wxCDMMainFrame::OnMenuOpenRecent(wxCommandEvent& event)
230 std::cerr << "Event OnMenuOpenRecent not implemented" << std::endl;
233 void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event)
235 std::cerr << "Event OnMenuCloseProject not implemented" << std::endl;
238 void wxCDMMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event)
240 std::cerr << "Event OnMenuCloseAllProjects not implemented" << std::endl;
243 void wxCDMMainFrame::OnMenuExportHierarchy(wxCommandEvent& event)
245 std::cerr << "Event OnMenuExportHierarchy not implemented" << std::endl;
248 void wxCDMMainFrame::OnMenuExit(wxCommandEvent& event)
250 std::cout << "Closing CreaDevManager..." << std::endl;
256 void wxCDMMainFrame::OnMenuRefreshProject(wxCommandEvent& event)
258 std::cerr << "Event OnMenuRefreshProject not implemented" << std::endl;
261 void wxCDMMainFrame::OnMenuMenuCut(wxCommandEvent& event)
263 std::cerr << "Event OnMenuMenuCut not implemented" << std::endl;
266 void wxCDMMainFrame::OnMenuMenuCopy(wxCommandEvent& event)
268 std::cerr << "Event OnMenuMenuCopy not implemented" << std::endl;
271 void wxCDMMainFrame::OnMenuMenuPaste(wxCommandEvent& event)
273 std::cerr << "Event OnMenuMenuPaste not implemented" << std::endl;
276 void wxCDMMainFrame::OnMenuMenuDelete(wxCommandEvent& event)
278 std::cerr << "Event OnMenuMenuDelete not implemented" << std::endl;
281 void wxCDMMainFrame::OnMenuSelectAll(wxCommandEvent& event)
283 std::cerr << "Event OnMenuSelectAll not implemented" << std::endl;
286 void wxCDMMainFrame::OnMenuSelectNone(wxCommandEvent& event)
288 std::cerr << "Event OnMenuSelectNone not implemented" << std::endl;
293 void wxCDMMainFrame::OnMenuEventLog(wxCommandEvent& event)
295 std::cerr << "Event OnMenuEventLog not implemented" << std::endl;
298 void wxCDMMainFrame::OnMenuBBTKGraphicalEditor(wxCommandEvent& event)
300 std::cerr << "Event OnMenuBBTKGraphicalEditor not implemented" << std::endl;
303 void wxCDMMainFrame::OnMenuMiniTools(wxCommandEvent& event)
305 std::cerr << "Event OnMenuMiniTools not implemented" << std::endl;
308 void wxCDMMainFrame::OnMenuCodeEditor(wxCommandEvent& event)
310 std::cerr << "Event OnMenuCodeEditor not implemented" << std::endl;
313 void wxCDMMainFrame::OnMenuCommandLine(wxCommandEvent& event)
315 std::cerr << "Event OnMenuCommandLine not implemented" << std::endl;
320 void wxCDMMainFrame::OnMenuHelp(wxCommandEvent& event)
322 std::cerr << "Event OnMenuHelp not implemented" << std::endl;
325 void wxCDMMainFrame::OnMenuReportBug(wxCommandEvent& event)
327 std::cerr << "Event OnMenuReportBug not implemented" << std::endl;
330 void wxCDMMainFrame::OnMenuAboutCreaDevManager(wxCommandEvent& event)
332 std::cerr << "Event OnMenuAboutCreaDevManager not implemented" << std::endl;
335 void wxCDMMainFrame::OnMenuAboutCreatis(wxCommandEvent& event)
337 std::cerr << "Event OnMenuAboutCreatis not implemented" << std::endl;