]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Wed, 10 Sep 2008 09:25:18 +0000 (09:25 +0000)
committerguigues <guigues>
Wed, 10 Sep 2008 09:25:18 +0000 (09:25 +0000)
kernel/appli/bbStudio/bbStudio.cxx
kernel/src/bbtkFactory.cxx
kernel/src/bbtkWxGUIScriptingInterface.cxx
kernel/src/bbtkWxGUIScriptingInterface.h

index b994e493651618ce1bd5e883e69192033945fde3..541d24a171de07b8082381362b25d9c19c570ee2 100644 (file)
@@ -75,7 +75,7 @@ bool wxBBIApp::OnInit( )
   if (usage) return false;
   
   bbtk::WxGUIScriptingInterface *I = 
-    new bbtk::WxGUIScriptingInterface(0,_T("bbStudio"),wxSize(800,600));
+    new bbtk::WxGUIScriptingInterface(0);
   SetTopWindow(I);  
   I->Show(true);
 
index bc21a292287b96f3cdc776d07d76c3e4dcb812c4..3ca2be2cb787adcefe5539dbf404d3bd83feb7d0 100644 (file)
@@ -4,8 +4,8 @@ Program:   bbtk
 Module:    $RCSfile: bbtkFactory.cxx,v $
 Language:  C++
 
-Date:      $Date: 2008/07/01 07:58:28 $
-Version:   $Revision: 1.37 $
+Date:      $Date: 2008/09/10 09:25:19 $
+Version:   $Revision: 1.38 $
                                                                                 
 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
@@ -251,8 +251,8 @@ namespace bbtk
         if (ok)
         {
            bbtkMessage("debug",2,"   OK"<<std::endl);
-           break; // a package was found; we stop iterating
         }
+       break; // we stop iterating even if error : have to signal it to user
     } //------------------ // end for ( package_paths.begin();i!=package_paths.end() )
 
 }
@@ -267,10 +267,12 @@ namespace bbtk
       {
 #if defined(__GNUC__)
         bbtkError("Could not load package ["<< pkgname
-                  <<"] :" << std::endl << "   " << dlerror());
+                  <<"] :" << std::endl 
+                 << "  Opening "<<libname<<" failed"
+                 << "  Reason: "<< dlerror());
 #elif defined(_WIN32)
         bbtkError("Could not load package ["<<pkgname
-                 <<"] : " << std::endl << "   " <<libname<<" not found");
+                 <<"] :"<< std::endl << "   Error loading " <<libname);
 
     // look how to get the error message on win
     //<<dlerror());
index 895410e940cf630a76c004f7f1a98f049650fd73..d176ba3d31a2b1eb8adf37ddffdc7169c903362a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/09/10 07:25:23 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2008/09/10 09:25:19 $
+  Version:   $Revision: 1.17 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -65,8 +65,9 @@ namespace bbtk
     
   
   //================================================================
-  WxGUIScriptingInterface::WxGUIScriptingInterface( wxWindow *parent, wxString title, wxSize size)
-    : wxFrame((wxFrame *)parent, -1, title, wxDefaultPosition, size)
+  WxGUIScriptingInterface::WxGUIScriptingInterface( wxWindow *parent )
+    : wxFrame((wxFrame *)parent, -1, _T("bbStudio"), 
+             wxDefaultPosition, wxSize(1200,800) )
   {    
     //    m_mgr = new wxAuiManager(this);
     m_mgr.SetManagedWindow(this);
@@ -81,13 +82,13 @@ namespace bbtk
     wxInitAllImageHandlers();
     
     wxMenu *menuFile = new wxMenu;
+    menuFile->Append( ID_Menu_EditConfig, _T("Open bbtk &Config file") );
     menuFile->Append( ID_Menu_Quit, _T("&Quit") );
     
     wxMenu *menuAbout = new wxMenu;
     menuAbout->Append( ID_Menu_About, _T("&About...") );
 
     wxMenu *menuTools = new wxMenu;
-    menuTools->Append( ID_Menu_EditConfig, _T("&Edit bbtk config") );
     menuTools->Append( ID_Menu_CreatePackage, _T("Create &package") );
     menuTools->Append( ID_Menu_CreateBlackBox, _T("Create &black box") );
     menuTools->Append( ID_Menu_ShowImageGraph, _T("&Show last image graph") );
@@ -122,10 +123,13 @@ namespace bbtk
     
     SetMenuBar( menuBar );
     
+    //=== 
+    // Status bar
     CreateStatusBar();
     SetStatusText( _T("Welcome to bbStudio !") );
     
-    //
+    //===
+    // Panes (Files, Messages, Help, Command)
     mWxGUITextEditor = new WxGUITextEditor(this,this);
     mWxGUITextEditor->SetFileNameFilter("*.bbs");
        
@@ -179,7 +183,7 @@ namespace bbtk
                  .Caption(wxT("Files"))
                  .MinimizeButton(true)
                  .MaximizeButton(true)
-                 .Left()
+                 .Center()
                  .MinSize(wxSize(100,100))
                  );   
   
