]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/wxCDMMainFrame.cpp
Feature #1711 CreaDevManager application implementation
[crea.git] / lib / creaDevManagerLib / wxCDMMainFrame.cpp
index eb0a2d4e3a5824150ddab38adccc74f82c6e4399..e8d28c522ca75ef4c83c79f96b1cfca297dc5da6 100755 (executable)
@@ -40,6 +40,7 @@
 #include "wx/statline.h"
 #include "wx/config.h"
 #include "CDMUtilities.h"
+#include "images/CIcon64.xpm"
 
 #include "creaDevManagerIds.h"
 #include "wxCDMMainDescriptionPanel.h"
 #include "wxCDMLibraryDescriptionPanel.h"
 #include "wxCDMPackageDescriptionPanel.h"
 #include "wxCDMBlackBoxDescriptionPanel.h"
+#include "wxCDMBBSFileDescriptionPanel.h"
+#include "wxCDMCodeFileDescriptionPanel.h"
 #include "wxCDMCMakeListsDescriptionPanel.h"
 #include "wxCDMFolderDescriptionPanel.h"
 #include "wxCDMFileDescriptionPanel.h"
 #include "wxCDMPackageManagerPanel.h"
+#include "wxCDMProjectMapDialog.h"
 
 #include "wxCDMSettingsDialog.h"
 
@@ -82,6 +86,7 @@ EVT_MENU(ID_MENU_CODE_EDITOR, wxCDMMainFrame::OnMenuCodeEditor)
 EVT_MENU(ID_MENU_COMMAND_LINE, wxCDMMainFrame::OnMenuCommandLine)
 EVT_MENU(ID_MENU_TOGGLE_HELP, wxCDMMainFrame::OnMenuToggleHelp)
 EVT_MENU(ID_MENU_HELP, wxCDMMainFrame::OnMenuHelp)
+EVT_MENU(ID_MENU_SHOW_PROJECT_MAP, wxCDMMainFrame::OnMenuShowProjectMap)
 EVT_MENU(ID_MENU_REPORT_BUG, wxCDMMainFrame::OnMenuReportBug)
 EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCDMMainFrame::OnMenuAboutCreaDevManager)
 EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
@@ -145,6 +150,7 @@ bool wxCDMMainFrame::Create(
 
   CreateMenus();
   CreateControls();
+  this->SetIcon(wxIcon(CIcon64));
   return TRUE;
 }
 
@@ -230,10 +236,10 @@ void wxCDMMainFrame::CreateMenus()
 
   //ToolsMenu
   menu_Tools = new wxMenu();
-  menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxT("BBTK &Graphical Editor"));
-  menu_Tools->Append(ID_MENU_MINITOOLS, wxT("&MiniTools"));
-  menu_Tools->Append(ID_MENU_CODE_EDITOR, wxT("&Code Editor"));
-  menu_Tools->Append(ID_MENU_COMMAND_LINE, wxT("&Command Line"));
+  menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxT("Open BBEditor (BBTK &Graphical Editor)"));
+  menu_Tools->Append(ID_MENU_MINITOOLS, wxT("Open &CreaTools"));
+  menu_Tools->Append(ID_MENU_CODE_EDITOR, wxT("Open Code &Editor"));
+  menu_Tools->Append(ID_MENU_COMMAND_LINE, wxT("Open Command &Line"));
 
   menuBar->Append(menu_Tools, wxT("&Tools"));
 
@@ -241,6 +247,7 @@ void wxCDMMainFrame::CreateMenus()
   menu_Help = new wxMenu();
   menu_Help->AppendCheckItem(ID_MENU_TOGGLE_HELP, wxT("He&lp Dialogs"));
   menu_Help->Check(ID_MENU_TOGGLE_HELP, this->help);
+  menu_Help->Append(ID_MENU_SHOW_PROJECT_MAP, wxT("&Show Project Map"));
   menu_Help->Append(ID_MENU_HELP, wxT("&Help"));
   menu_Help->Append(ID_MENU_REPORT_BUG, wxT("Report &Bug"));
   menu_Help->Append(ID_MENU_ABOUT_CREADEVMANAGER, wxT("&About CreaDevManager"));
@@ -282,7 +289,7 @@ void wxCDMMainFrame::CreateControls()
   );
 
   auiManager.AddPane(panel_Properties, wxAuiPaneInfo().BestSize(600,400).CenterPane().Name(wxT("panel_Properties")).Caption(wxT("")).CloseButton(false));
