X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fsrc%2FbbtkWxBlackBox.cxx;h=1050f0441871d305191f6b8d25bec281fa3237a1;hb=e6b2de923e0e69c303c7d18fb8a5c1970541bb3a;hp=be78a7ec853e3ef2197eee8218b4d9a80d4e7ae8;hpb=5934ccb7ca0fabdbe6c1907b2aea3696e19a0251;p=bbtk.git diff --git a/kernel/src/bbtkWxBlackBox.cxx b/kernel/src/bbtkWxBlackBox.cxx index be78a7e..1050f04 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/04/22 14:30:25 $ - Version: $Revision: 1.14 $ + Date: $Date: 2008/07/25 07:44:12 $ + Version: $Revision: 1.26 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -55,8 +55,6 @@ namespace bbtk mBox.lock()->bbGetFullName()<<")"<bbSetWindow(this); Wx::IncNbWindowsAlive(); - bbtkDebugMessage("wx",5," -> Number of windows alive = " - <bbSetWindow(0); } - else - { - } - bbtkDebugMessage("wx",5," -> Number of windows alive = " - < Number of windows shown = " - < Number of windows shown = " - <bbGetFullName()<<","<bbGetFullName()<<"]"<bbGetFullName()<<","<bbGetFullName()<<")"<bbUserOnShow(); - // wxFrame::SetFocus(); } //========================================================================= @@ -244,6 +255,13 @@ namespace bbtk } //========================================================================= + //========================================================================= + void WxBlackBoxFrame::bbClose() + { + bbtkDebugMessage("wx",9,"WxBlackBoxFrame::bbClose()"< WxBlackBox::bbExecute() [" <second->GetConnectionVector().size() != 0 ) { - bbtkDebugMessage("Process",2, + bbtkDebugMessage("process",3, "-> Output 'Widget' connected : transfering execution to parent" < WxBlackBox::bbBackwardUpdate(" - <<(caller?caller->GetFullName():"0")<<") [" - < WxBlackBox::bbBackwardUpdate(" + <<(caller?caller->GetFullName():"0")<<") [" + <GetFullName():"0")<<") [" + <second->GetConnectionVector().size() != 0 ) + + { + BlackBox::Pointer to = + i->second->GetConnectionVector()[0]->GetBlackBoxTo(); + + if (caller) + { + bbtkDebugMessage("process",3, + "-> Output 'Widget' connected to '" + <bbGetFullName()<<"' - caller->to = '" + <GetBlackBoxTo()->bbGetFullName() + <<"'" + < Output 'Widget' connected to '" + <bbGetFullName()<<"'" + <GetBlackBoxTo() != to))&& + (!bbGetUpdateTransferedToParent())&& + (to->bbGetStatus()!=UPDATING)) + { + bbtkDebugMessage("process",3, + " ... Transfering update order to parent" + <second->GetConnectionVector().front() //.lock() + ->GetBlackBoxTo()->bbExecute(false); + } + else + { + bbSetUpdateTransferedToParent(false); + bbtkDebugMessage("process",3, + " ... No need to transfer to parent" + <GetBlackBoxFromOutput()!="Widget")) ) { - BlackBox::OutputConnectorMapType::const_iterator i - = bbGetOutputConnectorMap().find("Widget") ; - if ( i->second->GetConnectionVector().size() != 0 ) - - { - bbtkDebugMessage("Process",2, - "-> Output 'Widget' connected : transfering update order to parent" - <second->GetConnectionVector().front() //.lock() - ->GetBlackBoxTo()->bbExecute(false); - } - } } + */ // call 'standard' BlackBox execution method if (!bbGetUpdateTransferedToParent()) { - AtomicBlackBox::bbBackwardUpdate(caller); + AtomicBlackBox::bbBackwardUpdate(caller); } - bbtkDebugMessageDec("Process",1, + bbtkDebugMessageDec("process",3, "<= WxBlackBox::bbBackwardUpdate() [" <bbUserCreateWidget(); this->bbUserProcess(); bbShowWindow(); + // this->bbUserOnShow(); } //========================================================================= @@ -486,7 +549,7 @@ namespace bbtk /// (called after bbProcess during bbExecute) void WxBlackBox::bbShowWindow() { - bbtkDebugMessageInc("Process",1,"=> WxBlackBox::bbShowWindow() [" + bbtkDebugMessageInc("wx",1,"=> WxBlackBox::bbShowWindow() [" < No widget event handler : creating one" <(), @@ -503,7 +566,7 @@ namespace bbtk else if ( ! bbGetWidgetEventHandler()->IsHandlerOf ( bbGetOutputWidget() ) ) { - bbtkDebugMessage("Process",3, + bbtkDebugMessage("wx",3, "-> Obsolete widget event handler : re-creating one" <GetConnectionVector().size() != 0 ) { - bbtkDebugMessage("Process",2, + bbtkDebugMessage("wx",2, "-> Output 'Widget' connected : nothing to do" < Window already exists" < Widget exists : creating the window" <(), @@ -559,7 +621,7 @@ namespace bbtk // Input WinDialog set to false : creating a Frame else { - bbtkDebugMessage("Process",2, + bbtkDebugMessage("process",2, " Input WinDialog set to false : creating a Frame" <(), @@ -585,13 +647,13 @@ namespace bbtk } else { - bbtkDebugMessage("Process",2,"-> Already shown : nothing to do"< Already shown : nothing to do"< WxBlackBox::bbHideWindow() [" + bbtkDebugMessageInc("wx",1,"=> WxBlackBox::bbHideWindow() [" <bbHide(); - bbtkDebugMessageDec("Process",1,"<= WxBlackBox::bbHideWindow() [" + bbtkDebugMessageDec("wx",1,"<= WxBlackBox::bbHideWindow() [" < WxBlackBox::bbCloseWindow() [" + <bbClose(); + + bbtkDebugMessageDec("wx",1,"<= WxBlackBox::bbCloseWindow() [" + <