]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Thu, 24 Jul 2008 14:37:04 +0000 (14:37 +0000)
committerguigues <guigues>
Thu, 24 Jul 2008 14:37:04 +0000 (14:37 +0000)
19 files changed:
kernel/appli/CMakeLists.txt
kernel/doc/bbtkWebSite/bbtk-make-index.sh.in
kernel/src/bbtkBlackBox.cxx
kernel/src/bbtkComplexBlackBox.cxx
kernel/src/bbtkMessageManager.h
kernel/src/bbtkObject.cxx
kernel/src/bbtkObject.h
kernel/src/bbtkPackage.h
kernel/src/bbtkSystem.h
kernel/src/bbtkWx.cxx
kernel/src/bbtkWx.h
kernel/src/bbtkWxBlackBox.cxx
kernel/src/bbtkWxBlackBox.h
kernel/src/bbtkWxGUIConsole.cxx
kernel/src/bbtkWxGUIScriptingInterface.cxx
kernel/src/bbtkWxGUITextEditor.cxx
packages/std/src/bbstdExecSystemCommand.cxx
packages/wx/src/bbwxDirectorySelector.cxx
packages/wx/src/bbwxFileSelector.cxx

index f2e4ae10f99cd846d6963ca54c433d98ba18bc36..4b2878ff88791c31eb04d3f8922c05df4f55aa32 100644 (file)
@@ -6,6 +6,7 @@ ENDIF(WIN32)
 
 # The BlackBox Interpreter
 SUBDIRS(bbi)
+SUBDIRS(bbI)
 
 # Black box code generator from xml
 SUBDIRS(bbfy)
index 6028095823be7c7edfb0148e0fc105998268acb0..8674fd17ce4974f0613ed3bdf73539eda5057e0e 100755 (executable)
@@ -12,7 +12,7 @@ BIN=$(echo ${TMP#*/}|rev)
 echo "> cd ${BIN}/../@BBTK_BBDOC_REL_PATH@"
 cd ${BIN}/../@BBTK_BBDOC_REL_PATH@
 
-echo "> ${BIN}/bbi ./make-index"
-${BIN}/bbi ./make-index
+echo "> ${BIN}/bbi -N -q ./make-index"
+${BIN}/bbi -N -q ./make-index
 
 echo "** Done ! **"
index b651c09dbe4e93e01918a174bc4b4861b38a8a30..49321eed2d2d639e78cab3a8f556c90ae39f0d37 100644 (file)
@@ -3,8 +3,8 @@
 Program:   bbtk
 Module:    $RCSfile: bbtkBlackBox.cxx,v $
 Language:  C++
-Date:      $Date: 2008/07/23 11:46:10 $
-Version:   $Revision: 1.22 $
+Date:      $Date: 2008/07/24 14:37:05 $
+Version:   $Revision: 1.23 $
                                                                                 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
 l'Image). All rights reserved. See doc/license.txt or
@@ -147,8 +147,7 @@ namespace bbtk
                        "=> BlackBox::bbExecute() ["
                        <<bbGetFullName()<<"]"<<std::endl);
  
-       wxBusyCursor wait;
-    //EED Wx::BeginBusyCursor();
+    Wx::BusyCursor wait;
 
     // If execution frozen : return
     if (bbGlobalGetFreezeExecution()) 
@@ -163,8 +162,6 @@ namespace bbtk
     // Calls the main recursive update method 
     bbBackwardUpdate(Connection::Pointer());
 
-    //EED Wx::EndBusyCursor();
-
     bbtkDebugMessageDec("process",2,
                        "<= BlackBox::bbExecute() ["
                        <<bbGetFullName()<<"]"<<std::endl);
index f692435687233e6a03f5e17e4d707929ef96f449..f47e401248fdf3c0c5bd7fec30479eec353721a1 100644 (file)
@@ -3,8 +3,8 @@
 Program:   bbtk
 Module:    $RCSfile: bbtkComplexBlackBox.cxx,v $
 Language:  C++
-Date:      $Date: 2008/04/24 11:49:59 $
-Version:   $Revision: 1.19 $
+Date:      $Date: 2008/07/24 14:37:05 $
+Version:   $Revision: 1.20 $
                                                                                 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
 l'Image). All rights reserved. See Doc/License.txt or
@@ -22,6 +22,7 @@ PURPOSE.  See the above copyright notices for more information.
  *  \brief class bbtk::ComplexBlackBox : user defined complex black boxes
  */
 #include "bbtkComplexBlackBox.h"
+#include "bbtkWx.h"
 #include "bbtkBlackBoxDescriptor.h"
 #include "bbtkFactory.h"
 #include "bbtkConfigurationFile.h"
@@ -240,7 +241,7 @@ namespace bbtk
                        <<bbGetFullName()<<"]"<<std::endl);
 
 