-  auiManager.AddPane(tree_Projects, wxAuiPaneInfo().Left().MinSize(300,300).BestSize(300,400).CloseButton(false).Name(wxT("tree_Projects")).Caption(wxT("Project Tree")).CloseButton(false));
+  auiManager.AddPane(tree_Projects, wxAuiPaneInfo().Left().MinSize(250,300).BestSize(250,400).CloseButton(false).Name(wxT("tree_Projects")).Caption(wxT("Project Tree")).CloseButton(false));
   auiManager.Update();
   //auiManager.LoadPerspective(pers,true);
   wxToolTip::Enable(true);
@@ -749,10 +756,18 @@ void wxCDMMainFrame::OnMenuCommandLine(wxCommandEvent& event)
     }
 }
 
+//Help Menu
+void wxCDMMainFrame::OnMenuShowProjectMap(wxCommandEvent& event)
+{
+  wxCDMProjectMapDialog* dialog = new wxCDMProjectMapDialog(this);
+
+  dialog->Show(true);
+}
+
 //Help Menu
 void wxCDMMainFrame::OnMenuHelp(wxCommandEvent& event)
 {
-  wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/site/en/CreatoolsDocumentation"), 0);
+  wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/~gonzalez/documentationSWDoc.html"), 0);
 }
 void wxCDMMainFrame::OnMenuReportBug(wxCommandEvent& event)
 {
@@ -991,14 +1006,14 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
                                     }
                                   else
                                     {
-                                      //folder
-                                      modelCDMFolder* elementFolder = dynamic_cast<modelCDMFolder*>(element);
-                                      if(elementFolder != NULL)
+                                      //CodeFile
+                                      modelCDMCodeFile* elementCodeFile = dynamic_cast<modelCDMCodeFile*>(element);
+                                      if(elementCodeFile != NULL)
                                         {
                                           //create element description
-                                          description = new wxCDMFolderDescriptionPanel(
+                                          description = new wxCDMCodeFileDescriptionPanel(
                                               this,
-                                              elementFolder,
+                                              elementCodeFile,
                                               ID_WINDOW_PROPERTIES,
                                               wxT("Description Panel"),
                                               wxDefaultPosition,
@@ -1008,14 +1023,14 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
                                         }
                                       else
                                         {
-                                          //file
-                                          modelCDMFile* elementFile = dynamic_cast<modelCDMFile*>(element);
-                                          if(elementFile != NULL)
+                                          //BBSFile
+                                          modelCDMBBSFile* elementBBSFile = dynamic_cast<modelCDMBBSFile*>(element);
+                                          if(elementBBSFile != NULL)
                                             {
                                               //create element description
-                                              description = new wxCDMFileDescriptionPanel(
+                                              description = new wxCDMBBSFileDescriptionPanel(
                                                   this,
-                                                  elementFile,
+                                                  elementBBSFile,
                                                   ID_WINDOW_PROPERTIES,
                                                   wxT("Description Panel"),
                                                   wxDefaultPosition,
@@ -1025,17 +1040,53 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
                                             }
                                           else
                                             {
-
-                                              //main if not any
-                                              //create element description
-                                              description = new wxCDMMainDescriptionPanel(
-                                                  this,
-                                                  ID_WINDOW_PROPERTIES,
-                                                  wxT("Description Panel"),
-                                                  wxDefaultPosition,
-                                                  wxSize(600, 400),
-                                                  0
-                                              );
+                                              //folder
+                                              modelCDMFolder* elementFolder = dynamic_cast<modelCDMFolder*>(element);
+                                              if(elementFolder != NULL)
+                                                {
+                                                  //create element description
+                                                  description = new wxCDMFolderDescriptionPanel(
+                                                      this,
+                                                      elementFolder,
+                                                      ID_WINDOW_PROPERTIES,
+                                                      wxT("Description Panel"),
+                                                      wxDefaultPosition,
+                                                      wxSize(600, 400),
+                                                      0
+                                                  );
+                                                }
+                                              else
+                                                {
+                                                  //file
+                                                  modelCDMFile* elementFile = dynamic_cast<modelCDMFile*>(element);
+                                                  if(elementFile != NULL)
+                                                    {
+                                                      //create element description
+                                                      description = new wxCDMFileDescriptionPanel(
+                                                          this,
+                                                          elementFile,
+                                                          ID_WINDOW_PROPERTIES,
+                                                          wxT("Description Panel"),
+                                                          wxDefaultPosition,
+                                                          wxSize(600, 400),
+                                                          0
+                                                      );
+                                                    }
+                                                  else
+                                                    {
+
+                                                      //main if not any
+                                                      //create element description
+                                                      description = new wxCDMMainDescriptionPanel(
+                                                          this,
+                                                          ID_WINDOW_PROPERTIES,
+                                                          wxT("Description Panel"),
+                                                          wxDefaultPosition,
+                                                          wxSize(600, 400),
+                                                          0
+                                                      );
+                                                    }
+                                                }
                                             }
                                         }
                                     }