@@ -189,7 +193,8 @@ namespace bbtk
                  .MinimizeButton(true)
                  .MaximizeButton(true)
                  .Right()
-                 .MinSize(wxSize(200,100))
+                 .Layer(2)
+                 .MinSize(wxSize(400,100))
                  );
 
     m_mgr.AddPane(mWxGUIOutputMessages,
@@ -206,7 +211,7 @@ namespace bbtk
                  .MinimizeButton(true)
                  .MaximizeButton(true)
                  .Bottom()
-                 .Position(1)
+                 .Layer(1)
                  .MinSize(wxSize(100,100))
                  );     
 #endif
@@ -216,9 +221,11 @@ namespace bbtk
     // Add the method OnWxSignal as a Wx::Signal observer 
     //bbtkAddWxSignalObserver(WxGUIPackageBrowser2Window::OnWxSignal);
 
-//.PaneBorder(false)); 
+    //.PaneBorder(false)); 
+    // Load the interface appearance saved on last closing
     LoadPerspective();
 
+    // Done in LoadPerspective
     //    m_mgr.Update();
        
     SetAutoLayout(true);
@@ -336,16 +343,9 @@ namespace bbtk
   //================================================================
   void WxGUIScriptingInterface::OnMenuEditConfig(wxCommandEvent& WXUNUSED(event))
   {
-       std::string commandStr;
-    std::string configFile = ConfigurationFile::GetInstance().Get_config_xml_full_path();
-#ifdef WIN32
-       commandStr = "notepad.exe ";
-#else
-       commandStr = "gedit ";
-#endif 
-       commandStr = commandStr + configFile;
-       //      std::cout << "system: " << commandStr << std::endl;
-       system ( commandStr.c_str() );
+    std::string configFile = 
+      ConfigurationFile::GetInstance().Get_config_xml_full_path();
+    Open(configFile);
   }
   //================================================================
 
@@ -433,8 +433,11 @@ namespace bbtk
 
     Interpreter::Pointer I = Interpreter::New();    
 
+    I->InterpretLine( "config");
+    I->InterpretLine( "message echo 2");
     I->InterpretLine( "exec freeze");
     I->InterpretLine( "include *");
+    I->InterpretLine( "help packages");
     I->InterpretLine( "index "+doc_path+"/bbdoc/index-alpha.html Initials");
     I->InterpretLine( "index "+doc_path+"/bbdoc/index-package.html Packages");
     I->InterpretLine( "index "+doc_path+"/bbdoc/index-category.html Categories");
@@ -585,7 +588,8 @@ namespace bbtk
   void WxGUIScriptingInterface::OnPaneClose(wxAuiManagerEvent& evt)
   {
     std::cout  << "Closing panel '"<<evt.pane->name<<"'"<<std::endl;
-    
+    // TO DO : Uncheck 
+    //    OnMenuWindowsCheck( wxCommandEvent& event, wxWindow* w);
   }
   //================================================================  
 
index c62aeab453b5a734d4bbdbb67d2aed33b8f2695d..1a8e7a143d6b4cfd2e19f5984a57f3f803d493b1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIScriptingInterface.h,v $
   Language:  C++
-  Date:      $Date: 2008/09/10 07:25:23 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2008/09/10 09:25:19 $
+  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
@@ -61,7 +61,7 @@ namespace bbtk
                                              public WxGUIHtmlBrowserUser
   {
   public:
-    WxGUIScriptingInterface( wxWindow *parent, wxString title, wxSize size);
+    WxGUIScriptingInterface( wxWindow *parent );
     ~WxGUIScriptingInterface();
 
     /// Returns the Interpreter used