1 # -*- coding: utf-8 -*-
6 class UnKnownNode(Exception):pass
14 root.event_generate("<Return>")
17 def delete_node(panel):
20 def uncomment_command(panel):
21 panel.bouton_unc.invoke()
23 panel=jdcdisplay.panel_courant
26 def comment_command(panel):
27 panel.nb.selectpage('Commentaire')
28 panel.comment_commande()
30 panel=jdcdisplay.panel_courant
33 def create_mocle(nom,panel):
34 panel.nb.selectpage('Mocles')
35 panel.Liste.afficheMot(nom)
37 label=panel.Liste.dico_labels[nom]
38 label.event_generate("<Enter>")
39 root.event_generate("<KeyPress-Return>")
41 return jdcdisplay.panel_courant
43 def change_commandcomm(text,panel):
44 panel.widget_text.setvalue(text)
46 panel.bouton_val.invoke()
49 def create_command(nom,panel):
50 panel.nb.selectpage('Commande')
52 panel.command_entry.setentry(nom)
53 panel.command_entry.component('entry').focus_set()
54 root.event_generate("<Return>")
56 label=panel.liste_command.dico_labels[nom]
57 label.event_generate("<Enter>")
58 label.event_generate("<Return>")
59 #root.event_generate("<Return>")
61 panel=jdcdisplay.panel_courant
64 def create_comment(text,panel):
65 panel.nb.selectpage('Commentaire')
66 panel.ajout_commentaire()
68 panel=jdcdisplay.panel_courant
69 panel.widget_text.setvalue(text)
71 panel.bouton_val.invoke()
72 #panel.change_valeur()
75 def create_param(nom,valeur,panel):
76 panel.nb.selectpage('Commentaire')
77 panel.ajout_parametre()
79 panel=jdcdisplay.panel_courant
81 panel.entry_nom.delete(0,"end")
82 panel.entry_nom.insert(0,nom)
83 panel.entry_nom.event_generate("<Return>")
84 panel.entry_val.delete(0,"end")
85 panel.entry_val.insert(0,valeur)
86 panel.entry_val.event_generate("<Return>")
87 panel.bouton_val.invoke()
91 def create_formule(nom,args,expr,panel):
92 panel=create_command("FORMULE",panel)
93 panel.entry_nom.delete(0,"end")
94 panel.entry_nom.insert(0,nom)
95 panel.entry_nom.event_generate("<Return>")
96 panel.entry_arg.delete(0,"end")
97 panel.entry_arg.insert(0,args)
98 panel.entry_arg.event_generate("<Return>")
99 panel.entry_exp.delete(0,"end")
100 panel.entry_exp.insert(0,expr)
101 panel.entry_exp.event_generate("<Return>")
102 panel.bouton_val.invoke()
106 def nomme_concept(nom,panel):
107 panel.nb.selectpage('Concept')
109 panel._any.delete(0,"end")
110 panel._any.insert(0,nom)
111 panel.but_ok.invoke()
113 return jdcdisplay.panel_courant
115 def select_mcf(nom,ind,node):
116 panel=select_child(nom,node)
119 parent.select_next(ind)
120 panel=jdcdisplay.panel_courant
124 def select_child(nom,node):
125 """node est le parent dont on veut le fils nom"""
126 for n in node.children:
127 if n.item.nom == nom:
130 panel= jdcdisplay.panel_courant
133 raise UnKnownNode(nom)
135 def select_node(node):
139 return jdcdisplay.panel_courant
141 def choose_valeur(valeur,panel):
142 panel.Liste_choix.afficheMot(valeur)
144 label=panel.Liste_choix.dico_labels[valeur]
145 label.event_generate("<Button-1>")
146 label.event_generate("<Return>")
149 def choose_sdco(valeur,panel):
150 i = list(panel.listbox.get(0, 'end')).index(valeur)
151 panel.listbox.component("listbox").selection_set(i)
152 panel.listbox.component("listbox").focus_set()
153 panel.listbox.component("listbox").event_generate("<Return>")
156 def choose_assd(valeur,panel):
157 i = list(panel.listbox.get(0, 'end')).index(valeur)
158 panel.listbox.component("listbox").selection_set(i)
159 panel.but_val.invoke()
162 def set_valeur(valeur,panel):
163 panel.entry.delete(0,"end")
164 panel.entry.insert(0,valeur)
165 panel.entry.event_generate("<Return>")
168 def set_sdco(valeur,panel):
169 panel.entry_co.delete(0,"end")
170 panel.entry_co.insert(0,valeur)
171 panel.entry_co.event_generate("<Return>")
174 def set_complexe(valeur,panel):
175 panel.entry3.setentry(valeur)
176 panel.entry3.component('entry').focus_set()
177 panel.entry3.event_generate("<Return>")
180 def add_valeur_into(valeur,panel):
181 label=panel.Liste_choix.dico_labels[valeur]
182 label.event_generate("<1>")
183 panel.bouton_add.invoke()
186 def add_valeur(valeur,panel):
187 panel.entry.delete(0,"end")
188 panel.entry.insert(0,valeur)
189 panel.entry.event_generate("<Return>")
192 def valider_valeur(panel):
193 panel.bouton_accepter.invoke()
197 root.event_generate("<Control-c>")
198 root.event_generate("<Control-v>")
200 return jdcdisplay.panel_courant