-    Wx::BeginBusyCursor();
+    Wx::BusyCursor wait;
     
     if (mExecutionList.size() != 0) 
       {
@@ -263,9 +264,6 @@ namespace bbtk
          }
       } 
 
-    Wx::EndBusyCursor();
-    
-    
   }
   //==================================================================
 
index 496a2258f8bf8538fc1c5a887ca83e9f385fb111..b2e4e4dd27229918d27a9d56e9a372505e93d71b 100644 (file)
 
 //===========================================================
 #ifdef BBTK_COMPILE_ERROR_MESSAGES
-#include "bbtkWx.h"
+//#include "bbtkWx.h"
 #define bbtkError(MESSAGE)                             \
   do                                                   \
     {                                                  \
-      bbtk::Wx::ResetCursor();                         \
       std::ostringstream s;                            \
       s << MESSAGE;                                    \
       std::ostringstream f;                            \
index 304fa1de856e68e465d65fcc1f4f4ef93bed0986..fa41efee9eaa5510b8976e12a797982fe04b3582 100644 (file)
@@ -1,5 +1,6 @@
 #include "bbtkObject.h"
 #include "bbtkMessageManager.h"
+#include "bbtkPackage.h"
 
 namespace bbtk
 { 
@@ -7,6 +8,7 @@ namespace bbtk
 
   //=======================================================================
   Object::ObjectListType Object::mgObjectList;
+  Object::ObjectListType Object::mgPackageList;
   //=======================================================================
 
   //=======================================================================
@@ -32,6 +34,16 @@ namespace bbtk
   }
   //=======================================================================
 
+  //=======================================================================
+  void Object::InsertInPackageList(Pointer p)
+  { 
+    bbtkDebugMessage("object",9,"##> Object::InsertInPackageList(\""
+                    <<p->GetObjectName()<<"\" ["<<p<<"])"<<std::endl);
+    boost::weak_ptr<Object> w(p);
+    mgPackageList.insert(w); 
+  }
+  //=======================================================================
+
 
   //=======================================================================
   void Object::RemoveFromObjectList(WeakPointer p)
@@ -164,8 +176,34 @@ namespace bbtk
 
 
 
+  void Object::ReleasePackages()
+  {
+    bbtkDebugMessage("object",1,"##> Object::ReleasePackages()"<<std::endl);
+    // Release package pointers
+    ObjectListType::iterator i;
+    for (i = mgPackageList.begin();
+        i!= mgPackageList.end();
+        ++i)
+      {
+       if (i->use_count() != 0) 
+         { 
+           //      Object::Pointer p(i->lock());
+           Package::WeakPointer w(i->lock()->GetThisPointer<Package>());
+           Package::Release(w);
+           /*
+           if (p->GetObjectName().find(name) != std::string::npos ) 
+             {
+               std::cout << n << "/" << mgObjectList.size() << " ";
+               PrintObjectInfo(p);
+               m += p->GetObjectSize();
+               n++;
+             }
+           */
+         }
+      }  
 
-
+  }
+  
 
 
 
@@ -180,6 +218,8 @@ namespace bbtk
   //=======================================================================
   StaticInitTime::~StaticInitTime()
   {
+    Object::ReleasePackages();
+
     if (PrintObjectListInfo) 
       {
        std::cout << std::endl
index 089afbb7cf3a8dbde49af644293144012194bfa4..2d8eb5e91c022e022ac322dc1f8e0943238d3690 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkObject.h,v $
   Language:  C++
-  Date:      $Date: 2008/07/23 11:46:11 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2008/07/24 14:37:05 $
+  Version:   $Revision: 1.6 $
                                                                                 
   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,9 @@ namespace bbtk
     static void InsertInObjectList(Pointer);
     static void RemoveFromObjectList(WeakPointer);
 
+    static void InsertInPackageList(Pointer);
+    static void ReleasePackages();
+
     static void PrintObjectListInfo(const std::string& name);
     //    static void PrintObjectInfo(const std::string& name);
     static void PrintObjectInfo(const Pointer& o); 
@@ -120,6 +123,7 @@ namespace bbtk
   private:
     typedef std::set<boost::weak_ptr<Object> > ObjectListType;
     static ObjectListType mgObjectList;
+    static ObjectListType mgPackageList;
     WeakPointer mThisPointer;                                          
     Pointer mThisPointerLocked;                                                
 
@@ -190,7 +194,7 @@ protected:                                                          \
 
     static bool PrintObjectListInfo;
   private:
-         static bbtk::Object mObject;
+    static bbtk::Object mObject;
   };
   
   
index 5dccf50a719ee49f2a5ccde064d34c375b70bb64..78d98cc0311ab2d3ec3c32618bfc90710082958f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkPackage.h,v $
   Language:  C++
-  Date:      $Date: 2008/05/21 12:50:11 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2008/07/24 14:37:05 $
+  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
@@ -330,6 +330,7 @@ namespace bbtk
                             VERSION,                                   \
                             BBTK_STRINGIFY_SYMBOL(BBTK_VERSION)        \
                             );                                         \
+      bbtk::Object::InsertInPackageList( NAME ## GetPackagePointer() ); \
       return NAME ## GetPackagePointer();                              \
     }                                                                  \
     BBTK_PACKAGE_EXPORT const std::string&                             \
index f9f22ebb87e45763dc3e3cca1d09aaf82b23490e..e1857d18b27d23499de1df0c723d1fb2b98cb6ca 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkSystem.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/23 08:34:06 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/07/24 14:37:05 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 // ----------------------------------------------------------------------------
 // wx headers
 // ----------------------------------------------------------------------------
-#include "bbtkWx.h"
+//#include "bbtkWx.h"
 
 /*
 #ifdef _USE_WXWIDGETS_
index aa05db7b0633e969f12352490573b3335a180011..ec1327fb8c1b4f3da3f178413e24eb953fc5e8c2 100644 (file)
 
 #include "bbtkWx.h"
 #include "bbtkMessageManager.h"
-#include <boost/signal.hpp>
-//#include <boost/bind.hpp>
 
 namespace bbtk
 {
+  //=========================================================================
+  class WxApp;
+  //=========================================================================
 
+  //=========================================================================
+  static WxApp* mgWxApp = 0;
   static wxWindow* mgTopWindow = 0;
+  static wxWindow* mgTopWindowParent = 0;
+  static bool mgAutoDestroyTopWindow = true;
   static int mgNbWindowsAlive  = 0;
   static int mgNbWindowsShown  = 0;
-  static bool mgAutoDestroyTopWindow = true;
+  //=========================================================================
 
+  //=========================================================================
   // BBTKWXSIG
   static Wx::Signal_type mgWxSignal;
   // \BBTKWXSIG
+  //=========================================================================
 
+  //=========================================================================
+  // The wxApp class which is used when no user wxApp was created
+  class WxApp : public wxApp
+  {
+  public:
+    bool OnInit( );
+    int  OnExit() { return true; }
+  };
+  //=========================================================================
+  IMPLEMENT_APP_NO_MAIN(WxApp);
+  //=========================================================================
+  bool WxApp::OnInit( )
+  {     
+    wxApp::OnInit();
+#ifdef __WXGTK__
+    //See http://www.wxwindows.org/faqgtk.htm#locale
+    setlocale(LC_NUMERIC, "C");
+#endif
+    return true;
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void Wx::CreateWxAppIfNeeded()
+  {
+    if (wxApp::GetInstance()==0)
+      {
+       if (mgWxApp != 0) 
+         {
+           bbtkGlobalError("Wx::CreateWxAppIfNeeded() : INTERNAL ERROR ! (wxApp::GetInstance()==0) && (mgWxApp != 0)");
+         }
+       bbtkDebugMessage("wx",1,"  --> Creating bbtk wxApp"<<std::endl);
+       mgWxApp = new WxApp;
+       wxApp::SetInstance(mgWxApp);
+       wxInitialize();
+      } 
+  }
+  //=========================================================================
 
   //=========================================================================
-  void Wx::CreateTopWindow(wxWindow* parent, bool autodestroy)
+  void Wx::DestroyWxAppIfNeeded()
   {
+    if (mgWxApp!= 0) 
+      {
+       bbtkDebugMessage("wx",1,"  --> Destructing bbtk WxApp"<<std::endl);
+       //delete mgWxApp;
+       //      mgWxApp = 0;
+       // Uninit wx
+       //      wxUninitialize();
+      }
+  }
+  //=========================================================================
+
+  //=========================================================================  
+  void Wx::SetTopWindowParent(wxWindow* w)
+  {
+    if (mgTopWindowParent != 0)
+      {
+       bbtkGlobalError("Wx::SetTopWindowParent : top window parent != 0");
+      }
+    mgTopWindowParent = w;
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void Wx::CreateTopWindowIfNeeded()
+  {
+    if (mgTopWindow!=0) return;
+    bbtkDebugMessage("wx",1,"  --> Creating bbtk top window"<<std::endl);
+
+    CreateWxAppIfNeeded();
+
     wxWindow* top = 
-      new wxFrame(parent,
+      new wxFrame(mgTopWindowParent,
                  -1,
                  _T("TOP BBTK FRAME (YOU SHOULD NOT SEE ME !!)"));
     top->Hide();
+
     Wx::SetTopWindow(top);
-    mgAutoDestroyTopWindow = autodestroy;
   }
   //=========================================================================
-  
+
+  //=========================================================================
+  void Wx::DestroyTopWindowIfNeeded()
+  {
+    if ( (mgNbWindowsAlive==0) && 
+        (mgAutoDestroyTopWindow) )
+      {
+       bbtkDebugMessage("wx",1,"  --> Destructing bbtk top window"<<std::endl);
+       mgTopWindow->Close();
+       mgTopWindow = 0;
+       
+       DestroyWxAppIfNeeded();
+      }
+  } 
+  //=========================================================================
+
+  //=========================================================================
+  void Wx::LoopUntilAllWindowsClose()
+  {
+    int i = 0;
+    while (mgTopWindow != 0)
+      {
+       if (i % 100 == 0) 
+         {
+           bbtkDebugMessage("wx",2,"Wx::Loop "<<i << std::endl);
+         }
+       i++;
+       wxMilliSleep(10);
+
+      }
+  }
+  //=========================================================================
+
   //=========================================================================
   wxWindow* Wx::GetTopWindow() 
   { 
-    if (mgTopWindow==0) Wx::CreateTopWindow(0);
+    Wx::CreateTopWindowIfNeeded();
     return mgTopWindow; 
   }
   //=========================================================================
@@ -56,7 +164,7 @@ namespace bbtk
   // \BBTKWXSIG
 
   //=========================================================================
-  void Wx::AutoDestroyTopWindow(bool b)
+  void Wx::SetAutoDestroyTopWindow(bool b)
   {
     mgAutoDestroyTopWindow = b;
   }
@@ -92,14 +200,9 @@ namespace bbtk
     mgNbWindowsAlive--; 
     bbtkDebugMessage("wx",2,"* Number of windows alive = "<<mgNbWindowsAlive
                     <<std::endl);
-    if ( (mgNbWindowsAlive==0) && 
-        (mgAutoDestroyTopWindow) )
-      {
-    bbtkDebugMessage("wx",2,"  --> Destructing top window"<<std::endl);
-       mgTopWindow->Close();
-       mgTopWindow = 0;
-      }
-    // BBTKWXSIG
+
+    DestroyTopWindowIfNeeded();
+     // BBTKWXSIG
     mgWxSignal();
     // \BBTKWXSIG
   }
@@ -123,13 +226,9 @@ namespace bbtk
     mgNbWindowsShown--; 
     bbtkDebugMessage("wx",2,"* Number of windows shown = "<<mgNbWindowsShown
                     <<std::endl);
-    if ( (mgNbWindowsAlive==0) && 
-        (mgAutoDestroyTopWindow) )
-      {
-       bbtkDebugMessage("wx",2,"  --> Destructing top window"<<std::endl);
-       mgTopWindow->Close();
-       mgTopWindow = 0;
-      }
+
+    DestroyTopWindowIfNeeded();
+
     // BBTKWXSIG
     mgWxSignal();
     // \BBTKWXSIG
@@ -166,6 +265,29 @@ namespace bbtk
   }
   //=========================================================================
   
+
+  //=========================================================================
+  Wx::BusyCursor::BusyCursor()
+  {
+    if (TopWindowExists()) 
+      {        
+       bbtkDebugMessage("wx",2,
+                        "Wx::BusyCursor::BusyCursor()"<<std::endl);
+       ::wxBeginBusyCursor(); 
+    }
+  }
+  Wx::BusyCursor::~BusyCursor()
+  {
+    if (TopWindowExists()) 
+      {        
+       bbtkDebugMessage("wx",2,
+                        "Wx::BusyCursor::~BusyCursor()"<<std::endl);
+       ::wxEndBusyCursor(); 
+      }
+  }
+  //=========================================================================
+
+  /*
   //=========================================================================
   void Wx::ResetCursor() 
   {
@@ -190,7 +312,7 @@ namespace bbtk
     ::wxEndBusyCursor();
   }
   //=========================================================================
-
+  */
 
 }
 
