]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkWxGUIScriptingInterface.cxx
are now generated in user's .bbtk dir
[bbtk.git] / kernel / src / bbtkWxGUIScriptingInterface.cxx
index 966c1f70486f924d6c5f3eb88e6b00215d0f4322..49bc3460c4b27219bd8b51e26ae56fb3ecea7d24 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/12/15 09:04:47 $
-  Version:   $Revision: 1.32 $
+  Date:      $Date: 2009/01/27 14:22:57 $
+  Version:   $Revision: 1.33 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -55,6 +55,7 @@
 #include "bbtkUtilities.h"
 
 #include <wx/tipwin.h>
+#include <wx/splash.h>
 
 //#include "icons/cc_run.xpm"
 
@@ -88,7 +89,6 @@ namespace bbtk
     : wxFrame((wxFrame *)parent, -1, _T("bbStudio"), 
              wxDefaultPosition, wxSize(1200,800) )
   {    
-    //    m_mgr = new wxAuiManager(this);
     m_mgr.SetManagedWindow(this);
     
     mInterpreter = bbtk::Interpreter::New();
@@ -262,11 +262,38 @@ namespace bbtk
     //   LoadPerspective();
 
     mBreaked = false;  
+
+    wxBitmap bitmap;   
+    wxSplashScreen* splash;
+    long style = wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_TIMEOUT;
+    if (ConfigurationFile::GetInstance().DotBbtkIsNew())
+      style = wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT;
+    std::string splash_file = ConfigurationFile::GetInstance().Get_data_path();
+    splash_file += "/kernel/icons/bbStudioSplashScreen.png";
+
+    if (bitmap.LoadFile(std2wx(splash_file),wxBITMAP_TYPE_PNG))
+      splash = 
+       new wxSplashScreen(bitmap,
+                          style,
+                          1000, 0, -1, wxDefaultPosition, wxDefaultSize,
+                          wxSIMPLE_BORDER|wxSTAY_ON_TOP);
+       
     
-    wxTipWindow* tip = new wxTipWindow(this,
-                                      _T("\n                  Welcome to bbStudio !\n\n   To run a demo or example:\n     1. click on the 'Demos' or 'Examples' link\n     2. select a demo or example\n     3. click on the '[source]' link : the source file is loaded in bbStudio\n     4. click on the 'Run' button (the arrow at the bottom right of the source file)   \n"),1000);
-    tip->CenterOnParent();
-    tip->Show();
+    if (ConfigurationFile::GetInstance().DotBbtkIsNew())
+      {
+
+       DoRegeneratePackageDoc("-a");   
+       DoRegenerateBoxesLists();
+
+       /*
+       wxTipWindow* tip = new wxTipWindow(this,
+                                          _T("\n                  Welcome to bbStudio !\n\n   To run a demo or example:\n     1. click on the 'Demos' or 'Examples' link\n     2. select a demo or example\n     3. click on the '[source]' link : the source file is loaded in bbStudio\n     4. click on the 'Run' button (the arrow at the bottom right of the source file)   \n"),1000);
+       tip->CenterOnParent();
+       tip->Show();
+       */
+       if (splash) splash->Destroy();
+      }
+
   }
   //================================================================
 
@@ -507,11 +534,22 @@ namespace bbtk
 
   void WxGUIScriptingInterface::DoRegeneratePackageDoc( const std::string& pack )
   {
-           std::string command;
+    std::string mess("Regenerating doc for package '");
+    if (pack!="-a") 
+      mess += pack + "'";
+    else 
+      mess = "Regenerating doc for all packages";
+    mess += " ... please wait";
+
+    SetStatusText( std2wx(mess) );
+
+    BBTK_BUSY_CURSOR;
+
+    std::string command;
 #if defined(WIN32)
-       command = "\"";
+    command = "\"";
 #endif
-       command += ConfigurationFile::GetInstance().Get_bin_path();
+    command += ConfigurationFile::GetInstance().Get_bin_path();
     command += ConfigurationFile::GetInstance().Get_file_separator();
     command += "bbRegeneratePackageDoc";
 #if defined(WIN32)
@@ -523,15 +561,23 @@ namespace bbtk
 
     if ( ! system ( command.c_str() ) )
       {
-       wxMessageBox(_T("Done !"),_T("Regenerate package '")+std2wx(pack)+_T("' doc"),
+       SetStatusText( _T("Done !"));
+       /*
+       wxMessageBox(_T("Done !"),_T("Regenerate package '")
+                    +std2wx(pack)+_T("' doc"),
                     wxOK | wxICON_INFORMATION);
+       */
       }
     else 
       {
+       SetStatusText( _T("Done !"));
        wxString err(_T("An error occured while running '"));
        err +=  bbtk::std2wx(command) + _T("'");
        wxMessageBox(err,_T("Regenerate package doc"),wxOK | wxICON_ERROR);      
       }
+
+
+
   }
 
 
@@ -549,8 +595,12 @@ namespace bbtk
   //================================================================
 
 
+  //================================================================
   void WxGUIScriptingInterface::DoRegenerateBoxesLists()
   {
+    SetStatusText( _T("Regenerating boxes lists ... please wait") );
+    BBTK_BUSY_CURSOR ;
+
     std::string command;
 #if defined(WIN32)
        command = "\"";
@@ -564,18 +614,26 @@ namespace bbtk
        command += " -q";
        bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
 
-       if ( ! system ( command.c_str() ) )
-    {
-       wxMessageBox(_T("Done !"),_T("Regenerate boxes lists"),
-                   wxOK | wxICON_INFORMATION);
-     }
-   else 
-     {
-       wxString err(_T("An error occured while running '"));
-       err +=  bbtk::std2wx(command) + _T("'");
-       wxMessageBox(err,_T("Regenerate boxes lists"),wxOK | wxICON_ERROR);      
-     }
+
+
+    if ( ! system ( command.c_str() ) )
+      {
+       SetStatusText( _T("Done !"));
+       /*
+       wxMessageBox(_T("Done !"),_T("Regenerate boxes lists"),
+                    wxOK | wxICON_INFORMATION);
+       */
+      }
+    else 
+      {
+       SetStatusText( _T("Done !"));
+       wxString err(_T("An error occured while running '"));
+       err +=  bbtk::std2wx(command) + _T("'");
+       wxMessageBox(err,_T("Regenerate boxes lists"),wxOK | wxICON_ERROR);      
+      }
   }
+  //================================================================
+
 
   //================================================================
   void WxGUIScriptingInterface::OnMenuRegenerateBoxesLists(wxCommandEvent& WXUNUSED(event))