]> Creatis software - crea.git/commitdiff
Feature #1711
authorDaniel Gonzalez <Daniel.Gonzalez@creatis.insa-lyon.fr>
Fri, 19 Oct 2012 16:09:33 +0000 (16:09 +0000)
committerDaniel Gonzalez <Daniel.Gonzalez@creatis.insa-lyon.fr>
Fri, 19 Oct 2012 16:09:33 +0000 (16:09 +0000)
CreaDevManager application implementation:

Tree and windows added with AUI

.cvsignore
appli/creaDevManager/creaDevManager.cpp
appli/creaDevManager/creaDevManager.h
lib/creaDevManagerLib/creaDevManagerIds.h [new file with mode: 0644]
lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx
lib/creaDevManagerLib/wxCreaDevManagerMainFrame.h
lib/creaDevManagerLib/wxCreaDevManagerTreeCtrl.cxx [new file with mode: 0644]
lib/creaDevManagerLib/wxCreaDevManagerTreeCtrl.h [new file with mode: 0644]

index 86b18f5c326bb90d8166d1a93738cce513298162..ea72388b31f0ef09c7824a3a916fd3bdd37959cd 100644 (file)
@@ -1,2 +1,3 @@
 .cproject
 .project
+.settings
index b5c1a6559ada26a32c3d77b13d326f0748764ee2..fe46557b9784975892e186aa70e791e0ff15366e 100644 (file)
@@ -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;
+}
index 7e76ae863757da26111778117290838e0d17ffe6..3380ebaf307b9feb090d44086434488ab4f3c8a4 100644 (file)
@@ -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 (file)
index 0000000..aaec5ef
--- /dev/null
@@ -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_ */
index a26bc703f64c2fc760f8a3ebf30bd4aba6df471e..ce83e9393a51d7766c2922817885455f2000df11 100644 (file)
@@ -1,5 +1,6 @@
-#include <creaWx.h>
 #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();
+}
index f818364599627f2ffc2f492503088487b118ab63..844632acfacd561146cb1eb71caea9d5170a29ef 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef WXCREADEVMANAGERMAINFRAME_H_INCLUDED
 #define WXCREADEVMANAGERMAINFRAME_H_INCLUDED
 
+#include <creaWx.h>
+#include <wx/treectrl.h>
+#include <wx/aui/aui.h>
+
 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 (file)
index 0000000..b4af43e
--- /dev/null
@@ -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 (file)
index 0000000..3491352
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * wxCreaDevManagerTreeCtrl.h
+ *
+ *  Created on: 19/10/2012
+ *      Author: daniel
+ */
+
+#ifndef WXCREADEVMANAGERTREECTRL_H_
+#define WXCREADEVMANAGERTREECTRL_H_
+
+#include <creaWx.h>
+#include <wx/treectrl.h>
+
+
+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_ */