]> Creatis software - creaMaracasVisu.git/commitdiff
#3492 bug wxPopupMenu
authorEduardo Enrique Davila Serrano <davila@creatis.insa-lyon.fr>
Wed, 5 Oct 2022 13:56:19 +0000 (15:56 +0200)
committerEduardo Enrique Davila Serrano <davila@creatis.insa-lyon.fr>
Wed, 5 Oct 2022 13:56:19 +0000 (15:56 +0200)
bbtk/bbs/appli/examplewxPopupMenu.bbg [new file with mode: 0644]
bbtk/bbs/appli/examplewxPopupMenu.bbs [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx
bbtk/src/bbcreaMaracasVisuwxPopupMenu.cxx
bbtk/src/bbcreaMaracasVisuwxPopupMenu.h

diff --git a/bbtk/bbs/appli/examplewxPopupMenu.bbg b/bbtk/bbs/appli/examplewxPopupMenu.bbg
new file mode 100644 (file)
index 0000000..5dfe329
--- /dev/null
@@ -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:<VOID>
+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 (file)
index 0000000..a8a33ec
--- /dev/null
@@ -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 "<VOID>"
+
+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
index 71610208afe8c35117ae4cb340fe014eba0c38ff..f17105cd50db92f1f937080b7fa345f8caa20df8 100644 (file)
@@ -137,6 +137,7 @@ void ShowNPoints_Tools::Process()
 
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
     if (bbGetInputWidgetShowNPoints()!=NULL)
     {
         if (bbGetInputType()==5)
index 6e36f0487e4e382024be5223e9449dcdfc1da028..356608d040b87ea355464f002cc94b889f6dec89 100644 (file)
@@ -4,8 +4,8 @@
 #include "bbcreaMaracasVisuwxPopupMenu.h"
 #include "bbcreaMaracasVisuPackage.h"
 
-#include <wx/menu.h>
 #include <wx/kbdstate.h>
+#include <wx/menu.h>
 
 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<std::string>    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;i<size;i++)
             {
                 wxString itemString( lstItems[i].c_str() , wxConvUTF8 );
                 wxMenuItem *item = menu.Append(i+1000, itemString  );
-            } // for
-            menu.Connect( wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxCommandEventFunction) &PopupMenuInteractor::OnPopupClick,NULL,this );
+            } // for   
+                       menu.Connect( wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxCommandEventFunction) &PopupMenuInteractor::OnPopupClick,NULL,this );
             window->PopupMenu(&menu,xWindow,yWindow);
-       } // if ControlKey
-        
+       } // if ControlKey        
      } // if _vtkbaseview
+    return true;
 }
 
 void    PopupMenuInteractor::SetWithCtrlKey(bool flag)
index 00475883328969df8c56324d28a20653e601d46a..f47f8feb0cdb712920f40fa86df00ae256f6183a 100644 (file)
@@ -26,6 +26,7 @@
 #endif //__WXGTK__
 // EO Wx headers
 
+
 #include "wxVtkBaseView.h"
 #include "wxVtk2DBaseView.h"
 #include "InteractorStyleMaracas.h"