]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Bug 9326: Popup on table objects
authorvsv <vsv@opencascade.com>
Fri, 24 Jun 2005 13:53:00 +0000 (13:53 +0000)
committervsv <vsv@opencascade.com>
Fri, 24 Jun 2005 13:53:00 +0000 (13:53 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h

index 67d9b24534c90b5eb76e192342f8ac1c78b77260..20c6389f2b903513b725ef636d75059c7d1e60d3 100644 (file)
@@ -2306,6 +2306,30 @@ createPopupMenus()
   mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1", true );
 }
 
+//***************************************************************************
+void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, QString& theTitle )
+{
+  SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
+  
+  SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+  SALOME_ListIO aListIO;
+  aSelectionMgr->selectedObjects(aListIO);
+  if (aListIO.Extent() != 1) return;
+
+  Handle(SALOME_InteractiveObject) anIO;
+  CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
+  _PTR(SObject) SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( anIO->getEntry() );
+  if (IsSObjectTable(SO)) {
+    action( VISU_SHOW_TABLE )->addTo(theMenu);
+    action( VISU_CREATE_CURVES )->addTo(theMenu);
+    action( VISU_EXPORT_TABLE )->addTo(theMenu);
+    theMenu->insertSeparator();
+    action( VISU_DELETE )->addTo(theMenu);
+  }
+}
+
+
+//***************************************************************************
 void
 VisuGUI::
 windows( QMap<int, int>& theMap ) const
index f24d02ddcb0d3bfeced0369317179c16f481ad39..4c5d475ea2198ca9023c28174d6fa86c72434180 100644 (file)
@@ -61,6 +61,8 @@ public:
 
   virtual void  studyActivated();
 
+  virtual void  contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, QString& theTitle );
+
 public slots:
   virtual bool deactivateModule( SUIT_Study* );
   virtual bool activateModule( SUIT_Study* );