]> Creatis software - crea.git/commitdiff
Feature #1711
authorDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Tue, 22 Jan 2013 16:51:47 +0000 (17:51 +0100)
committerDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Tue, 22 Jan 2013 17:10:29 +0000 (18:10 +0100)
CreaDevManager application implementation

- Changes for windows compatibility Application opens and creates projects. Tree selection multiselection error fixed.

appli/creaDevManager/CMakeLists.txt
appli/creaDevManager/creaDevManager.cpp
lib/creaDevManagerLib/wxCDMMainFrame.cpp
lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.cxx

index 0a5320a56a51375c6944a52bca28848bb1026ded..2caa03c4d2db4356f3148d9e6897824ef1dcbb2c 100644 (file)
@@ -72,8 +72,39 @@ SET ( ${EXE_NAME}_LINK_LIBRARIES
 CREA_ADD_EXECUTABLE( ${EXE_NAME} )
 #============================================================================
 
+#==sets additional files=====================================================
+IF(WIN32)
+
+# Build tree 
+  CONFIGURE_FILE(
+    ${CMAKE_CURRENT_SOURCE_DIR}/about.html
+    ${EXECUTABLE_OUTPUT_PATH}/Debug/about.html
+    COPYONLY 
+    )
+    
+  CONFIGURE_FILE(
+    ${CMAKE_CURRENT_SOURCE_DIR}/about.html
+    ${EXECUTABLE_OUTPUT_PATH}/Release/about.html
+    COPYONLY 
+    )
+    
+  INSTALL(
+    PROGRAMS ${EXECUTABLE_OUTPUT_PATH}/Debug/about.html
+    DESTINATION bin
+    )
+
+ELSE(WIN32)
+
 CONFIGURE_FILE(
     ${CMAKE_CURRENT_SOURCE_DIR}/about.html
     ${EXECUTABLE_OUTPUT_PATH}/about.html
     @ONLY IMMEDIATE
     )
+
+INSTALL(
+    FILES ${EXECUTABLE_OUTPUT_PATH}/about.html
+    DESTINATION bin
+    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+    )
+    
+ENDIF(WIN32)
index be7b25b9d0930a7dd21bc0e445a6b7ed5e457eb6..36c64ed208e4ded3a6acb902cb5389285c200351 100644 (file)
@@ -33,6 +33,7 @@ IMPLEMENT_APP(wxCreaDevManagerApp)
 
 wxCreaDevManagerApp::wxCreaDevManagerApp():wxApp()
 {
+  mainWindow = NULL;
 }
 
 bool wxCreaDevManagerApp::OnInit()
@@ -49,7 +50,6 @@ bool wxCreaDevManagerApp::OnInit()
 
 int wxCreaDevManagerApp::OnExit()
 {
-  mainWindow->Destroy();
   wxApp::OnExit();
   std::cout << "Crea DevManager closed." << std::endl;
   return 0;
index a5b1315fd05814df8c2c0494190141a88e33cedb..ad37e22c023a6bc3f12de9fd1ab7163100d14836 100755 (executable)
@@ -277,8 +277,8 @@ void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event)
 
       //populate tree control
       tree_Projects->BuildTree(this->model->GetModelElements(),this->model->GetProject());
-      tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
-      tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
+      tree_Projects->Unselect();
+      tree_Projects->SelectItem(this->model->GetProject()->GetId());
 
 
       //show project actions panel
@@ -352,7 +352,7 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event)
 
       //populate tree control
       tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
-      tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
+      tree_Projects->Unselect();
       tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
 
 
@@ -438,7 +438,7 @@ void wxCDMMainFrame::OnMenuExit(wxCommandEvent& event)
     {
       std::cout << "error closing project: " << *result << std::endl;
     }
-  tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
+
   if(this->panel_Properties != NULL)
     {
       auiManager.DetachPane(this->panel_Properties);
@@ -446,6 +446,13 @@ void wxCDMMainFrame::OnMenuExit(wxCommandEvent& event)
       this->panel_Properties = NULL;
     }
   
+  if(this->tree_Projects != NULL)
+    {
+      auiManager.DetachPane(this->tree_Projects);
+      this->tree_Projects->Destroy();
+      this->tree_Projects = NULL;
+    }
+
   if(this->panel_ProjectActions != NULL)
     {
       auiManager.DetachPane(this->panel_ProjectActions);
@@ -469,7 +476,7 @@ void wxCDMMainFrame::OnMenuRefreshProject(wxCommandEvent& event)
       this->tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
       this->auiManager.Update();
 
-      this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
+      this->tree_Projects->Unselect();
       this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
     }
   event.Skip();
@@ -525,7 +532,42 @@ void wxCDMMainFrame::OnMenuAboutCreaDevManager(wxCommandEvent& event)
 
   html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
   html -> SetBorders(0);