index 30c86f8ab7335c3a02ea5fcc1efa72217e322edb..d3f3318f86bd3a854ad93d266d743ebb3320e20a 100644 (file)
@@ -1,14 +1,7 @@
 #ifndef __bbtkWx_h_INCLUDED__
 #define __bbtkWx_h_INCLUDED__
 
-
-/*
-#ifdef wxUSE_STD_IOSTREAM
-#undef wxUSE_STD_IOSTREAM
-#endif
-#define wxUSE_STD_IOSTREAM 0
-*/
-
+//===========================================================================
 // Wx headers
 #ifdef _USE_WXWIDGETS_
 // For compilers that support precompilation, includes "wx/wx.h".
 #endif //__WXGTK__
 // EO Wx headers
 
+#else //_USE_WXWIDGETS_
+
+// define wxWindow
+typedef void wxWindow;
+
+#endif // EO _USE_WXWIDGETS_
+//===========================================================================
+
+//===========================================================================
 #include "bbtkSystem.h"
+//===========================================================================
 
+//===========================================================================
 // SIGNAL/SLOT MECHANISM 
 // FOR bbtk WINDOWS CREATION/DESTRUCTION OBSERVATION 
 // BBTKWXSIG
 #include <boost/signal.hpp>
 #include <boost/bind.hpp>
 // \BBTKWXSIG
