-#@ MODIF compojdc Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE
+# -*- coding: utf-8 -*-
# CONFIGURATION MANAGEMENT OF EDF VERSION
# ======================================================================
-# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG
-# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND
-# REDISTRIBUTION OF THIS FILE.
+# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
+# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
+# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
+# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
+# (AT YOUR OPTION) ANY LATER VERSION.
+#
+# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
+# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
+# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
+# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
+#
+# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
+# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
+# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
+#
+#
# ======================================================================
-#XXX est ce utile ?from Tkinter import *
import Pmw
import Objecttreeitem
import panels
from widgets import ListeChoix
-# XXX temporairement supprimé :from Accas import commentaire
class JDCPanel(panels.OngletPanel):
def init(self):
Liste.MCbox.bind("<Button-3>", lambda e,s=self,a=bulle_aide : s.parent.appli.affiche_aide(e,a))
Liste.MCbox.bind("<ButtonRelease-3>",self.parent.appli.efface_aide)
+import treewidget
+class Node(treewidget.Node):
+ def verif_all_children(self):
+ if not self.children : self.build_children()
+ for child in self.children :
+ child.verif_all_children()
+
+ def replace_enfant(self,item):
+ """ Retourne le noeud fils à éventuellement remplacer """
+ return None
+
+ def doPaste_Commande(self,objet_a_copier):
+ """
+ Réalise la copie de l'objet passé en argument qui est nécessairement
+ une commande
+ """
+ child = self.append_child(objet_a_copier,pos='first',retour='oui')
+ return child
+
+
class JDCTreeItem(Objecttreeitem.ObjectTreeItem):
panel = JDCPanel
+ itemNode=Node
def IsExpandable(self):
-# return len(self.object.etapes) > 0
return 1
- def isJdc(self):
- """
- Retourne 1 si l'objet pointé par self est un JDC, 0 sinon
- """
- return 1
-
def GetText(self):
return " "
def additem(self,name,pos):
if isinstance(name,Objecttreeitem.ObjectTreeItem) :
- cmd=self.object.addentite(name.object,pos)
+ cmd=self.object.addentite(name.getObject(),pos)
else :
cmd = self.object.addentite(name,pos)
item = self.make_objecttreeitem(self.appli,cmd.nom + " : ", cmd)
def suppitem(self,item) :
# item = item de l'ETAPE à supprimer du JDC
- # item.object = ETAPE ou COMMENTAIRE
+ # item.getObject() = ETAPE ou COMMENTAIRE
# self.object = JDC
- self.object.suppentite(item.object)
- if item.object.nature == "COMMENTAIRE" :
- message = "Commentaire supprimé"
- self.appli.affiche_infos(message)
- else :
- message = "Commande " + item.object.nom + " supprimée"
- self.appli.affiche_infos(message)
- return 1
+ itemobject=item.getObject()
+ if self.object.suppentite(itemobject):
+ if itemobject.nature == "COMMENTAIRE" :
+ message = "Commentaire supprimé"
+ else :
+ message = "Commande " + itemobject.nom + " supprimée"
+ self.appli.affiche_infos(message)
+ return 1
+ else:
+ self.appli.affiche_infos("Pb interne : impossible de supprimer cet objet")
+ return 0
def GetSubList(self):
sublist=[]