import os
from Tkinter import *
import Pmw
+import time
from widgets import ListeChoix
+from widgets import ListeChoixParGroupes
import prefs
+import options
SEPARATEUR = '-'*30
Elle est toujours dérivée.
"""
def __init__(self,parent,panneau,node) :
+ # Le parent d'un panel est un objet de la classe JDCDISPLAY ou derivee
+ # ou un objet qui a les attributs : appli (de classe APPLI ou derivee),
+ # modified et la methode init_modif
self.parent=parent
self.panneau = panneau
self.node=node
self._any.focus()
except:
pass
+ elif page == 'Commande':
+ try:
+ self.command_entry.component('entry').focus()
+ except:
+ pass
+
def affiche(self):
page=self.nb.getcurselection()
self.nb.page(page).focus_set()
- if page == 'Concept':self._any.component('entry').focus_set()
+ if page == 'Concept':
+ try:
+# _any est un pointeur sur entry
+# component est une methode de pmw
+# a priori, jamais ok
+ self._any.component('entry').focus_set()
+ except:
+ pass
self.tkraise()
# ------------------------------------------------------------------------
self._any.focus()
# aide associée au panneau
bulle_aide="""Tapez dans la zone de saisie le nom que vous voulez donner
- au concept retoruné par l'opérateur courant et pressez <Return> pour valider"""
+ au concept retounré par l'opérateur courant et pressez <Return> pour valider"""
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)
but_apres.grid(column = 1,row =3)
def makeCommandePage(self,page):
+ """
+ Cree l'onglet
+ """
frame1 = Frame(page,height = 20)
frame1.pack(side='top',fill='x')
label = Label(frame1,text ="La commande choisie sera ajoutée\n APRES la commande courante")
label.pack(side='top')
frame2 = Frame(page)
frame2.pack(side='top',fill='both',expand=1)
- liste_cmd = self.get_liste_cmd()
liste_commandes = (("<Enter>",self.selectCmd),
("<Leave>",self.deselectCmd),
("<Double-Button-1>",self.defCmd))
- Liste = ListeChoix(self,frame2,liste_cmd,liste_commandes = liste_commandes,filtre='oui',titre = "Commandes")
+ if options.affichage_commandes == "alphabetic":
+ liste_cmd = self.get_liste_cmd()
+ Liste = ListeChoix(self,frame2,liste_cmd,liste_commandes = liste_commandes,
+ filtre='oui',titre = "Commandes")
+ else:
+ liste_groupes=self.node.item.object.niveau.definition.liste_groupes
+ dict_groupes=self.node.item.object.niveau.definition.dict_groupes
+ Liste = ListeChoixParGroupes(self,frame2,liste_groupes,dict_groupes,
+ liste_commandes = liste_commandes,
+ filtre='oui',titre = "Commandes")
Liste.affiche_liste()
+ self.command_entry=Liste.entry
# aide associée au panneau
bulle_aide="""Double-cliquez sur la commande que vous voulez ajouter au jeu de commandes"""
Liste.MCbox.bind("<Button-3>", lambda e,s=self,a=bulle_aide : s.parent.appli.affiche_aide(e,a))
"""
Crée la page correspondant à un objet de type JDC
"""
- liste_cmd = self.get_liste_cmd()
liste_commandes = (("<Enter>",self.selectCmd),
("<Leave>",self.deselectCmd),
("<Double-Button-1>",self.defCmdFirst))
- Liste = ListeChoix(self,page,liste_cmd,liste_commandes = liste_commandes,filtre='oui',titre = "Commandes")
+ if options.affichage_commandes == "alphabetic":
+ liste_cmd = self.get_liste_cmd()
+ Liste = ListeChoix(self,page,liste_cmd,liste_commandes = liste_commandes,
+ filtre='oui',titre = "Commandes")
+ else:
+ liste_groupes=self.node.item.object.niveau.definition.liste_groupes
+ dict_groupes=self.node.item.object.niveau.definition.dict_groupes
+ Liste = ListeChoixParGroupes(self,page,liste_groupes,dict_groupes,
+ liste_commandes = liste_commandes,
+ filtre='oui',titre = "Commandes")
Liste.affiche_liste()
# aide associée au panneau
bulle_aide="""Double-cliquez sur la commande que vous voulez ajouter au jeu de commandes"""
command = self.comment_commande).place(relx=0.5,rely=0.5,anchor='center')
def deselectMC(self,name):
- #EFICAS.affiche_infos('')
self.parent.appli.affiche_infos('')
def get_liste_cmd_old(self):
return listeCmd
def deselectCmd(self,name):
- #EFICAS.affiche_infos('')
self.parent.appli.affiche_infos('')
def execConcept(self):
# Pourquoi node.etape ???
#test,mess = self.node.etape.item.nomme_sd(nom)
test,mess = self.node.item.nomme_sd(nom)
- #EFICAS.affiche_infos(mess)
self.parent.appli.affiche_infos(mess)
self.node.racine.update()
Cette méthode a pour but de commentariser la commande pointée par self.node
"""
commande_comment = self.node.item.get_objet_commentarise()
- #XXX il faudrait ici aussi eviter l'appel à EFICAS
self.parent.appli.bureau.JDCDisplay_courant.ReplaceObjectNode(self.node,commande_comment,None)
- #EFICAS.JDCDisplay_courant.ReplaceObjectNode(self.node,commande_comment,None)
class Panel_Inactif(Panel):
"""