+//===========================================================================
 
 namespace bbtk
 {
+
   //==================================================================
   /// Global wx handlers (cursor...)
   
@@ -57,17 +63,28 @@ namespace bbtk
     typedef Signal_type::slot_function_type Slot_function_type;
     // \BBTKWXSIG
 
+    /*
     static void ResetCursor();
     static void BeginBusyCursor(); 
     static void EndBusyCursor();
+    */
+
+    static void LoopUntilAllWindowsClose();
+
+    class BusyCursor
+    {
+    public:
+      BusyCursor();
+      ~BusyCursor();
+    };
+
+    static void SetTopWindowParent(wxWindow*);
+    static void SetAutoDestroyTopWindow(bool);
 
-    static void CreateTopWindow(wxWindow* parent=0, bool autodestroy=true);
     /// Returns the creation time parent of all bbtk windows 
     /// (window can be reparented after creation)
     static wxWindow* GetTopWindow();
     static bool TopWindowExists();
-
-    static void AutoDestroyTopWindow(bool);
     
     static void IncNbWindowsAlive();
     static void DecNbWindowsAlive();
@@ -82,7 +99,15 @@ namespace bbtk
     // BBTKWXSIG
     static void AddSignalObserver(Slot_function_type);
     // \BBTKWXSIG
+
   private:
+
+    static void CreateWxAppIfNeeded();
+    static void DestroyWxAppIfNeeded();
+
+    static void CreateTopWindowIfNeeded();
+    static void DestroyTopWindowIfNeeded();
+
     /// Sets the creation time parent of all bbtk windows
     static void SetTopWindow(wxWindow*);
   }; // struct Wx
