self.JDCDisplay_courant.select()
#print "selectJDC",numero_jdc,self.JDCDisplay_courant,self.JDCName
+
def newJDC_include(self,event=None):
"""
Initialise un nouveau JDC vierge
self.appli.top.update()
self.visuCR(mode='JDC')
# On a ouvert un Patron
+ self.nb.bind_all("<F1>",lambda e,s=self:s.selectArbreDown())
+ self.nb.bind_all("<F2>",lambda e,s=self:s.selectArbreUp())
+
+ def selectArbreDown(self):
+ self.JDCDisplay_courant.tree.tree.canvas.focus_set()
+ self.JDCDisplay_courant.tree.tree.mot_down_force()
+
+ def selectArbreUp(self):
+ self.JDCDisplay_courant.tree.tree.canvas.focus_set()
+ self.JDCDisplay_courant.tree.tree.mot_up_force()
def GetLabelJDC(self,nb_jdc = 'absent'):
"""
"""
self.label = Label(page,text='Nom du concept :')
self.label.place(relx=0.1,rely=0.4)
+ self.label.bind("<Return>",lambda e,s=self:s.execTutu())
self._any = Entry(page,relief='sunken')
self._any.place(relx=0.35,rely=0.4,relwidth=0.5)
self._any.bind("<Return>",lambda e,s=self:s.execConcept())
page.bind("<Button-3>", lambda e,s=self,a=bulle_aide : s.parent.appli.affiche_aide(e,a))
page.bind("<ButtonRelease-3>",self.parent.appli.efface_aide)
+
def makeMoclesPage(self,page):
"""
Crée la page qui affiche la liste des mots-clés que l'on peut
liste_commandes = (("<Enter>",self.selectMC),
("<Leave>",self.deselectMC),
("<Double-Button-1>",self.defMC))
- Liste = ListeChoix(self,page,liste_mc,liste_commandes = liste_commandes,titre = "Mots-clés permis")
+ Liste = ListeChoix(self,page,liste_mc,liste_commandes = liste_commandes,titre = "Mots-clés permis",optionReturn="oui")
Liste.affiche_liste()
# aide associée au panneau
bulle_aide="""Double-cliquez sur le mot-clé que vous voulez ajouter à
la commande en cours d'édition"""
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)
+ if len(liste_mc) > 0 :
+ Liste.surligne(liste_mc[0])
def makeCommentairePage(self,page):
label = Label(page,text = "Insérer un commentaire :")
but_comment_apres = Button(self.frame_comment,
text = "APRES "+self.node.item.get_nom(),
command = self.ajout_commentaire)
- but_comment_avant.place(relx=0.6,rely=0.3,anchor='w',relwidth=0.3)
- but_comment_apres.place(relx=0.6,rely=0.7,anchor='w',relwidth=0.3)
+ but_comment_avant.place(relx=0.45,rely=0.3,anchor='w',relwidth=0.45)
+ but_comment_apres.place(relx=0.45,rely=0.7,anchor='w',relwidth=0.45)
# remplissage de la frame paramètre
Label(self.frame_param,text = "Insérer un paramètre :").place(relx=0.1,rely=0.5,anchor='w')
but_param_avant = Button(self.frame_param,
but_param_apres = Button(self.frame_param,
text = "APRES "+self.node.item.get_nom(),
command = self.ajout_parametre)
- but_param_avant.place(relx=0.6,rely=0.3,anchor='w',relwidth=0.3)
- but_param_apres.place(relx=0.6,rely=0.7,anchor='w',relwidth=0.3)
+ but_param_avant.place(relx=0.45,rely=0.3,anchor='w',relwidth=0.45)
+ but_param_apres.place(relx=0.45,rely=0.7,anchor='w',relwidth=0.45)
# remplissage de la frame eval
#Label(self.frame_eval,text="Insérer un paramètre EVAL :").place(relx=0.1,rely=0.5,anchor='w')
#Label(self.frame_eval,text='Non encore disponible').place(relx=0.6,rely=0.5,anchor='w')
#
__version__="$Name: $"
-__Id__="$Id: treewidget.py,v 1.25 2005/06/16 09:27:25 eficas Exp $"
+__Id__="$Id: treewidget.py,v 1.26 2005/11/03 09:03:49 eficas Exp $"
#
Fonte_Standard = fontes.standard
self.canvas = self.scrolledcanvas.component('canvas')
self.id_up=self.canvas.bind("<Key-Prior>", self.page_up)
self.id_down=self.canvas.bind("<Key-Next>", self.page_down)
- self.id_uup=self.canvas.bind("<Key-Up>", self.unit_up)
- self.id_udown=self.canvas.bind("<Key-Down>", self.unit_down)
+ #self.id_uup=self.canvas.bind("<Key-Up>", self.unit_up)
+ #self.id_udown=self.canvas.bind("<Key-Down>", self.unit_down)
self.id_um=self.canvas.bind("<Key-Left>", self.mot_up)
self.id_dm=self.canvas.bind("<Key-Right>", self.mot_down)
self.id_s=self.canvas.bind("<1>", self.canvas_select)
def page_up(self,event):
event.widget.yview_scroll(-1, "page")
+
def page_down(self,event):
event.widget.yview_scroll(1, "page")
+
def unit_up(self,event):
event.widget.yview_scroll(-1, "unit")
+
def unit_down(self,event):
event.widget.yview_scroll(1, "unit")
self.select_next(None)
self.canvas.focus_set()
+ def mot_down_force(self):
+ self.select_next(None)
+ self.canvas.focus_set()
+
def mot_up(self,event):
self.node_selected.select_mot_previous()
self.canvas.focus_set()
+ def mot_up_force(self):
+ self.node_selected.select_mot_previous()
+ self.canvas.focus_set()
+
def build_children(self):
""" Construit la liste des enfants de self """
self.children = []
self.children[ind].select()
except:
self.children[0].select()
- else :
- self.parent.select_next(index)
except :
- self.parent.select_next(index)
+ if self.parent is self.tree:
+ pass
+ else :
+ self.parent.select_next(index)
def select_mot_previous(self):
index = self.parent.children.index(self) - 1
try :
- if index > 0 :
+ if index > -1 :
self.parent.children[index].select()
- else :
+ elif self.parent is self.tree:
+ pass
+ else :
self.parent.select()
except:
- self.parent.select()
+ if self.parent is self.tree:
+ pass
+ else :
+ self.parent.select_previous()
def select_previous(self):
""" on doit d'abord sélectionner(dans l'ordre) :
- son frère aîné
- son père
"""
- index = self.parent.children.index(self) + 1
+ index = self.parent.children.index(self) - 1
try :
self.parent.children[index].select()
except:
- self.parent.select()
+ #self.parent.select()
+ if self.parent is self.tree:
+ pass
+ else :
+ self.parent.select_previous()
def popup(self,event=None):
"""
label.bind("<Return>",lambda e,s=self,c=self.liste_commandes[2][1],x=objet,l=label : s.chooseitemsurligne(x,l,c))
label.bind("<KP_Enter>",lambda e,s=self,c=self.liste_commandes[2][1],x=objet,l=label : s.chooseitemsurligne(x,l,c))
label.bind("<Key-Right>",lambda e,s=self,x=objet,l=label : s.selectNextItem(x,l))
+ label.bind("<Key-Down>",lambda e, s=self,x=objet,l=label : s.selectNextItem(x,l))
label.bind("<Key-Left>" ,lambda e,s=self,x=objet,l=label : s.selectPrevItem(x,l))
+ label.bind("<Key-Up>" ,lambda e,s=self,x=objet,l=label : s.selectPrevItem(x,l))
if self.active == 'oui':
label.bind(self.liste_commandes[0][0],lambda e,s=self,c=self.liste_commandes[0][1],x=objet,l=label : s.selectitem(x,l,c))
label.bind(self.liste_commandes[1][0],lambda e,s=self,c=self.liste_commandes[1][1],x=objet,l=label : s.deselectitem(l,x,c))
except AsException,e:
raison=str(e)
showerror(raison.split('\n')[0],raison)
-
+
def selectNextItem(self,mot,label):
index=self.liste.index(mot)
indexsuivant=index+1