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 $
=========================================================================*/
/* ---------------------------------------------------------------------
#include "bbtkUtilities.h"
#include <wx/tipwin.h>
+#include <wx/splash.h>
//#include "icons/cc_run.xpm"
: wxFrame((wxFrame *)parent, -1, _T("bbStudio"),
wxDefaultPosition, wxSize(1200,800) )
{
- // m_mgr = new wxAuiManager(this);
m_mgr.SetManagedWindow(this);
mInterpreter = bbtk::Interpreter::New();
// 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();
+ }
+
}
//================================================================
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)
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);
}
+
+
+
}
//================================================================
+ //================================================================
void WxGUIScriptingInterface::DoRegenerateBoxesLists()
{
+ SetStatusText( _T("Regenerating boxes lists ... please wait") );
+ BBTK_BUSY_CURSOR ;
+
std::string command;
#if defined(WIN32)
command = "\"";
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))