Salome HOME
pb d accent. on les enleve en français
[tools/eficas.git] / InterfaceQT4 / compomacro.py
index 8665e45a6f58c353948126464757b15e74e53746..12849ab0ec85dcc5369b7154e67e0ab01fc1fb43 100644 (file)
@@ -29,6 +29,8 @@ from Extensions.i18n import tr
 import compooper
 import browser
 import typeNode
+from PyQt4.QtGui import QAction
+from PyQt4.QtCore import Qt, SIGNAL, QVariant
 
 
 class MACRONode(browser.JDCNode,typeNode.PopUpMenuNode):         
@@ -37,11 +39,27 @@ class MACRONode(browser.JDCNode,typeNode.PopUpMenuNode):
       return MonMacroPanel (self,parent=self.editor )
     
     def getPanel2(self):
-        from monWidgetCommande import MonWidgetCommande
-        return MonWidgetCommande(self,self.editor,self.item.object)
+      from   monWidgetCommande import MonWidgetCommande
+      return MonWidgetCommande (self,self.editor ,self.item.object)
+
 
     def createPopUpMenu(self):
       typeNode.PopUpMenuNode.createPopUpMenu(self)
+      if ("AFFE_CARA_ELEM" in self.item.get_genealogie()) and self.editor.salome:
+           self.ViewElt = QAction(tr('View3D'),self.tree)
+           self.tree.connect(self.ViewElt,SIGNAL("activated()"),self.view3D)
+           self.ViewElt.setStatusTip(tr("affiche dans Geom les elements de structure"))
+           self.menu.addAction(self.ViewElt)
+           if self.item.isvalid() :
+              self.ViewElt.setEnabled(1)
+           else:
+              self.ViewElt.setEnabled(0)
+
+    def view3D(self) :
+        from Editeur import TroisDPal
+        troisD=TroisDPal.TroisDPilote(self.item,self.editor.appliEficas)
+        troisD.envoievisu()
+
         
     #def doPaste(self,node_selected):
     #    print 'je suis la'
@@ -74,6 +92,10 @@ class INCLUDENode(browser.JDCNode,typeNode.PopUpMenuNode):
       from   monIncludePanel import MonIncludePanel
       return MonIncludePanel (self,parent=self.editor )
 
+    def getPanel2(self):
+      from   monWidgetCommande import MonWidgetCommande
+      return MonWidgetCommande (self,self.editor ,self.item.object)
+
     def createPopUpMenu(self):
       typeNode.PopUpMenuNode.createPopUpMenu(self)
       
@@ -105,6 +127,10 @@ class POURSUITENode(browser.JDCNode, typeNode.PopUpMenuNode):
       from   monPoursuitePanel import MonPoursuitePanel
       return MonPoursuitePanel (self,parent=self.editor )
 
+    def getPanel2(self):
+      from   monWidgetCommande import MonWidgetCommande
+      return MonWidgetCommande (self,self.editor ,self.item.object)
+
     def createPopUpMenu(self):
       typeNode.PopUpMenuNode.createPopUpMenu(self)