1 |
# notebox.tcl |
2 |
# by Benjamin Andrew Allan |
3 |
# Created May 3, 1998. |
4 |
# Part of ASCEND |
5 |
# Revision: $Revision: 1.4 $ |
6 |
# Last modified on: $Date: 1998/06/18 15:55:34 $ |
7 |
# Last modified by: $Author: mthomas $ |
8 |
# Revision control file: $RCSfile: notebox.tcl,v $ |
9 |
# |
10 |
# This file is part of the ASCEND Tcl/Tk Interface. |
11 |
# |
12 |
# Copyright (C) 1998 Carnegie Mellon University |
13 |
# |
14 |
# The ASCEND Tcl/Tk Interface is free software; you can redistribute |
15 |
# it and/or modify it under the terms of the GNU General Public |
16 |
# License as published by the Free Software Foundation; either |
17 |
# version 2 of the License, or (at your option) any later version. |
18 |
# |
19 |
# The ASCEND Tcl/Tk Interface is distributed in hope that it will be |
20 |
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
21 |
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22 |
# GNU General Public License for more details. |
23 |
# |
24 |
# You should have received a copy of the GNU General Public License |
25 |
# along with the program; if not, write to the Free Software |
26 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the |
27 |
# file named COPYING. COPYING is found in ../compiler. |
28 |
|
29 |
# Module: notedata.tcl |
30 |
# Tcl version: 8.0 (Tcl/Tk/XF) |
31 |
# Tk version: 8.0 |
32 |
# XF version: 4.0 |
33 |
# |
34 |
|
35 |
# module contents |
36 |
global moduleList |
37 |
global autoLoadList |
38 |
set moduleList(notedata.tcl) { .notebox} |
39 |
set autoLoadList(notedata.tcl) {0} |
40 |
|
41 |
# procedures to show toplevel windows |
42 |
|
43 |
# procedure to show window .notebox |
44 |
proc ShowWindow.notebox {args} {# xf ignore me 7 |
45 |
|
46 |
catch "destroy .notebox" |
47 |
toplevel .notebox |
48 |
global ascNotesVect ascMLVect |
49 |
|
50 |
# Window manager configurations |
51 |
wm positionfrom .notebox user |
52 |
wm sizefrom .notebox "" |
53 |
wm maxsize .notebox 2000 2000 |
54 |
wm minsize .notebox 10 10 |
55 |
wm protocol .notebox WM_DELETE_WINDOW {wm withdraw .notebox} |
56 |
wm title .notebox {A4 NOTES} |
57 |
|
58 |
|
59 |
# build widget .notebox.frame1 |
60 |
frame .notebox.frame1 \ |
61 |
-borderwidth {0} \ |
62 |
-height {30} \ |
63 |
-width {30} |
64 |
|
65 |
# build widget .notebox.frame1.label2 |
66 |
label .notebox.frame1.label2 \ |
67 |
-borderwidth {0} \ |
68 |
-anchor w \ |
69 |
-justify {left} \ |
70 |
-text {NOTES} |
71 |
|
72 |
# build widget .notebox.frame1.db |
73 |
frame .notebox.frame1.db \ |
74 |
-borderwidth {2} |
75 |
|
76 |
# build widget .notebox.frame1.db.value |
77 |
entry .notebox.frame1.db.value \ |
78 |
-state disabled \ |
79 |
-textvariable ascNotesVect(current) \ |
80 |
-width {8} |
81 |
|
82 |
set ascNotesVect(dbbutton) .notebox.frame1.db.menubutton2 |
83 |
# build widget .notebox.frame1.db.menubutton2 |
84 |
menubutton .notebox.frame1.db.menubutton2 \ |
85 |
-menu {.notebox.frame1.db.menubutton2.m} \ |
86 |
-relief raised \ |
87 |
-padx {5} \ |
88 |
-pady {4} \ |
89 |
-text {from:} |
90 |
|
91 |
set ascNotesVect(dbmenu) .notebox.frame1.db.menubutton2.m |
92 |
# build widget .notebox.frame1.db.menubutton2.m |
93 |
menu .notebox.frame1.db.menubutton2.m \ |
94 |
-tearoff 0 |
95 |
# must add menu entries in Procs from current listing. |
96 |
|
97 |
# build widget .notebox.frame1.label4 |
98 |
label .notebox.frame1.label4 \ |
99 |
-borderwidth {0} \ |
100 |
-anchor w \ |
101 |
-justify {left} \ |
102 |
-text {matching text} |
103 |
|
104 |
# build widget .notebox.frame1.matchentry |
105 |
entry .notebox.frame1.matchentry \ |
106 |
-textvariable ascNotesVect(stringmatch) \ |
107 |
-exportselection 0 \ |
108 |
-width {20} |
109 |
|
110 |
|
111 |
# build widget .notebox.frame1.button3 |
112 |
button .notebox.frame1.button3 \ |
113 |
-padx {11} \ |
114 |
-pady {4} \ |
115 |
-command {wm withdraw .notebox} \ |
116 |
-text {Close} |
117 |
|
118 |
# build widget .notebox.main_frm |
119 |
frame .notebox.main_frm \ |
120 |
-borderwidth {0} \ |
121 |
-height {30} \ |
122 |
-width {30} |
123 |
|
124 |
# build widget .notebox.main_frm.list_frm |
125 |
frame .notebox.main_frm.list_frm |
126 |
|
127 |
catch {unset ascMLVect(.notebox.main_frm.list_frm)} |
128 |
set ascNotesVect(typelist) \ |
129 |
[ascLabeledMultiList .notebox.main_frm.list_frm Type 12] |
130 |
set ascNotesVect(langlist) \ |
131 |
[ascLabeledMultiList .notebox.main_frm.list_frm Language 6] |
132 |
set ascNotesVect(namelist) \ |
133 |
[ascLabeledMultiList .notebox.main_frm.list_frm Name 10] |
134 |
set ascNotesVect(methlist) \ |
135 |
[ascLabeledMultiList .notebox.main_frm.list_frm Method 12] |
136 |
set ascNotesVect(textlist) \ |
137 |
[ascLabeledMultiList .notebox.main_frm.list_frm Text 24] |
138 |
set ascNotesVect(fililist) \ |
139 |
[ascLabeledMultiList .notebox.main_frm.list_frm File:Line 12] |
140 |
|
141 |
$ascNotesVect(typelist) configure -font $ascNotesVect(font) |
142 |
$ascNotesVect(langlist) configure -font $ascNotesVect(font) |
143 |
$ascNotesVect(namelist) configure -font $ascNotesVect(font) |
144 |
$ascNotesVect(methlist) configure -font $ascNotesVect(font) |
145 |
$ascNotesVect(textlist) configure -font $ascNotesVect(font) |
146 |
$ascNotesVect(fililist) configure -font $ascNotesVect(font) |
147 |
|
148 |
# build widget .notebox.main_frm.text_frm |
149 |
frame .notebox.main_frm.text_frm \ |
150 |
-relief flat |
151 |
|
152 |
# build widget .notebox.main_frm.text_frm.scrollbar1 |
153 |
scrollbar .notebox.main_frm.text_frm.scrollbar1 \ |
154 |
-command {.notebox.main_frm.text_frm.text2 yview} |
155 |
|
156 |
set ascNotesVect(textbox) .notebox.main_frm.text_frm.text2 |
157 |
# build widget .notebox.main_frm.text_frm.text2 |
158 |
text .notebox.main_frm.text_frm.text2 \ |
159 |
-height {10} \ |
160 |
-exportselection 0 \ |
161 |
-font $ascNotesVect(font) \ |
162 |
-width {9} \ |
163 |
-wrap {none} \ |
164 |
-yscrollcommand {.notebox.main_frm.text_frm.scrollbar1 set} |
165 |
|
166 |
# build widget .notebox.bottom_frm |
167 |
frame .notebox.bottom_frm \ |
168 |
-borderwidth {0} \ |
169 |
-height {30} \ |
170 |
-width {30} |
171 |
|
172 |
set ascNotesVect(entrybox) .notebox.bottom_frm.entry |
173 |
# build widget .notebox.bottom_frm.entry |
174 |
entry .notebox.bottom_frm.entry \ |
175 |
-textvariable ascNotesVect(entrytext) \ |
176 |
-exportselection 0 \ |
177 |
-relief flat \ |
178 |
-borderwidth 0 \ |
179 |
-state disabled |
180 |
|
181 |
# build widget .notebox.bottom_frm.sort1 |
182 |
frame .notebox.bottom_frm.sort1 \ |
183 |
-borderwidth {2} |
184 |
|
185 |
# build widget .notebox.bottom_frm.sort1.value |
186 |
entry .notebox.bottom_frm.sort1.value \ |
187 |
-exportselection 0 \ |
188 |
-state disabled \ |
189 |
-textvariable ascNotesVect(sort1) \ |
190 |
-width {8} |
191 |
|
192 |
# build widget .notebox.bottom_frm.sort1.menubutton2 |
193 |
menubutton .notebox.bottom_frm.sort1.menubutton2 \ |
194 |
-menu {.notebox.bottom_frm.sort1.menubutton2.m} \ |
195 |
-relief raised \ |
196 |
-padx {5} \ |
197 |
-pady {4} \ |
198 |
-text {Sort 1} |
199 |
|
200 |
# build widget .notebox.bottom_frm.sort1.menubutton2.m |
201 |
menu .notebox.bottom_frm.sort1.menubutton2.m \ |
202 |
-tearoff 0 |
203 |
.notebox.bottom_frm.sort1.menubutton2.m add radiobutton \ |
204 |
-variable ascNotesVect(sort1) \ |
205 |
-value None \ |
206 |
-label None \ |
207 |
-state active |
208 |
.notebox.bottom_frm.sort1.menubutton2.m add radiobutton \ |
209 |
-variable ascNotesVect(sort1) \ |
210 |
-value Type \ |
211 |
-label Type \ |
212 |
-state active |
213 |
.notebox.bottom_frm.sort1.menubutton2.m add radiobutton \ |
214 |
-variable ascNotesVect(sort1) \ |
215 |
-value Language \ |
216 |
-label Language |
217 |
.notebox.bottom_frm.sort1.menubutton2.m add radiobutton \ |
218 |
-variable ascNotesVect(sort1) \ |
219 |
-value Name \ |
220 |
-label Name |
221 |
.notebox.bottom_frm.sort1.menubutton2.m add radiobutton \ |
222 |
-variable ascNotesVect(sort1) \ |
223 |
-value Method \ |
224 |
-label Method |
225 |
.notebox.bottom_frm.sort1.menubutton2.m add radiobutton \ |
226 |
-variable ascNotesVect(sort1) \ |
227 |
-value File \ |
228 |
-label File |
229 |
|
230 |
# build widget .notebox.bottom_frm.sort2 |
231 |
frame .notebox.bottom_frm.sort2 \ |
232 |
-borderwidth {2} |
233 |
|
234 |
# build widget .notebox.bottom_frm.sort2.value |
235 |
entry .notebox.bottom_frm.sort2.value \ |
236 |
-state disabled \ |
237 |
-textvariable ascNotesVect(sort2) \ |
238 |
-width {8} |
239 |
|
240 |
# build widget .notebox.bottom_frm.sort2.menubutton2 |
241 |
menubutton .notebox.bottom_frm.sort2.menubutton2 \ |
242 |
-menu {.notebox.bottom_frm.sort2.menubutton2.m} \ |
243 |
-relief raised \ |
244 |
-padx {5} \ |
245 |
-pady {4} \ |
246 |
-text {Sort 2} |
247 |
|
248 |
# build widget .notebox.bottom_frm.sort2.menubutton2.m |
249 |
menu .notebox.bottom_frm.sort2.menubutton2.m \ |
250 |
-tearoff 0 |
251 |
.notebox.bottom_frm.sort2.menubutton2.m add radiobutton \ |
252 |
-variable ascNotesVect(sort2) \ |
253 |
-value None \ |
254 |
-label None \ |
255 |
-state active |
256 |
.notebox.bottom_frm.sort2.menubutton2.m add radiobutton \ |
257 |
-variable ascNotesVect(sort2) \ |
258 |
-value Type \ |
259 |
-label Type |
260 |
.notebox.bottom_frm.sort2.menubutton2.m add radiobutton \ |
261 |
-variable ascNotesVect(sort2) \ |
262 |
-value Language \ |
263 |
-label Language |
264 |
.notebox.bottom_frm.sort2.menubutton2.m add radiobutton \ |
265 |
-variable ascNotesVect(sort2) \ |
266 |
-value Name \ |
267 |
-label Name |
268 |
.notebox.bottom_frm.sort2.menubutton2.m add radiobutton \ |
269 |
-variable ascNotesVect(sort2) \ |
270 |
-value Method \ |
271 |
-label Method |
272 |
.notebox.bottom_frm.sort2.menubutton2.m add radiobutton \ |
273 |
-variable ascNotesVect(sort2) \ |
274 |
-value File \ |
275 |
-label File |
276 |
|
277 |
# pack master .notebox.frame1 |
278 |
pack configure .notebox.frame1.label2 \ |
279 |
-side left |
280 |
pack configure .notebox.frame1.db \ |
281 |
-side left |
282 |
pack configure .notebox.frame1.label4 \ |
283 |
-side left |
284 |
pack configure .notebox.frame1.matchentry \ |
285 |
-expand 1 \ |
286 |
-fill x \ |
287 |
-side left |
288 |
pack configure .notebox.frame1.button3 \ |
289 |
-side right |
290 |
# pack master .notebox.frame1.db |
291 |
pack configure .notebox.frame1.db.menubutton2 \ |
292 |
-fill both \ |
293 |
-side left |
294 |
pack configure .notebox.frame1.db.value \ |
295 |
-expand 1 \ |
296 |
-fill both \ |
297 |
-side right |
298 |
|
299 |
|
300 |
# pack master .notebox.main_frm |
301 |
pack configure .notebox.main_frm.list_frm \ |
302 |
-fill x |
303 |
pack configure .notebox.main_frm.text_frm \ |
304 |
-expand 1 \ |
305 |
-fill both |
306 |
|
307 |
# pack master .notebox.main_frm.text_frm |
308 |
pack configure .notebox.main_frm.text_frm.scrollbar1 \ |
309 |
-fill y \ |
310 |
-side right |
311 |
pack configure .notebox.main_frm.text_frm.text2 \ |
312 |
-expand 1 \ |
313 |
-fill both |
314 |
|
315 |
# pack master .notebox.bottom_frm |
316 |
pack configure .notebox.bottom_frm.sort1 \ |
317 |
-side left |
318 |
pack configure .notebox.bottom_frm.sort2 \ |
319 |
-side left |
320 |
pack configure .notebox.bottom_frm.entry \ |
321 |
-expand 1 \ |
322 |
-fill x \ |
323 |
-side left |
324 |
|
325 |
# pack master .notebox.bottom_frm.sort1 |
326 |
pack configure .notebox.bottom_frm.sort1.menubutton2 \ |
327 |
-fill both \ |
328 |
-side left |
329 |
pack configure .notebox.bottom_frm.sort1.value \ |
330 |
-expand 1 \ |
331 |
-fill both \ |
332 |
-side right |
333 |
|
334 |
# pack master .notebox.bottom_frm.sort2 |
335 |
pack configure .notebox.bottom_frm.sort2.menubutton2 \ |
336 |
-fill both \ |
337 |
-side left |
338 |
pack configure .notebox.bottom_frm.sort2.value \ |
339 |
-expand 1 \ |
340 |
-fill both \ |
341 |
-side right |
342 |
|
343 |
# pack master .notebox |
344 |
pack configure .notebox.frame1 \ |
345 |
-fill x |
346 |
pack configure .notebox.main_frm \ |
347 |
-expand 1 \ |
348 |
-fill both |
349 |
pack configure .notebox.bottom_frm \ |
350 |
-fill x \ |
351 |
-side bottom |
352 |
|
353 |
.notebox.main_frm.text_frm.text2 insert end {safsf} |
354 |
.notebox.bottom_frm.sort1.value insert end {Value 3} |
355 |
|
356 |
} |
357 |
|
358 |
proc DestroyWindow.notebox {} {# xf ignore me 7 |
359 |
catch "destroy .notebox" |
360 |
update |
361 |
} |
362 |
|
363 |
|
364 |
# User defined procedures |
365 |
|
366 |
# User defined images |
367 |
|
368 |
# Internal procedures |
369 |
|
370 |
# eof |
371 |
# |
372 |
|