@@ -90,6 +115,8 @@ namespace bbtk
   
 
 
+
+#ifdef _USE_WXWIDGETS_
   //==================================================================
   /// Conversion std::string to wxString 
   inline wxString std2wx(const std::string& s){
@@ -119,41 +146,10 @@ namespace bbtk
     return s2;
   }
   //==================================================================
-
+#endif // EO _USE_WXWIDGETS
 
   
 } // namespace bbtk
   
 
-
-#else // _USE_WXWIDGETS
-
-
-namespace bbtk
-{
-
-  struct BBTK_EXPORT Wx
-  {
-    static void ResetCursor() {}
-    static void BeginBusyCursor() {}
-    static void EndBusyCursor() {}
-    static void CreateInvisibleTopWindow() {}
-    static wxWindow* GetTopWindow() { return 0; }
-    static void SetTopWindow(wxWindow*) {}
-    static void IncNbWindowsAlive() {}
-    static void DecNbWindowsAlive() {}
-    static int  GetNbWindowsAlive() { return 0; }
-    static bool IsSomeWindowAlive() { return false; }
-    
-    static void IncNbWindowsShown() {}
-    static void DecNbWindowsShown() {}
-    static int  GetNbWindowsShown() { return 0; }
-    static bool IsSomeWindowShown() { return false; }
-  }; // struct Wx
-
-} // namespace bbtk
-  
-
-
-#endif // EO _USE_WXWIDGETS
 #endif // EO __bbtkWx_h_INCLUDED__
