From: Eduardo DAVILA Date: Tue, 10 Sep 2019 14:44:41 +0000 (+0200) Subject: #3299 BBTK Bug New Normal wt4 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=ce4491d66577c9daf930cb8744e738e4b7220fe7;p=bbtk.git #3299 BBTK Bug New Normal wt4 --- diff --git a/kernel/src/bbtkWidgetBlackBox.txx b/kernel/src/bbtkWidgetBlackBox.txx index 0c2a7a1..0a22554 100644 --- a/kernel/src/bbtkWidgetBlackBox.txx +++ b/kernel/src/bbtkWidgetBlackBox.txx @@ -195,23 +195,21 @@ namespace bbtk // If input is connected BlackBoxInputConnector* c = bbGetInputConnectorMap().find(in)->second ; if ( c->IsConnected() ) - { - // Get black box from - BlackBox::Pointer from = - c->GetConnection()->GetBlackBoxFrom(); - // Cast it into a WidgetBlackBox - typename WidgetBlackBox::Pointer wfrom - = boost::dynamic_pointer_cast >(from); - // If the black box from construction is not done yet : do it - // If not constructed do it - wfrom->bbInitializeProcessing(); - // Call bbUserCreateWidget - wfrom->bbUserCreateWidget(parent); - // Get the widget created - w = wfrom->bbGetOutputWidget(); - // Insert the box into the NestedWidgetBoxes list - bbmNestedWidgetBoxes.push_back(from); - } + { + // Get black box from + BlackBox::Pointer from = c->GetConnection()->GetBlackBoxFrom(); + // Cast it into a WidgetBlackBox + typename WidgetBlackBox::Pointer wfrom = boost::dynamic_pointer_cast >(from); + // If the black box from construction is not done yet : do it + // If not constructed do it + wfrom->bbInitializeProcessing(); + // Call bbUserCreateWidget + wfrom->bbUserCreateWidget(parent); + // Get the widget created + w = wfrom->bbGetOutputWidget(); + // Insert the box into the NestedWidgetBoxes list + bbmNestedWidgetBoxes.push_back(from); + } // if IsConnected return w; } //================================================================== diff --git a/kernel/src/bbtkWtBlackBox.cxx b/kernel/src/bbtkWtBlackBox.cxx index 01a91be..70d8ff0 100644 --- a/kernel/src/bbtkWtBlackBox.cxx +++ b/kernel/src/bbtkWtBlackBox.cxx @@ -200,7 +200,7 @@ printf("EED (WT) WtWFrame warnning 2019 B parent ?? \n"); printf("EED (WT) createApplication warnning 2019 \n"); //EED2019-08-20 // return new WtWFrame(env); - std::make_unique(env); + return std::make_unique(env); } @@ -317,9 +317,8 @@ printf("EED (WT) createApplication warnning 2019 \n"); //========================================================================= void WtBlackBox::bbUserInitializeProcessing() { - } - //================================================================http://intranet-if.insa-lyon.fr/temps/5IF39.html== + //================================================================== //========================================================================= void WtBlackBox::bbUserFinalizeProcessing() @@ -335,7 +334,7 @@ printf("EED (WT) createApplication warnning 2019 \n"); void WtBlackBox::bbCreateDialogWindow() { bbtkBlackBoxDebugMessage("widget",3, - "==> WtBlackBox::bbCreateDialogWindow() - No Dialog must be created, it is a web app" + "==> WtBlackBox::bbCreateDialogWindow() - No Dialog must be created, it is a web app" < WtBlackBox::bbCreateFrameWindow() - parent = " <(); @@ -377,7 +374,6 @@ char *argv[2] = {"./bbiWeb.wt","client"}; int argc=2; */ - /* if(Wt::WServer::instance()->isRunning()) { std::cout<<"Checking the existence of a Server deployed -DELETE THIS MESSAGE bbtkWTBlackBox.cxx"< WtBlackBox::bbSetWindow("< WtBlackBox::bbShowWindow()" - <ShowModal(); - } - else - { - // There is not such a thing like show becouse it is a webapp - // bbGetWindow()->Show(); - // WWt::CreateWtAppIfNeeded(); - - - Wt::WRun(WtBlackBox::wtServerData::argc, - WtBlackBox::wtServerData::argv, - &createApplication); - - - bbSetShown(true); - } - } + { + bbtkBlackBoxDebugMessage("widget",3,"==> WtBlackBox::bbShowWindow()" + <ShowModal(); + } else { + // There is not such a thing like show becouse it is a webapp + // bbGetWindow()->Show(); + // WWt::CreateWtAppIfNeeded(); + Wt::WRun(WtBlackBox::wtServerData::argc, + WtBlackBox::wtServerData::argv, + &createApplication); + bbSetShown(true); + } // if Dialog + } // if Window Show } //================================================================== @@ -449,18 +433,17 @@ int argc=2; { bbtkBlackBoxDebugMessage("widget",3,"==> WtBlackBox::bbDestroyWindow("<Close(true); - // - delete bbGetWindow(); - bbSetShown(false); - } + { + // wxWindow* w = bbGetWindow(); + //bbSetWindow(0); + // WE SHOULD DESTROY THE WINDOW WITH THE Close METHOD + // HOWEVER I + //w->Close(true); + // + delete bbGetWindow(); + bbSetShown(false); + } bbtkBlackBoxDebugMessage("widget",3,"<== WtBlackBox::bbDestroyWindow("< { - - - - - public: BBTK_BLACK_BOX_INTERFACE(WtBlackBox,bbtk::WidgetBlackBox); - - + // protected: - public: - struct wtServerData { - /*std::string docRoot; - std::string port; - std::string address; + /* + std::string docRoot; + std::string port; + std::string address; */ - static std::string docRoot ; - static std::string port ; - static std::string address ; + static std::string docRoot ; + static std::string port ; + static std::string address ; - static int argc; - static char **argv; + static int argc; + static char **argv; }; /* static std::string* jScript; @@ -125,7 +110,6 @@ namespace bbtk // Wt::WApplication *createApplication(const Wt::WEnvironment& env); //================================================================== - //================================================================== virtual void bbShowWindow(); //================================================================== @@ -138,14 +122,11 @@ namespace bbtk void bbwtProcess(); private: - - Wt::WApplication* bbApp; - Wt::WContainerWidget* bbmWindow; - + Wt::WApplication *bbApp; + Wt::WContainerWidget *bbmWindow; }; //================================================================= - //================================================================= // WxBlackBoxDescriptor declaration class WtBlackBoxDescriptor : public WidgetBlackBoxDescriptor