# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL-B license and that you accept its terms.
# ------------------------------------------------------------------------
-*/
+ */
#include "wxCDMMainFrame.h"
BEGIN_EVENT_TABLE(wxCDMMainFrame, wxFrame)
- EVT_MENU(ID_MENU_NEW_PROJECT, wxCDMMainFrame::OnMenuNewProject)
- EVT_MENU(ID_MENU_OPEN_PROJECT, wxCDMMainFrame::OnMenuOpenProject)
- EVT_MENU(ID_MENU_OPEN_RECENT, wxCDMMainFrame::OnMenuOpenRecent)
- EVT_MENU(ID_MENU_CLOSE_PROJECT, wxCDMMainFrame::OnMenuCloseProject)
- EVT_MENU(ID_MENU_CLOSE_ALL_PROJECTS, wxCDMMainFrame::OnMenuCloseAllProjects)
- EVT_MENU(ID_MENU_EXPORT_HIERARCHY, wxCDMMainFrame::OnMenuExportHierarchy)
- EVT_MENU(ID_MENU_EXIT, wxCDMMainFrame::OnMenuExit)
- EVT_MENU(ID_MENU_REFRESH_PROJECT, wxCDMMainFrame::OnMenuRefreshProject)
- EVT_MENU(ID_MENU_CUT, wxCDMMainFrame::OnMenuMenuCut)
- EVT_MENU(ID_MENU_COPY, wxCDMMainFrame::OnMenuMenuCopy)
- EVT_MENU(ID_MENU_PASTE, wxCDMMainFrame::OnMenuMenuPaste)
- EVT_MENU(ID_MENU_DELETE, wxCDMMainFrame::OnMenuMenuDelete)
- EVT_MENU(ID_MENU_SELECT_ALL, wxCDMMainFrame::OnMenuSelectAll)
- EVT_MENU(ID_MENU_SELECT_NONE, wxCDMMainFrame::OnMenuSelectNone)
- EVT_MENU(ID_MENU_EVENT_LOG, wxCDMMainFrame::OnMenuEventLog)
- EVT_MENU(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxCDMMainFrame::OnMenuBBTKGraphicalEditor)
- EVT_MENU(ID_MENU_MINITOOLS, wxCDMMainFrame::OnMenuMiniTools)
- EVT_MENU(ID_MENU_CODE_EDITOR, wxCDMMainFrame::OnMenuCodeEditor)
- EVT_MENU(ID_MENU_COMMAND_LINE, wxCDMMainFrame::OnMenuCommandLine)
- EVT_MENU(ID_MENU_HELP, wxCDMMainFrame::OnMenuHelp)
- EVT_MENU(ID_MENU_REPORT_BUG, wxCDMMainFrame::OnMenuReportBug)
- EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCDMMainFrame::OnMenuAboutCreaDevManager)
- EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
- EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCDMMainFrame::OnMenuNewProject)
- EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMMainFrame::OnMenuOpenProject)
+EVT_MENU(ID_MENU_NEW_PROJECT, wxCDMMainFrame::OnMenuNewProject)
+EVT_MENU(ID_MENU_OPEN_PROJECT, wxCDMMainFrame::OnMenuOpenProject)
+EVT_MENU(ID_MENU_OPEN_RECENT, wxCDMMainFrame::OnMenuOpenRecent)
+EVT_MENU(ID_MENU_CLOSE_PROJECT, wxCDMMainFrame::OnMenuCloseProject)
+EVT_MENU(ID_MENU_CLOSE_ALL_PROJECTS, wxCDMMainFrame::OnMenuCloseAllProjects)
+EVT_MENU(ID_MENU_EXPORT_HIERARCHY, wxCDMMainFrame::OnMenuExportHierarchy)
+EVT_MENU(ID_MENU_EXIT, wxCDMMainFrame::OnMenuExit)
+EVT_MENU(ID_MENU_REFRESH_PROJECT, wxCDMMainFrame::OnMenuRefreshProject)
+EVT_MENU(ID_MENU_CUT, wxCDMMainFrame::OnMenuMenuCut)
+EVT_MENU(ID_MENU_COPY, wxCDMMainFrame::OnMenuMenuCopy)
+EVT_MENU(ID_MENU_PASTE, wxCDMMainFrame::OnMenuMenuPaste)
+EVT_MENU(ID_MENU_DELETE, wxCDMMainFrame::OnMenuMenuDelete)
+EVT_MENU(ID_MENU_SELECT_ALL, wxCDMMainFrame::OnMenuSelectAll)
+EVT_MENU(ID_MENU_SELECT_NONE, wxCDMMainFrame::OnMenuSelectNone)
+EVT_MENU(ID_MENU_EVENT_LOG, wxCDMMainFrame::OnMenuEventLog)
+EVT_MENU(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxCDMMainFrame::OnMenuBBTKGraphicalEditor)
+EVT_MENU(ID_MENU_MINITOOLS, wxCDMMainFrame::OnMenuMiniTools)
+EVT_MENU(ID_MENU_CODE_EDITOR, wxCDMMainFrame::OnMenuCodeEditor)
+EVT_MENU(ID_MENU_COMMAND_LINE, wxCDMMainFrame::OnMenuCommandLine)
+EVT_MENU(ID_MENU_HELP, wxCDMMainFrame::OnMenuHelp)
+EVT_MENU(ID_MENU_REPORT_BUG, wxCDMMainFrame::OnMenuReportBug)
+EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCDMMainFrame::OnMenuAboutCreaDevManager)
+EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
+EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCDMMainFrame::OnMenuNewProject)
+EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMMainFrame::OnMenuOpenProject)
END_EVENT_TABLE()
wxCDMMainFrame::wxCDMMainFrame(
- wxWindow* parent,
- wxWindowID id,
- const wxString& caption,
- const wxPoint& pos,
- const wxSize& size,
- long style
+ wxWindow* parent,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style
)
{
Create(parent, id, caption, pos, size, style);
}
bool wxCDMMainFrame::Create(
- wxWindow* parent,
- wxWindowID id,
- const wxString& caption,
- const wxPoint& pos,
- const wxSize& size,
- long style
+ wxWindow* parent,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style
)
{
wxFrame::Create(parent, id, caption, pos, size, style);
tree_Projects = new wxCDMProjectsTreeCtrl(
- this,
- ID_TREE_PROJECTS,
- wxDefaultPosition,
- wxSize(300,400),
- wxTR_HAS_BUTTONS | wxTR_AQUA_BUTTONS
+ this,
+ ID_TREE_PROJECTS,
+ wxDefaultPosition,
+ wxSize(300,400),
+ wxTR_HAS_BUTTONS | wxTR_AQUA_BUTTONS
);
tree_Projects->SetMinSize(wxSize(200,200));
panel_Properties = new wxCDMMainDescriptionPanel(
- this,
- ID_WINDOW_PROPERTIES,
- wxT("Description Panel"),
- wxDefaultPosition,
- wxSize(300, 400),
- 0
+ this,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(300, 400),
+ 0
);
panel_ProjectActions = new wxCDMProjectActionsPanel(
- this,
- ID_WINDOW_PROJ_ACTIONS,
- wxT("Project Actions Panel"),
- wxDefaultPosition,
- wxSize(600,200),
- 0
+ this,
+ ID_WINDOW_PROJ_ACTIONS,
+ wxT("Project Actions Panel"),
+ wxDefaultPosition,
+ wxSize(600,200),
+ 0
);
panel_ProjectActions->SetMinSize(wxSize(500, 100));
userResponse = dialog->ShowModal();
if(userResponse == wxID_FORWARD)
- {
- //TODO createProject
- std::cerr << "should create Project here" << std::endl;
- //tree_Projects->BuildTree(this->model->GetActiveProjects());
- }
+ {
+ std::string* result;
+ if(!this->model->CreateProject(
+ crea::wx2std(dialog->GetProjectName()),
+ crea::wx2std(dialog->GetProjectLocation()),
+ result,
+ crea::wx2std(dialog->GetPackageAuthor()),
+ crea::wx2std(dialog->GetPackageDescription())
+ ))
+ {
+ wxMessageBox(crea::std2wx(*result),_T("New Project - Error!"),wxOK | wxICON_ERROR);
+ }
+ wxMessageBox(_T("New Project created!"),_T("New Project - Success!"), wxOK | wxICON_INFORMATION);
+
+ //TODO: populate model
+ //TODO: populate tree control
+
+ //tree_Projects->BuildTree(this->model->GetActiveProjects());
+ auiManager.Update();
+ }
event.Skip();
}
long userResponse;
userResponse = FD->ShowModal();
if(userResponse == wxID_OK)
- {
- std::cout << "selection: " << crea::wx2std (FD->GetPath()) << std::endl;
- std::string path = CDMUtilities::fixPath(crea::wx2std (FD->GetPath()));
- std::cout << "fixed selection: " << path << std::endl;
- std::string* result;
- if (!this->model->OpenProject(path, result))
{
- wxMessageBox( crea::std2wx(result->c_str()), wxT("Open Project - Error"), wxICON_ERROR);
- event.Skip();
- };
- //TODO: Create tree control
- //((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(controller->GetActiveProjects());
-
- auiManager.Update();
- }
+ std::cout << "Selection to open: " << crea::wx2std (FD->GetPath()) << std::endl;
+ std::string path = crea::wx2std (FD->GetPath());
+
+ std::string* result;
+ if (!this->model->OpenProject(path, result))
+ {
+ wxMessageBox( crea::std2wx(result->c_str()), wxT("Open Project - Error"), wxICON_ERROR);
+ event.Skip();
+ };
+
+ //TODO: populate model
+ //TODO: populate tree control
+
+ //((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(controller->GetActiveProjects());
+ auiManager.Update();
+ }
event.Skip();
}