index 26256752a66b4cf04c2cda332edf13501b4505e5..de81d49f06a024211d05172e1e577ab6dd759ab1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/07/23 11:46:11 $
-  Version:   $Revision: 1.24 $
+  Date:      $Date: 2008/07/24 14:37:06 $
+  Version:   $Revision: 1.25 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -145,7 +145,7 @@ namespace bbtk
                     <<bbGetBlackBox()->bbGetFullName()<<"]"<<std::endl);
     WxBlackBoxWindow::bbShow();
     SetReturnCode( wxDialog::ShowModal() ); 
-    bbHide();
+    bbClose();
   }
   //=========================================================================
 
@@ -161,7 +161,8 @@ namespace bbtk
   //=========================================================================
   void WxBlackBoxDialog::bbClose()
   {
-    wxDialog::Close();
+    bbtkDebugMessage("wx",9,"WxBlackBoxDialog::bbClose()"<<std::endl);
+    wxDialog::Destroy();
   }
   //=========================================================================
 
@@ -255,6 +256,7 @@ namespace bbtk
   //=========================================================================
   void WxBlackBoxFrame::bbClose()
   {
+    bbtkDebugMessage("wx",9,"WxBlackBoxFrame::bbClose()"<<std::endl);
     wxFrame::Close();
   }
   //=========================================================================
index ddd35779880b48ef216d4b6c9a2c8d43f55f3890..095553d59b3023405e39e47016feb01dd4b704d7 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.h,v $
   Language:  C++
-  Date:      $Date: 2008/05/15 08:02:36 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2008/07/24 14:37:06 $
+  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
@@ -73,6 +73,10 @@ namespace bbtk
     BBTK_DECLARE_OUTPUT(Widget, wxWindow*);//WxBlackBoxWidget*);
 
   public:
+    /// Main processing method of the box. Overloaded to handle windows inclusion : if the output Widget is connected then the execution is transfered to the box to which it is connected (as the container window must be created and displayed - this box will be executed by the normal pipeline recursion mechanism)
+    virtual void bbExecute(bool force = false);
+
+
     typedef WxBlackBoxWindow Window;
     
     /// Returns the **OWN** window associated to the box
@@ -184,10 +188,10 @@ namespace bbtk
     void bbInitAttributes();
 
   protected :
-    /// Main processing method of the box. Overloaded to handle windows inclusion : if the output Widget is connected then the execution is transfered to the box to which it is connected (the container window must be created and displayed - this box will be also executed by the normal pipeline recursion mechanism)
-    virtual void bbExecute(bool force = false);
 
 
+    /// For Forward update mechanism when execution is called 
+    /// on a contained window
     /// Is set to true before transfering update to parent 
     /// in order to not re-transfer a second time...
     bool bbmUpdateTransferedToParent;
