def __init__( self, jdc_item, editor):
#----------------------------------------
- print ('__init__ JDCTree')
+ #print ('__init__ JDCTree')
self.editor = editor
- self.plie=False
+ self.plie = False
self.item = jdc_item
self.tree = self
self.appliEficas = self.editor.appliEficas
- self.racine=self.item.itemNode(self,self.item)
+ self.racine = self.item.itemNode(self,self.item)
self.itemCourant=None
self.node_selected = self.racine
self.inhibeExpand = True
self.childrenComplete=[]
+ #print ('fin __init__ JDCTree')
# def handleContextMenu(self,item,coord):
#-------------------------------------
def onValid(self):
#-----------------
- #print ('ds onValid')
validite=self.item.isValid()
+ #print ('ds onValid', self.item.nom, '_________________________________________________', self.oldValidite, validite)
if self.oldValidite==validite : return
if self.oldValidite=='init' :
self.oldValidite=validite
def onSupp(self,suppression):
#---------------------------
- print ('on Supp', suppression)
+ #print ('on Supp', suppression)
if len(suppression) > 1 :
self.buildChildren()
self.editor.connecteur.toWebApp('remplacementNode',self.item.remplaceId,self.item.idUnique(),self.item.getDicoForFancy())
return
mcSupprime= suppression[0]
- if mcSupprime.nature != 'MCBLOC' : liste=self.item.idUnique
- else :
+ if mcSupprime.nature != 'MCBLOC' : liste=(mcSupprime.idUnique,)
+ else :
liste=[]
listeMC=mcSupprime.getAllChildInBloc()
for mc in listeMC : liste.append(mc.idUnique)
self.childrenItemComplete=self.construitChildrenComplete()
- if self.item.nom == 'web_tres_simple_avec_2Procs.comm' : print (self.children)
+ #if self.item.nom == 'web_tres_simple_avec_2Procs.comm' : print (self.children)
#print ("fin *********** buildChildren ",self,self.item, self.item.nom, self.children)
elif type(pos) == int : index = pos # position fixee
elif type(pos) == object : index = self.item.getIndex(pos) +1 # pos est un item. Il faut inserer name apres pos
elif type(name) == object : index = self.item.getIndexChild(name.nom)
- else : index = self.item.getIndexChild(name)
+ elif self.item.nature != 'JDC' : index = self.item.getIndexChild(name)
+ else : return None
- print (self.children)
obj = self.item.addItem(name,index) # emet le signal 'add'
- if obj is None : obj=0
- print (self.children)
- child=self.children[index]
- #try :
- # if len(obj) > 1 : self.buildChildren()
- #except : pass
+ try :
+ print (index)
+ self.buildChildren()
+ print (self.children)
+ child=self.children[index]
+ except :
+ print ('pb u buildChildren dans appendChild')
+ pass
print ("-------------- fin append child", child, child.item)
"""
Methode externe pour la destruction de l'objet associe au noeud
"""
- index = self.vraiParent.children.index(self) - 1
+ print ('________________appel de delete _______', self)
ret,commentaire=self.vraiParent.item.suppItem(self.item)
if ret!=0 : self.treeParent.buildChildren()
return (ret,commentaire)