-  html -> LoadPage(wxT("about.html"));
+
+  std::string content = ""
+      "<html>"
+      "<body bgcolor=\"#3333CC\">"
+      "<table cellspacing=3 cellpadding=4 width=\"100%\">"
+      "  <tr>"
+      "    <td bgcolor=\"#3333CC\">"
+      "    <center>"
+      "    <font size=+2 color=\"#FFFFFF\"><b>CREA Development Manager</b>"
+      "    </font>"
+      "    </center>"
+      "    </td>"
+      "  </tr>"
+      "  <tr>"
+      "    <td bgcolor=\"#FFFFFF\">"
+      "    <p><b><font size=+1>Creatis 2012 - Lyon, France</font></b></p>"
+      "    <font size=-1>"
+      "      <table cellpadding=0 cellspacing=0 width=\"100%\">"
+      "        <tr>"
+      "          <td width=\"65%\">"
+      "            <p>Created by Daniel Gonz&aacute;lez - daniel.gonzalez@creatis.insa-lyon.fr</p>"
+      "          </td>"
+      "        </tr>"
+      "      </table>"
+      "      <font size=1>"
+      "        <p>This software is governed by the CeCILL-B license under French law and abiding by the rules of distribution of free software.</p>"
+      "      </font>"
+      "    </font>"
+      "    </td>"
+      "  </tr>"
+      "</table>"
+      "</body>"
+      "</html>"
+      ;
+
+  html -> SetPage(crea::std2wx(content));
   html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(),
       html -> GetInternalRepresentation() -> GetHeight());
 
@@ -760,24 +802,18 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
             }
         }
 
-      if(this->panel_Properties!= NULL)
-        this->panel_Properties->Hide();
-
-      auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
-      auiManager.Update();
-
       //delete old view
       if(this->panel_Properties!= NULL)
         {
+          this->panel_Properties->Hide();
           auiManager.DetachPane(this->panel_Properties);
           this->panel_Properties->Destroy();
           this->panel_Properties = NULL;
         }
       //set new view
-
+      auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
       this->panel_Properties = description;
 
-      //auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400).CloseButton(false));
       auiManager.Update();
       event.Skip();
     }
@@ -794,7 +830,7 @@ void wxCDMMainFrame::OnChangeView(wxCommandEvent& event)
   case 0:
     myItem = ((modelCDMIProjectTreeNode*)event.GetClientData());
     //select out old one to generate selection event
-    this->tree_Projects->SelectItem(myItem->GetId(), false);
+    this->tree_Projects->Unselect();
     this->tree_Projects->SelectItem(myItem->GetId(), true);
     this->tree_Projects->Expand(myItem->GetId());
     break;
@@ -802,8 +838,8 @@ void wxCDMMainFrame::OnChangeView(wxCommandEvent& event)
     wxPanel* description = NULL;
     if(event.GetString() == wxT("manage_packages"))
       {
-        this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
-        this->tree_Projects->Expand(this->model->GetProject()->GetId());
+        //this->tree_Projects->Expand(this->model->GetProject()->GetId());
+        //this->tree_Projects->Unselect();
         description = new wxCDMPackageManagerPanel(
             this,
             this->model->GetProject(),
@@ -828,7 +864,6 @@ void wxCDMMainFrame::OnChangeView(wxCommandEvent& event)
       }
     else if(event.GetString() == wxT("blackbox"))
       {
-        this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
         modelCDMBlackBox* bb = (modelCDMBlackBox*)event.GetClientData();
         description = new wxCDMBlackBoxDescriptionPanel(
             this,
@@ -841,23 +876,19 @@ void wxCDMMainFrame::OnChangeView(wxCommandEvent& event)
         );
       }
 
-    if(this->panel_Properties!= NULL)
-      this->panel_Properties->Hide();
-
-    auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
-    auiManager.Update();
-
     //delete old view
     if(this->panel_Properties!= NULL)
       {
+        this->panel_Properties->Hide();
         auiManager.DetachPane(this->panel_Properties);
         this->panel_Properties->Destroy();
         this->panel_Properties = NULL;
       }
     //set new view
-
+    auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
     this->panel_Properties = description;
     auiManager.Update();
+
     break;
   }
   event.Skip();
index bb06283c278d80bad4b5252865a63d6205939929..2c8882e49b79dd8d1d503bd5de12b75a126ea2ca 100644 (file)
@@ -357,7 +357,7 @@ void wxCDMPackageDescriptionPanel::OnLnkBlackBoxSelect(wxHyperlinkEvent& event)
   wxPostEvent(this->GetParent(), *newEvent);
 
   wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
-  newEvent1->SetClientData(bb);
+  newEvent1->SetClientData(bb->GetHeaderFile());
   newEvent1->SetId(0);
   wxPostEvent(this->GetParent(), *newEvent1);
 
index e05fa97b0711b743550fcbcd1ed2491dd74e272a..3b471199e0270ef5c25d798b4b8217dceeff025f 100755 (executable)
@@ -97,9 +97,7 @@ bool wxCDMProjectsTreeCtrl::Create(
   this->ID_PkIcon = images->Add(wxIcon(PkIcon20));
   this->AssignImageList(images);
 
-  wxTreeItemId rootId = AddRoot(wxT("Root"), 0, 0);
-/*
-  wxTreeItemId rootIndex = this->AddRoot(wxT("No Open Project"), this->ID_Cicon, this->ID_Cicon);*/
+  wxTreeItemId rootIndex = this->AddRoot(wxT("No Open Project"), this->ID_Cicon, this->ID_Cicon);
   this->Update();
   return TRUE;
 }
@@ -125,7 +123,7 @@ void wxCDMProjectsTreeCtrl::BuildTree(std::map< wxTreeItemId, modelCDMIProjectTr
     }
   else
     {
-      wxTreeItemId rootIndex = this-> AddRoot(_("No Open Project"));
+      wxTreeItemId rootIndex = this-> AddRoot(_("No Open Project"), this->ID_Cicon, this->ID_Cicon);
     }
 }