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

Welcome view

lib/creaDevManagerLib/creaDevManagerIds.h
lib/creaDevManagerLib/wxCreaDevManagerDescriptionPanel.cpp
lib/creaDevManagerLib/wxCreaDevManagerDescriptionPanel.h
lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx

index a4c283cd162bcbf5c49ab5ea0f5cab10682dbdcb..ae01f61384bfd1b1dc8a9f41a8dae947805607fe 100644 (file)
@@ -45,4 +45,7 @@
 #define ID_BUTTON_CANCEL                10301
 #define ID_BUTTON_CHOOSE                10302
 
+#define ID_BUTTON_NEWPROJECT            10303
+#define ID_BUTTON_OPENPROJECT           10304
+
 #endif /* CREADEVMANAGERIDS_H_ */
index c0ad9b204defe44e145c3166efcf73c535970ac8..5711faf62221a76a6180a60d183589029024d274 100644 (file)
@@ -7,10 +7,19 @@
 
 #include "wxCreaDevManagerDescriptionPanel.h"
 
-#include "images/folder64.xpm"
+#include "images/Cicon64.xpm"
+
+#include "creaDevManagerIds.h"
 
 #include <wx/statbox.h>
 
+#include <iostream>
+
+BEGIN_EVENT_TABLE(wxCreaDevManagerDescriptionPanel, wxPanel)
+  EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCreaDevManagerDescriptionPanel::OnBtnNewProject)
+  EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCreaDevManagerDescriptionPanel::OnBtnOpenProject)
+END_EVENT_TABLE()
+
 wxCreaDevManagerDescriptionPanel::wxCreaDevManagerDescriptionPanel(
     wxWindow* parent,
     wxWindowID id,
@@ -48,13 +57,14 @@ void wxCreaDevManagerDescriptionPanel::CreateView(wxString title, wxString image
   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
 
   //Title
-  sizer->Add(new wxStaticText(this, -1, _("Package")),0, wxALIGN_CENTER, 0);
+  sizer->Add(new wxStaticText(this, -1, _("Welcome")),0, wxALIGN_CENTER, 0);
   //Image
-  sizer->Add(new wxStaticBitmap(this,-1, wxBitmap(folder64)),0, wxALIGN_CENTER, 0);
+  sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(Cicon)),0, wxALIGN_CENTER, 0);
   //Name
-  sizer->Add(new wxStaticText(this, -1, _("MyPackage")),0, wxALIGN_CENTER, 0);
+  sizer->Add(new wxStaticText(this, -1, _("Crea Development Manager")),0, wxALIGN_CENTER, 0);
 
   //Properties Box
+  /*
   wxStaticBox* propsBox = new wxStaticBox(this, -1, _T("&Properties"));
 
   wxStaticBoxSizer* propsBoxInnerSizer = new wxStaticBoxSizer(propsBox, wxVERTICAL);
@@ -63,19 +73,15 @@ void wxCreaDevManagerDescriptionPanel::CreateView(wxString title, wxString image
   wxString propsText = wxString(_T("Property 1: value 1\nProperty 2: long valuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuue 2"));
   wxStaticText* props = new wxStaticText(this, -1, propsText, wxDefaultPosition, wxSize(140,10));
   propsBoxInnerSizer->Add(props, 1, wxEXPAND | wxALL, 5);
-
+  */
   //Actions Box
   wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions"));
 
   wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL);
   sizer -> Add(actionsBoxInnerSizer, 2, wxCENTER | wxEXPAND | wxALL, 10);
 
-  actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 1")), 0, wxEXPAND, 0);
-  actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 2")), 0, wxEXPAND, 0);
-  actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 3")), 0, wxEXPAND, 0);
-  actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 4")), 0, wxEXPAND, 0);
-  actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 5")), 0, wxEXPAND, 0);
-  actionsBoxInnerSizer->Add(new wxButton(this, -1, _T("Action 6")), 0, wxEXPAND, 0);
+  actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_NEWPROJECT, _T("New Project")), 0, wxRIGHT | wxLEFT, 20);
+  actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_OPENPROJECT, _T("Open Project")), 0, wxRIGHT | wxLEFT, 20);
 
 
 
