From 35efff5ca9f485da0da66535dc3ce8fff49df520 Mon Sep 17 00:00:00 2001 From: guigues Date: Thu, 6 Mar 2008 09:23:43 +0000 Subject: [PATCH] Fix a big bug. Consider the script : new slider s new LayoutLine l connect s.Widget l.Widget1 exec s Before bug fix, created the slider in bbi Console !!! (note that 'exec l' instead of 'exec s' worked fine) Cause : When a WxBlackBox is 'included' into another (output 'Widget' connected) it does not create its own window (frame) but is inserted into the frame of the box to which it is connected. The wxWindows are all created with parent the wx top frame (bbGetWxParent) which is bbi's Console and are reparented after to be placed in the right frame (own or container)). Hence when 'l' was executed it was created in bbi's console (normal) but as 's' was not executed it did not created its frame and did not reparented l's window. Fix : executing a WxBlackBox whose output 'Widget' is connected must produce the execution of the box to which it is connected (remark that it works recursively). Hence overloaded bbExecute in WxBlackBox to do the job. --- kernel/src/bbtkWxBlackBox.cxx | 40 +++++++++++++++++++++++++++++++++-- kernel/src/bbtkWxBlackBox.h | 7 ++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/kernel/src/bbtkWxBlackBox.cxx b/kernel/src/bbtkWxBlackBox.cxx index 1cea747..06ec967 100644 --- a/kernel/src/bbtkWxBlackBox.cxx +++ b/kernel/src/bbtkWxBlackBox.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkWxBlackBox.cxx,v $ Language: C++ - Date: $Date: 2008/02/08 10:05:38 $ - Version: $Revision: 1.7 $ + Date: $Date: 2008/03/06 09:23:43 $ + Version: $Revision: 1.8 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -75,6 +75,7 @@ namespace bbtk } //========================================================================= + //========================================================================= void WxBlackBoxWindow::bbShow() { @@ -486,6 +487,41 @@ namespace bbtk } //========================================================================= + //========================================================================= + /// Main processing method of the box. + void WxBlackBox::bbExecute(bool force) + { + bbtkDebugMessageInc("Process",1, + "=> WxBlackBox::bbExecute() [" + <second->GetConnectionVector().size() != 0 ) + { + bbtkDebugMessage("Process",2, + "-> Output 'Widget' connected : transfering execution to parent" + <second->GetConnectionVector().front() + ->GetBlackBoxTo()->bbExecute(force); + + } + // else call 'standard' BlackBox execution method + else + { + BlackBox::bbExecute(force); + } + // + + bbtkDebugMessageDec("Process",1, + "<= WxBlackBox::bbExecute() [" + <