index e19fb0e8f97e1f55e28c0f3ffeab28f75e9f29b9..f17868c7756ce8b2184299ea14e46b894f83e34c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIConsole.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/06/19 09:46:41 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2008/07/24 14:37:06 $
+  Version:   $Revision: 1.14 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -153,8 +153,11 @@ namespace bbtk
     cmdsizer->Add (mWxGUICommand, 0, wxALL | wxGROW, 5);
 
         
-    // Creates the parent window of all bbtk windows as a child of this
-    Wx::CreateTopWindow(this,true);
+    // Set the parent window of all bbtk windows as a child of this
+    bbtk::Wx::SetTopWindowParent(this);
+    // Top Window Auto Destroys when no more black box window alive 
+    // : this is the default 
+    //    bbtk::Wx::SetAutoDestroyTopWindow(true);
     // Add the method OnWxSignal as a Wx::Signal observer 
     bbtkAddWxSignalObserver(WxGUIConsole::OnWxSignal);
 
@@ -412,7 +415,7 @@ namespace bbtk
   // Overloaded Show method to handle bbtk::Wx::TopWindow auto-destruction
   bool WxGUIConsole::Show(bool show)
   {
-    Wx::AutoDestroyTopWindow(!show);
+    bbtk::Wx::SetAutoDestroyTopWindow(!show);
     return wxFrame::Show(show);
   }
   //================================================================  
index 8a6ebfb17d9db41fe99340f809f351a58763f7af..da3d644b16e77d594b61158f3b80b15aeb8617c3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/07/23 11:46:11 $
-  Version:   $Revision: 1.14 $
+  Date:      $Date: 2008/07/24 14:37:06 $
+  Version:   $Revision: 1.15 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -216,8 +216,8 @@ namespace bbtk
     //    m_mgr.AddPane(mwxButtonRun,
     //           wxAuiPaneInfo().Name(wxT("button_run_content")));     
 
-    // Creates the parent window of all bbtk windows as a child of this
-    Wx::CreateTopWindow(this);
+    // parent window of all bbtk windows will be a child of this
+    Wx::SetTopWindowParent(this);
     // Add the method OnWxSignal as a Wx::Signal observer 
     //bbtkAddWxSignalObserver(WxGUIPackageBrowser2Window::OnWxSignal);
 
index 128f5301b4ff147d58e9de0414f42774a1cebac7..a2b99317655d70247758e771b4426b0d19aa1ea3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUITextEditor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/07/23 11:46:11 $
-  Version:   $Revision: 1.14 $
+  Date:      $Date: 2008/07/24 14:37:06 $
+  Version:   $Revision: 1.15 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -668,8 +668,8 @@ namespace bbtk
     
     SetSizer(sizer);
 
-    // Creates the parent window of all bbtk windows as a child of this
-    Wx::CreateTopWindow(this);
+    // parent window of all bbtk windows will be a child of this
+    Wx::SetTopWindowParent(this);
     // Add the method OnWxSignal as a Wx::Signal observer 
     //bbtkAddWxSignalObserver(WxGUITextEditorWindow::OnWxSignal);
     
index 883a8081e18f19975c3f1a2ce4102f6a29e0575f..1e8ee9e8c2d8bef4736b8ff4c554e08d5b943751 100755 (executable)
@@ -31,7 +31,7 @@ namespace bbstd
          {
            ccommand=bbGetInputIn().substr(pos1,pos2-pos1);
          }
-       for (int i=0 ; i < ccommand.length() ; i++)
+       for (unsigned int i=0 ; i < ccommand.length() ; i++)
          {
            if (ccommand[i]==39)
              {
index 4ac2edb66a92f153d3486bc50468aec9a758277c..680bf63cc5286cbde55ea6e4f5403e00429cf86f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxDirectorySelector.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:52 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/07/24 14:37:06 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -25,6 +25,7 @@
 
 
 #include "bbwxDirectorySelector.h"
+#include "bbtkWx.h"
 #include "bbwxPackage.h"
  
 #include <wx/dirdlg.h>
index 0c6c66ac57016dbf0f7fee72bc563ec9ca6d050c..033749cb6c304a1e46382b607f0d6fe69535c385 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxFileSelector.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/06/26 07:37:11 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2008/07/24 14:37:06 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -26,6 +26,7 @@
 
 #include "bbwxFileSelector.h"
 #include "bbwxPackage.h"
+#include "bbtkWx.h"
 
 #include <wx/filedlg.h>