@@ -85,3 +91,14 @@ void wxCreaDevManagerDescriptionPanel::CreateView(wxString title, wxString image
   SetSizer(sizer);
 }
 
+void wxCreaDevManagerDescriptionPanel::OnBtnNewProject(wxCommandEvent& event)
+{
+  event.ResumePropagation(1);
+  event.Skip();
+}
+
+void wxCreaDevManagerDescriptionPanel::OnBtnOpenProject(wxCommandEvent& event)
+{
+  event.ResumePropagation(1);
+  event.Skip();
+}
index 3feb49333117b0c9d57899527e9326439e0f054b..184271ad26abf87b27d8bc5fa2d7bf8f88ab2ce4 100644 (file)
@@ -19,6 +19,9 @@
 
 class wxCreaDevManagerDescriptionPanel : public wxPanel
 {
+
+  DECLARE_EVENT_TABLE()
+
   public:
       wxCreaDevManagerDescriptionPanel(
         wxWindow* parent,
@@ -43,7 +46,11 @@ class wxCreaDevManagerDescriptionPanel : public wxPanel
 
   protected:
       void CreateView(wxString title = wxString("Title"), wxString imagePath = wxString(""), wxString type = wxString("Type"), std::vector<std::pair<std::string, std::string> > properties = std::vector<std::pair<std::string, std::string> >());
-      //void CreateView();
+
+      void OnBtnNewProject(wxCommandEvent& event);
+      void OnBtnOpenProject(wxCommandEvent& event);
+
+
   private:
       wxStaticText* _title;
       wxBitmap* _image;
index e69b26ad8f62453668939cc39c0f0693f343d137..b48582a8607c6df6e6b3869feace48df6609a3b0 100644 (file)
@@ -42,6 +42,8 @@ BEGIN_EVENT_TABLE(wxCreaDevManagerMainFrame, wxFrame)
   EVT_MENU(ID_MENU_REPORT_BUG, wxCreaDevManagerMainFrame::OnMenuReportBug)
   EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCreaDevManagerMainFrame::OnMenuAboutCreaDevManager)
   EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCreaDevManagerMainFrame::OnMenuAboutCreatis)
+  EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCreaDevManagerMainFrame::OnMenuNewProject)
+  EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCreaDevManagerMainFrame::OnMenuOpenProject)
 END_EVENT_TABLE()
 
 wxCreaDevManagerMainFrame::wxCreaDevManagerMainFrame(
@@ -155,18 +157,17 @@ void wxCreaDevManagerMainFrame::CreateControls()
     this,
     ID_TREE_PROJECTS,
     wxDefaultPosition,
-    wxDefaultSize,
+    wxSize(300,400),
     wxTR_HAS_BUTTONS | wxTR_AQUA_BUTTONS
   );
-  tree_Projects->SetSize(400,100);
-  tree_Projects->SetMinSize(wxSize(300,100));
+  tree_Projects->SetMinSize(wxSize(200,200));
 
   panel_Properties = new wxCreaDevManagerDescriptionPanel(
     this,
     ID_WINDOW_PROPERTIES,
     wxString("Description Panel"),
     wxDefaultPosition,
-    wxDefaultSize,
+    wxSize(300, 400),
     0
   );
 
@@ -177,10 +178,10 @@ void wxCreaDevManagerMainFrame::CreateControls()
     ID_WINDOW_PROJ_ACTIONS,
     wxString("Project Actions Panel"),
     wxDefaultPosition,
-    wxDefaultSize,
+    wxSize(600,200),
     0
   );
-  panel_ProjectActions->SetMinSize(wxSize(500, 150));
+  panel_ProjectActions->SetMinSize(wxSize(500, 100));
 
   auiManager.AddPane(tree_Projects, wxLEFT, wxString("Projects Tree"));
   auiManager.AddPane(panel_ProjectActions, wxBOTTOM, wxString("Project Actions"));
@@ -227,7 +228,7 @@ void wxCreaDevManagerMainFrame::OnMenuOpenProject(wxCommandEvent& event)
       break;
     };
 
-    ((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(this->controller->GetActiveProjects());
+    ((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(controller->GetActiveProjects());
 
     auiManager.Update();
   }