From cafa65e94cd2e632675648bc884ef18409b8021e Mon Sep 17 00:00:00 2001 From: Eduardo Enrique Davila Serrano Date: Wed, 5 Oct 2022 15:56:19 +0200 Subject: [PATCH] #3492 bug wxPopupMenu --- bbtk/bbs/appli/examplewxPopupMenu.bbg | 90 +++++++++++++++++++ bbtk/bbs/appli/examplewxPopupMenu.bbs | 61 +++++++++++++ .../bbcreaMaracasVisuShowNPoints_Tools.cxx | 1 + bbtk/src/bbcreaMaracasVisuwxPopupMenu.cxx | 18 ++-- bbtk/src/bbcreaMaracasVisuwxPopupMenu.h | 1 + 5 files changed, 161 insertions(+), 10 deletions(-) create mode 100644 bbtk/bbs/appli/examplewxPopupMenu.bbg create mode 100644 bbtk/bbs/appli/examplewxPopupMenu.bbs diff --git a/bbtk/bbs/appli/examplewxPopupMenu.bbg b/bbtk/bbs/appli/examplewxPopupMenu.bbg new file mode 100644 index 0000000..5dfe329 --- /dev/null +++ b/bbtk/bbs/appli/examplewxPopupMenu.bbg @@ -0,0 +1,90 @@ +# ---------------------------------- +# - BBTKGEditor v 1.5 BBG BlackBox Diagram file +# - C:\Users\davila\Creatis\C22\ct\cs\creaMaracasVisu\bbtk\bbs\appli\examplewxPopupMenu.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:7 +BOX +creaMaracasVisu:wxPopupMenu:Box00 +ISEXEC:FALSE +-18.882433:12.864957:-900.000000 +3.182567:10.364957:-900.000000 +PORT +In:"uno dos tres" +FIN_BOX +BOX +vtk:LoadHola:Box01 +ISEXEC:FALSE +-4.649292:34.721931:-900.000000 +16.900708:32.221931:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box02 +ISEXEC:FALSE +-10.798030:22.144542:-900.000000 +27.801970:19.644542:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box05 +ISEXEC:FALSE +-29.840857:-5.382578:-900.000000 +3.479143:-7.882578:-900.000000 +FIN_BOX +BOX +wx:OutputText:Box04 +ISEXEC:FALSE +-21.685583:2.681963:-900.000000 +-0.015583:0.181963:-900.000000 +FIN_BOX +BOX +creaVtk:OutputWindow:Box06 +ISEXEC:TRUE +-31.953669:-21.992093:-900.000000 +-9.898669:-24.492093:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box08 +ISEXEC:TRUE +-2.375453:-21.685583:-900.000000 +20.384547:-24.185583:-900.000000 +PORT +Orientation:"H" +FIN_BOX +CONNECTIONS:10 +CONNECTION +Box01:Out:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box02:wxVtkBaseView1:Box00:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box02:wxVtkBaseView2:Box00:wxVtkBaseView2 +NumberOfControlPoints:0 +CONNECTION +Box02:wxVtkBaseView3:Box00:wxVtkBaseView3 +NumberOfControlPoints:0 +CONNECTION +Box02:wxVtkBaseView4:Box00:wxVtkBaseView4 +NumberOfControlPoints:0 +CONNECTION +Box04:Widget:Box05:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box00:Point:Box04:In +NumberOfControlPoints:0 +CONNECTION +Box00:BoxChange:Box04:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box08:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box02:Widget:Box08:Widget2 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk/bbs/appli/examplewxPopupMenu.bbs b/bbtk/bbs/appli/examplewxPopupMenu.bbs new file mode 100644 index 0000000..a8a33ec --- /dev/null +++ b/bbtk/bbs/appli/examplewxPopupMenu.bbs @@ -0,0 +1,61 @@ +# ---------------------------------- +# - BBTKGEditor v 1.5 BBS BlackBox Script +# - C:\Users\davila\Creatis\C22\ct\cs\creaMaracasVisu\bbtk\bbs\appli\examplewxPopupMenu.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaMaracasVisu +include vtk +include wx +include creaVtk + +author "Author ??" +description "Description ??" +category "" + +new creaMaracasVisu:wxPopupMenu Box00 + set Box00.In "uno dos tres" + +new vtk:LoadHola Box01 + +new creaMaracasVisu:ViewerNV Box02 + +new wx:LayoutLine Box05 + +new wx:OutputText Box04 + +new creaVtk:OutputWindow Box06 + +new wx:LayoutSplit Box08 + set Box08.Orientation "H" + + +connect Box01.Out Box02.In + +connect Box02.wxVtkBaseView1 Box00.wxVtkBaseView + +connect Box02.wxVtkBaseView2 Box00.wxVtkBaseView2 + +connect Box02.wxVtkBaseView3 Box00.wxVtkBaseView3 + +connect Box02.wxVtkBaseView4 Box00.wxVtkBaseView4 + +connect Box04.Widget Box05.Widget3 + +connect Box00.Point Box04.In + +connect Box00.BoxChange Box04.BoxExecute + +connect Box05.Widget Box08.Widget1 + +connect Box02.Widget Box08.Widget2 + + + +# Complex input ports +exec Box06 +exec Box08 diff --git a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx index 7161020..f17105c 100644 --- a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx +++ b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx @@ -137,6 +137,7 @@ void ShowNPoints_Tools::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " < #include +#include namespace bbcreaMaracasVisu { @@ -29,6 +29,7 @@ void PopupMenuInteractor::OnPopupClick(wxCommandEvent &evt) // case ID_SOMETHING_ELSE: // break; // } + int id=evt.GetId()-1000; _box->bbSetOutputOut( id ); std::vector lstItems = _box->bbGetInputIn(); @@ -40,7 +41,7 @@ void PopupMenuInteractor::OnPopupClick(wxCommandEvent &evt) _box->bbSetOutputSimpleText( "void" ); } _box->bbSetOutputPoint( _lstPoint ); - _box->bbSignalOutputModification(); + _box->bbSignalOutputModification(); } bool PopupMenuInteractor::OnRightButtonUp() @@ -89,22 +90,19 @@ bool PopupMenuInteractor::OnRightButtonUp() { ok=true; } - - ok=ok && GetActive(); - + ok=ok && GetActive(); if (ok==true) { - for (i=0;iPopupMenu(&menu,xWindow,yWindow); - } // if ControlKey - + } // if ControlKey } // if _vtkbaseview + return true; } void PopupMenuInteractor::SetWithCtrlKey(bool flag) diff --git a/bbtk/src/bbcreaMaracasVisuwxPopupMenu.h b/bbtk/src/bbcreaMaracasVisuwxPopupMenu.h index 0047588..f47f8fe 100644 --- a/bbtk/src/bbcreaMaracasVisuwxPopupMenu.h +++ b/bbtk/src/bbcreaMaracasVisuwxPopupMenu.h @@ -26,6 +26,7 @@ #endif //__WXGTK__ // EO Wx headers + #include "wxVtkBaseView.h" #include "wxVtk2DBaseView.h" #include "InteractorStyleMaracas.h" -- 2.47.1