From 555854b9edeeb49fdd03fad2b1274e6d6db6d9f7 Mon Sep 17 00:00:00 2001 From: guigues Date: Tue, 22 Jan 2008 15:41:34 +0000 Subject: [PATCH] *** empty log message *** --- kernel/src/bbtkUserBlackBox.h | 29 ++++++-------- kernel/src/bbtkUserBlackBoxMacros.h | 12 +++--- kernel/src/bbtkWxBlackBox.cxx | 6 +-- kernel/src/bbtkWxBlackBox.h | 60 +++++++++++++++-------------- packages/wx/src/bbwxSlider.cxx | 36 ++++++++--------- packages/wx/src/bbwxSlider.h | 9 ++--- packages/wx/src/bbwxSplit.cxx | 55 +++++++++++++------------- packages/wx/src/bbwxSplit.h | 8 ++-- 8 files changed, 105 insertions(+), 110 deletions(-) diff --git a/kernel/src/bbtkUserBlackBox.h b/kernel/src/bbtkUserBlackBox.h index a716cc6..900fc08 100644 --- a/kernel/src/bbtkUserBlackBox.h +++ b/kernel/src/bbtkUserBlackBox.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkUserBlackBox.h,v $ Language: C++ - Date: $Date: 2008/01/22 15:02:00 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/01/22 15:41:34 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -83,31 +83,26 @@ namespace bbtk /// First checks that re-processing is needed (either Status==MODIFIED or InputProcessMode==Always) /// then : /// - updates its inputs by calling bbUpdateInputs (which recursively calls bbBackwardUpdate on amont boxes) - /// - calls bbCreateWidget - /// - calls bbProcess which is the user callback which does the actual processing - /// - calls bbUpdateChildren - /// - calls bbShowWidget which shows the widget associated to the box (if any) + /// - calls bbProcess which here simply calls the user callback bbUserProcess which does the actual processing. + /// bbProcess is overloaded in WxBlackBox to handle widget creation and show IOStatus bbBackwardUpdate(Connection* caller); //================================================================== //================================================================== - /// Recursive pipeline processing in forward direction along "Child"-"Parent" connections - /// - /// First checks that re-processing is needed (either Status==MODIFIED or InputProcessMode==Always) - /// then : - /// - calls bbCreateWidget - /// - calls bbProcess which is the user callback which does the actual processing - /// - calls bbUpdateChildren which recursively calls bbForwardUpdate on connections attached the "Child" output - // void bbForwardUpdate(Connection* caller); - //================================================================== protected: + //================================================================== + /// Calls the user defined processing method. + /// Overloaded in WxBlackBox to handle widget creation and show + virtual void bbProcess() { this->bbUserProcess(); } + //================================================================== + //================================================================== /// User callback which computes the outputs as a function of the inputs. /// It is assumed to be deterministic and thus is only called is the inputs have changed /// (i.e. if the black box is marked as modified) - virtual void bbProcess() + virtual void bbUserProcess() { - bbtkWarning("UserBlackBox::bbProcess() not overloaded for box '" + bbtkWarning("UserBlackBox::bbUserProcess() not overloaded for box '" < "< "< WxBlackBox::bbShowWindow() [" <bbUserCreateWidget(); + this->bbUserProcess(); + bbShowWindow(); + } + //================================================================== //================================================================== /// Specific methods for windows creation during pipeline execution - //void bbCreateWindow(); - void bbShowWindow(Connection* caller); + void bbShowWindow(); void bbHideWindow(); //================================================================== - void Process() { } - private: /// friendship friend class WxBlackBoxWindow; @@ -181,6 +170,21 @@ namespace bbtk //================================================================= + //====================================================================== + /// Defines the bbUserCreateWidget method +#define BBTK_CREATE_WIDGET(CALLBACK) \ + public: \ + inline void bbUserCreateWidget() \ + { \ + bbtkDebugMessageInc("Process",1,"=> "<SetInitialSize(wxSize(100,100)); - // int sz = (int)(GetParent()->GetSize().GetHeight() * prop * 0.01); - w1->Reparent(w); - w2->Reparent(w); - w->SplitHorizontally( w1, w2, 100); - //w->SetMinimumPaneSize(100); - // w->SetAutoLayout(true); - // w->Fit(); - // w->Layout(); - - - bbSetOutputWidget( w ); - } + void Split::CreateWidget() + { + wxSplitterWindow* w = new wxSplitterWindow(bbGetWxParent(), + -1, + wxDefaultPosition, + wxDefaultSize, + //wxSize(400,200), + wxSP_3D | + wxSP_LIVE_UPDATE ); + wxWindow* w1 = bbGetInputWidget1(); + wxWindow* w2 = bbGetInputWidget2(); + //w->SetInitialSize(wxSize(100,100)); + // int sz = (int)(GetParent()->GetSize().GetHeight() * prop * 0.01); + w1->Reparent(w); + w2->Reparent(w); + w->SplitHorizontally( w1, w2, 100); + //w->SetMinimumPaneSize(100); + // w->SetAutoLayout(true); + // w->Fit(); + // w->Layout(); + + + bbSetOutputWidget( w ); } diff --git a/packages/wx/src/bbwxSplit.h b/packages/wx/src/bbwxSplit.h index ded5330..ba7744f 100644 --- a/packages/wx/src/bbwxSplit.h +++ b/packages/wx/src/bbwxSplit.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbwxSplit.h,v $ Language: C++ - Date: $Date: 2008/01/22 15:02:00 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/01/22 15:41:35 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -86,10 +86,10 @@ namespace bbwx BBTK_DECLARE_INPUT(Orientation,int); BBTK_DECLARE_INPUT(Proportion,int); BBTK_PROCESS(Process); - // BBTK_CREATE_WIDGET(CreateWidget); + BBTK_CREATE_WIDGET(CreateWidget); void Process(); - // void CreateWidget(); + void CreateWidget(); protected: virtual void bbUserConstructor(); -- 2.45.1