]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkWxGUIConsole.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkWxGUIConsole.cxx
index 69a17d61087e0392b3cb1091f96c9cec839845ec..f1b347ee8fa172a17cd485398dd370a1f5b4f29a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIConsole.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/24 10:11:28 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2008/04/24 12:56:39 $
+  Version:   $Revision: 1.10 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -52,6 +52,7 @@ namespace bbtk
       ID_Menu_CreatePackage,
       ID_Menu_CreateBlackBox,
       ID_Menu_ShowImageGraph,
+      ID_Menu_ShowHTMLDoc,
       ID_Menu_CreateIndex,
       ID_Button_Run
     };
@@ -83,6 +84,7 @@ namespace bbtk
     menuTools->Append( ID_Menu_CreatePackage, _T("Create &package") );
     menuTools->Append( ID_Menu_CreateBlackBox, _T("Create &blackbox") );
     menuTools->Append( ID_Menu_ShowImageGraph, _T("&Show last image graph") );
+    menuTools->Append( ID_Menu_ShowHTMLDoc, _T("Show &HTML documentation") );
     menuTools->Append( ID_Menu_CreateIndex, _T("&Generate index") );
     
     
@@ -314,13 +316,35 @@ namespace bbtk
 #else
     std::string strappli="gnome-open ";
 #endif
-    std::string strcommand = strappli +default_temp_dir+"/temp_dir/workspace_workspacePrototype.png";
+    std::string strcommand0 = "cd \"" + default_temp_dir+"/temp_dir/" +"\"";
+    std::string strcommand1 = strappli + "workspace_workspacePrototype.png";
+    std::string strcommand = strcommand0 + " && " + strcommand1;
        std::cout << "system: " << strcommand << std::endl;
     system ( strcommand.c_str() );
 
   }
   //================================================================
 
+  //================================================================
+  void WxGUIConsole::OnMenuShowHTMLDoc(wxCommandEvent& WXUNUSED(event))
+  {
+       std::string doc_path            = ConfigurationFile::GetInstance().Get_doc_path();
+
+#if defined(WIN32)
+    std::string strappli="start ";
+#else
+    std::string strappli="gnome-open ";
+#endif
+    std::string strcommand0 = "cd \"" + doc_path+"\"";
+    std::string strcommand1 = strappli + "index.html";
+    std::string strcommand = strcommand0 + " && " + strcommand1;
+       std::cout << "system: " << strcommand << std::endl;
+    system ( strcommand.c_str() );
+
+  }
+  //================================================================
+
+
 
   //================================================================
   void WxGUIConsole::OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event))
@@ -395,14 +419,15 @@ namespace bbtk
    
   //================================================================  
   BEGIN_EVENT_TABLE(WxGUIConsole, wxFrame)
-    EVT_MENU(ID_Menu_Quit, WxGUIConsole::OnMenuQuit)
-    EVT_MENU(ID_Menu_About, WxGUIConsole::OnMenuAbout)
-    EVT_MENU(ID_Menu_EditConfig, WxGUIConsole::OnMenuEditConfig)
-    EVT_MENU(ID_Menu_CreatePackage, WxGUIConsole::OnMenuCreatePackage)
-    EVT_MENU(ID_Menu_CreateBlackBox, WxGUIConsole::OnMenuCreateBlackBox)
-    EVT_MENU(ID_Menu_ShowImageGraph, WxGUIConsole::OnMenuShowImageGraph)
-    EVT_MENU(ID_Menu_CreateIndex, WxGUIConsole::OnMenuCreateIndex)
-    EVT_BUTTON(ID_Button_Run, WxGUIConsole::OnButtonRun )
+    EVT_MENU(ID_Menu_Quit                      , WxGUIConsole::OnMenuQuit)
+    EVT_MENU(ID_Menu_About                     , WxGUIConsole::OnMenuAbout)
+    EVT_MENU(ID_Menu_EditConfig                , WxGUIConsole::OnMenuEditConfig)
+    EVT_MENU(ID_Menu_CreatePackage     , WxGUIConsole::OnMenuCreatePackage)
+    EVT_MENU(ID_Menu_CreateBlackBox    , WxGUIConsole::OnMenuCreateBlackBox)
+    EVT_MENU(ID_Menu_ShowImageGraph    , WxGUIConsole::OnMenuShowImageGraph)
+    EVT_MENU(ID_Menu_ShowHTMLDoc       , WxGUIConsole::OnMenuShowHTMLDoc)
+    EVT_MENU(ID_Menu_CreateIndex       , WxGUIConsole::OnMenuCreateIndex)
+    EVT_BUTTON(ID_Button_Run           , WxGUIConsole::OnButtonRun )
     END_EVENT_TABLE()
   //================================================================