-#@ MODIF compofact 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.
+#
+#
# ======================================================================
import Pmw
import Objecttreeitem
nb.setnaturalsize()
self.affiche()
+import treewidget
+class Node(treewidget.Node):
+ def doPaste(self,node_selected):
+ objet_a_copier = self.item.get_copie_objet()
+ child=node_selected.doPaste_MCF(objet_a_copier)
+ return child
+
+ def doPaste_MCF(self,objet_a_copier):
+ child = self.parent.append_child(objet_a_copier,
+ pos=self.item,
+ retour='oui')
+ return child
+
class FACTTreeItem(Objecttreeitem.ObjectTreeItem):
panel = FACTPanel
+ itemNode=Node
def IsExpandable(self):
return 1
def iscopiable(self):
return 1
- def isMCFact(self):
- """
- Retourne 1 si l'objet pointé par self est un MCFact, 0 sinon
- """
- return 1
-
def GetIconName(self):
if self.object.isvalid():
return "ast-green-los"
def additem(self,name,pos):
if isinstance(name,Objecttreeitem.ObjectTreeItem) :
- objet = self.object.addentite(name.object,pos)
+ objet = self.object.addentite(name.getObject(),pos)
else :
objet = self.object.addentite(name,pos)
self.expandable = 1
"""
Cette methode a pour fonction de supprimer l'item passé en argument
des fils de l'item FACT qui est son pere
- item = item du MOCLE à supprimer du MOCLE père
- item.object = MCSIMP ou MCBLOC
+ - item = item du MOCLE à supprimer du MOCLE père
+ - item.getObject() = MCSIMP ou MCBLOC
"""
- if item.object.isoblig() :
- self.appli.affiche_infos('Impossible de supprimer un mot-clé obligatoire ')
- return 0
- else :
- self.object.suppentite(item.object)
- message = "Mot-clé " + item.object.nom + " supprimé"
- self.appli.affiche_infos(message)
- return 1
+ itemobject=item.getObject()
+ if itemobject.isoblig() :
+ self.appli.affiche_infos('Impossible de supprimer un mot-clé obligatoire ')
+ return 0
+
+ if self.object.suppentite(itemobject):
+ message = "Mot-clé " + itemobject.nom + " supprimé"
+ self.appli.affiche_infos(message)
+ return 1
+ else:
+ self.appli.affiche_infos('Pb interne : impossible de supprimer ce mot-clé')
+ return 0
def verif_condition_bloc(self):
return self.object.verif_condition_bloc()