From: Daniel Gonzalez Date: Fri, 19 Oct 2012 16:09:33 +0000 (+0000) Subject: Feature #1711 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c4d34cfa615698793bfb91de6f2835bbc167c67f;p=crea.git Feature #1711 CreaDevManager application implementation: Tree and windows added with AUI --- diff --git a/.cvsignore b/.cvsignore index 86b18f5..ea72388 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,3 @@ .cproject .project +.settings diff --git a/appli/creaDevManager/creaDevManager.cpp b/appli/creaDevManager/creaDevManager.cpp index b5c1a65..fe46557 100644 --- a/appli/creaDevManager/creaDevManager.cpp +++ b/appli/creaDevManager/creaDevManager.cpp @@ -16,10 +16,17 @@ bool wxCreaDevManagerApp::OnInit() wxApp::OnInit(); wxCreaDevManagerMainFrame* mainWindow = new wxCreaDevManagerMainFrame(NULL); + SetTopWindow(mainWindow); mainWindow->SetSize(800, 600); mainWindow->Show(true); - cout << "listo"; + cout << "Crea DevManager opened." << endl; return true; } + +int wxCreaDevManagerApp::OnExit() +{ + wxApp::OnExit(); + cout << "Crea DevManager closed." << endl; +} diff --git a/appli/creaDevManager/creaDevManager.h b/appli/creaDevManager/creaDevManager.h index 7e76ae8..3380eba 100644 --- a/appli/creaDevManager/creaDevManager.h +++ b/appli/creaDevManager/creaDevManager.h @@ -14,6 +14,7 @@ class wxCreaDevManagerApp:public wxApp wxCreaDevManagerApp(); virtual bool OnInit(); + virtual int OnExit(); }; DECLARE_APP(wxCreaDevManagerApp) diff --git a/lib/creaDevManagerLib/creaDevManagerIds.h b/lib/creaDevManagerLib/creaDevManagerIds.h new file mode 100644 index 0000000..aaec5ef --- /dev/null +++ b/lib/creaDevManagerLib/creaDevManagerIds.h @@ -0,0 +1,42 @@ +/* + * creaDevManagerIds.h + * + * Created on: 19/10/2012 + * Author: Daniel Gonzalez + */ + +#ifndef CREADEVMANAGERIDS_H_ +#define CREADEVMANAGERIDS_H_ + +#define ID_MENU_NEW_PROJECT 10201 +#define ID_MENU_OPEN_PROJECT 10202 +#define ID_MENU_OPEN_RECENT 10203 +#define ID_MENU_CLOSE_PROJECT 10204 +#define ID_MENU_CLOSE_ALL_PROJECTS 10205 +#define ID_MENU_EXPORT_HIERARCHY 10206 +#define ID_MENU_EXIT 10207 + +#define ID_MENU_REFRESH_PROJECT 10208 +#define ID_MENU_CUT 10209 +#define ID_MENU_COPY 10210 +#define ID_MENU_PASTE 10211 +#define ID_MENU_DELETE 10212 +#define ID_MENU_SELECT_ALL 10213 +#define ID_MENU_SELECT_NONE 10214 + +#define ID_MENU_EVENT_LOG 10215 +#define ID_MENU_BBTK_GRAPHICAL_EDITOR 10216 +#define ID_MENU_MINITOOLS 10217 +#define ID_MENU_CODE_EDITOR 10218 +#define ID_MENU_COMMAND_LINE 10219 + +#define ID_MENU_HELP 10220 +#define ID_MENU_REPORT_BUG 10221 +#define ID_MENU_ABOUT_CREADEVMANAGER 10222 +#define ID_MENU_ABOUT_CREATIS 10223 + +#define ID_TREE_PROJECTS 10224 +#define ID_WINDOW_PROPERTIES 10225 +#define ID_WINDOW_PROJ_ACTIONS 10226 + +#endif /* CREADEVMANAGERIDS_H_ */ diff --git a/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx b/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx index a26bc70..ce83e93 100644 --- a/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx +++ b/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx @@ -1,5 +1,6 @@ -#include #include "wxCreaDevManagerMainFrame.h" +#include "creaDevManagerIds.h" +#include "wxCreaDevManagerTreeCtrl.h" wxCreaDevManagerMainFrame::wxCreaDevManagerMainFrame( wxWindow* parent, @@ -15,18 +16,114 @@ wxCreaDevManagerMainFrame::wxCreaDevManagerMainFrame( wxCreaDevManagerMainFrame::~wxCreaDevManagerMainFrame() { + auiManager.UnInit(); } bool wxCreaDevManagerMainFrame::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); - return true; + wxFrame::Create(parent, id, caption, pos, size, style); + CreateMenus(); + CreateControls(); + return TRUE; +} + +void wxCreaDevManagerMainFrame::CreateMenus() +{ + wxMenuBar* menuBar = new wxMenuBar; + + //FileMenu + menu_File = new wxMenu(); + menu_File->Append(ID_MENU_NEW_PROJECT, _("&New Project...")); + menu_File->Append(ID_MENU_OPEN_PROJECT, _("&Open Project...")); + menu_File->Append(ID_MENU_OPEN_RECENT, _("Open &Recent")); + menu_File->AppendSeparator(); + menu_File->Append(ID_MENU_CLOSE_PROJECT, _("&Close Project")); + menu_File->Append(ID_MENU_CLOSE_ALL_PROJECTS, _("C&lose All Projects")); + menu_File->AppendSeparator(); + menu_File->Append(ID_MENU_EXPORT_HIERARCHY, _("&Export Project Hierarchy...")); + menu_File->AppendSeparator(); + menu_File->Append(ID_MENU_EXIT, _("E&xit")); + + menuBar->Append(menu_File, _("&File")); + + //EditMenu + menu_Edit = new wxMenu(); + menu_Edit->Append(ID_MENU_REFRESH_PROJECT, _("&Refresh Project")); + menu_Edit->AppendSeparator(); + menu_Edit->Append(ID_MENU_CUT, _("Cu&t")); + menu_Edit->Append(ID_MENU_COPY, _("&Copy")); + menu_Edit->Append(ID_MENU_PASTE, _("&Paste")); + menu_Edit->AppendSeparator(); + menu_Edit->Append(ID_MENU_DELETE, _("&Delete")); + menu_Edit->Append(ID_MENU_SELECT_ALL, _("Select &All")); + menu_Edit->Append(ID_MENU_SELECT_NONE, _("Ca&ncel Selection")); + + menuBar->Append(menu_Edit, _("&Edit")); + + //ToolsMenu + menu_Tools = new wxMenu(); + menu_Tools->Append(ID_MENU_EVENT_LOG, _("Event &Log")); + menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, _("BBTK &Graphical Editor")); + menu_Tools->Append(ID_MENU_MINITOOLS, _("&MiniTools")); + menu_Tools->Append(ID_MENU_CODE_EDITOR, _("&Code Editor")); + menu_Tools->Append(ID_MENU_COMMAND_LINE, _("&Command Line")); + + menuBar->Append(menu_Tools, _("&Tools")); + + //HelpMenu + menu_Help = new wxMenu(); + menu_Help->Append(ID_MENU_HELP, _("&Help")); + menu_Help->Append(ID_MENU_REPORT_BUG, _("Report &Bug")); + menu_Help->Append(ID_MENU_ABOUT_CREADEVMANAGER, _("&About CreaDevManager")); + menu_Help->Append(ID_MENU_ABOUT_CREATIS, _("A&bout CREATIS")); + + menuBar->Append(menu_Help, _("&Help")); + + //Set Bar + SetMenuBar(menuBar); } +void wxCreaDevManagerMainFrame::CreateControls() +{ + auiManager.SetManagedWindow(this); + + tree_Projects = new wxCreaDevManagerTreeCtrl( + this, + ID_TREE_PROJECTS, + wxDefaultPosition, + wxDefaultSize, + wxTR_HAS_BUTTONS | wxTR_ROW_LINES | wxTR_SINGLE + ); + tree_Projects->SetSize(400,100); + tree_Projects->SetMinSize(wxSize(300,100)); + + window_Properties = new wxWindow( + this, + ID_WINDOW_PROPERTIES + ); + + + window_ProjectActions = new wxWindow( + this, + ID_WINDOW_PROJ_ACTIONS + ); + window_ProjectActions->SetSize(300,200); + window_ProjectActions->SetMinSize(wxSize(300,100)); + + auiManager.AddPane(tree_Projects, wxLEFT, wxT("Projects Tree")); + auiManager.AddPane(window_ProjectActions, wxBOTTOM, wxT("Project Actions")); + auiManager.AddPane(window_Properties, wxCENTER, wxT("Properties")); + + auiManager.GetPane(tree_Projects).BestSize(500,500); + auiManager.GetPane(window_Properties).BestSize(400,200); + + + auiManager.Update(); +} diff --git a/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.h b/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.h index f818364..844632a 100644 --- a/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.h +++ b/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.h @@ -1,6 +1,10 @@ #ifndef WXCREADEVMANAGERMAINFRAME_H_INCLUDED #define WXCREADEVMANAGERMAINFRAME_H_INCLUDED +#include +#include +#include + class wxCreaDevManagerMainFrame:public wxFrame { public: @@ -23,6 +27,25 @@ class wxCreaDevManagerMainFrame:public wxFrame const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE ); + + protected: + void CreateMenus(); + void CreateControls(); + + private: + + //Menus + wxMenu* menu_File; + wxMenu* menu_Edit; + wxMenu* menu_Tools; + wxMenu* menu_Help; + + //Controls + wxAuiManager auiManager; + wxTreeCtrl* tree_Projects; + wxWindow* window_Properties; + wxWindow* window_ProjectActions; + }; #endif diff --git a/lib/creaDevManagerLib/wxCreaDevManagerTreeCtrl.cxx b/lib/creaDevManagerLib/wxCreaDevManagerTreeCtrl.cxx new file mode 100644 index 0000000..b4af43e --- /dev/null +++ b/lib/creaDevManagerLib/wxCreaDevManagerTreeCtrl.cxx @@ -0,0 +1,41 @@ +/* + * wxCreaDevManagerTreeCtrl.cpp + * + * Created on: 19/10/2012 + * Author: daniel + */ + +#include "wxCreaDevManagerTreeCtrl.h" +#include "creaDevManagerIds.h" + +wxCreaDevManagerTreeCtrl::wxCreaDevManagerTreeCtrl( + wxWindow *parent, + wxWindowID id, + const wxPoint &pos, + const wxSize &size, + long style, + const wxValidator &validator, + const wxString &name +) +{ + Create(parent, id, pos, size, style, validator, name); +} + +wxCreaDevManagerTreeCtrl::~wxCreaDevManagerTreeCtrl() +{ +} + +bool wxCreaDevManagerTreeCtrl::Create( + wxWindow* parent, + wxWindowID id, + const wxPoint &pos, + const wxSize &size, + long style, + const wxValidator &validator, + const wxString &name +) +{ + wxTreeCtrl::Create (parent, id, pos, size, style, validator, name); + return TRUE; +} + diff --git a/lib/creaDevManagerLib/wxCreaDevManagerTreeCtrl.h b/lib/creaDevManagerLib/wxCreaDevManagerTreeCtrl.h new file mode 100644 index 0000000..3491352 --- /dev/null +++ b/lib/creaDevManagerLib/wxCreaDevManagerTreeCtrl.h @@ -0,0 +1,39 @@ +/* + * wxCreaDevManagerTreeCtrl.h + * + * Created on: 19/10/2012 + * Author: daniel + */ + +#ifndef WXCREADEVMANAGERTREECTRL_H_ +#define WXCREADEVMANAGERTREECTRL_H_ + +#include +#include + + +class wxCreaDevManagerTreeCtrl: public wxTreeCtrl +{ +public: + wxCreaDevManagerTreeCtrl( + wxWindow *parent, + wxWindowID id=wxID_ANY, + const wxPoint &pos=wxDefaultPosition, + const wxSize &size=wxDefaultSize, + long style=wxTR_DEFAULT_STYLE, + const wxValidator &validator=wxDefaultValidator, + const wxString &name=_("Projects tree") + ); + ~wxCreaDevManagerTreeCtrl(); + bool Create( + wxWindow *parent, + wxWindowID id=wxID_ANY, + const wxPoint &pos=wxDefaultPosition, + const wxSize &size=wxDefaultSize, + long style=wxTR_DEFAULT_STYLE, + const wxValidator &validator=wxDefaultValidator, + const wxString &name=_("Projects tree") + ); +}; + +#endif /* WXCREADEVMANAGERTREECTRL_H_ */