]> cvs.zerfleddert.de Git - micropolis/blob - res/whead.tcl
7e9df1f4f2a3bc15d24439815b13037ff9d59615
[micropolis] / res / whead.tcl
1 # Window: Head (global controls & menus), for Unix Micropolis.
2 #
3 # Micropolis, Unix Version. This game was released for the Unix platform
4 # in or about 1990 and has been modified for inclusion in the One Laptop
5 # Per Child program. Copyright (C) 1989 - 2007 Electronic Arts Inc. If
6 # you need assistance with this program, you may contact:
7 # http://wiki.laptop.org/go/Micropolis or email micropolis@laptop.org.
8 #
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or (at
12 # your option) any later version.
13 #
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details. You should have received a
18 # copy of the GNU General Public License along with this program. If
19 # not, see <http://www.gnu.org/licenses/>.
20 #
21 # ADDITIONAL TERMS per GNU GPL Section 7
22 #
23 # No trademark or publicity rights are granted. This license does NOT
24 # give you any right, title or interest in the trademark SimCity or any
25 # other Electronic Arts trademark. You may not distribute any
26 # modification of this program using the trademark SimCity or claim any
27 # affliation or association with Electronic Arts Inc. or its employees.
28 #
29 # Any propagation or conveyance of this program must include this
30 # copyright notice and these terms.
31 #
32 # If you convey this program (or any modifications of it) and assume
33 # contractual liability for the program to recipients of it, you agree
34 # to indemnify Electronic Arts for any liability that those contractual
35 # assumptions impose on Electronic Arts.
36 #
37 # You may not misrepresent the origins of this program; modified
38 # versions of the program must be marked as such and not identified as
39 # the original program.
40 #
41 # This disclaimer supplements the one included in the General Public
42 # License. TO THE FULLEST EXTENT PERMISSIBLE UNDER APPLICABLE LAW, THIS
43 # PROGRAM IS PROVIDED TO YOU "AS IS," WITH ALL FAULTS, WITHOUT WARRANTY
44 # OF ANY KIND, AND YOUR USE IS AT YOUR SOLE RISK. THE ENTIRE RISK OF
45 # SATISFACTORY QUALITY AND PERFORMANCE RESIDES WITH YOU. ELECTRONIC ARTS
46 # DISCLAIMS ANY AND ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES,
47 # INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY,
48 # FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT OF THIRD PARTY
49 # RIGHTS, AND WARRANTIES (IF ANY) ARISING FROM A COURSE OF DEALING,
50 # USAGE, OR TRADE PRACTICE. ELECTRONIC ARTS DOES NOT WARRANT AGAINST
51 # INTERFERENCE WITH YOUR ENJOYMENT OF THE PROGRAM; THAT THE PROGRAM WILL
52 # MEET YOUR REQUIREMENTS; THAT OPERATION OF THE PROGRAM WILL BE
53 # UNINTERRUPTED OR ERROR-FREE, OR THAT THE PROGRAM WILL BE COMPATIBLE
54 # WITH THIRD PARTY SOFTWARE OR THAT ANY ERRORS IN THE PROGRAM WILL BE
55 # CORRECTED. NO ORAL OR WRITTEN ADVICE PROVIDED BY ELECTRONIC ARTS OR
56 # ANY AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY. SOME
57 # JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF OR LIMITATIONS ON IMPLIED
58 # WARRANTIES OR THE LIMITATIONS ON THE APPLICABLE STATUTORY RIGHTS OF A
59 # CONSUMER, SO SOME OR ALL OF THE ABOVE EXCLUSIONS AND LIMITATIONS MAY
60 # NOT APPLY TO YOU.
61 global HeadWindows
62 set n [Unique]
63 set win .head$n
64
65 catch "destroy $win"
66 if {[catch "toplevel $win -screen $display"]} {
67 puts stderr "Couldn't open X11 display \"$display\"."
68 set win ""
69 return ""
70 }
71
72 global HeadPanelWidth
73 global HeadPanelHeight
74 global MapPanelWidth
75 global MapPanelHeight
76 global NoticePanelWidth
77 global NoticePanelHeight
78
79 set visual [winfo screenvisual $win]
80 set depth [winfo screendepth $win]
81 set screenwidth [winfo screenwidth $win]
82 set screenheight [winfo screenheight $win]
83 set initialwidth 1200
84 set initialheight 900
85
86 if {$screenwidth < $initialwidth} {
87 set initialwidth $screenwidth
88 }
89
90 if {$screenheight < $initialheight} {
91 set initialheight $screenheight
92 }
93
94
95 if {!(("$visual" == "pseudocolor") ||
96 ("$visual" == "truecolor") ||
97 (("$visual" == "staticgray") &&
98 ($depth == 1)))} {
99 catch "destroy $win"
100 puts stderr "Micropolis can't find an appropriate visual on display \"$display\"."
101 set win ""
102 return ""
103 }
104
105 set HeadWindows [linsert $HeadWindows 0 $win]
106
107 SetHelp $win Head
108
109 LinkWindow $win.head $win
110 LinkWindow $win.editor {}
111 LinkWindow $win.map {}
112 LinkWindow $win.graph {}
113 LinkWindow $win.budget {}
114 LinkWindow $win.evaluation {}
115 LinkWindow $win.splash {}
116 LinkWindow $win.scenario {}
117 LinkWindow $win.file {}
118 LinkWindow $win.config {}
119 LinkWindow $win.notice {}
120 LinkWindow $win.ask {}
121
122 tk_bindForTraversal $win
123 bind $win <F10> {tk_firstMenu %W}
124 bind $win <Mod2-Key> {tk_traverseToMenu %W %A}
125
126 wm title $win "Micropolis Controls"
127 wm iconname $win {Micropolis Controls}
128 wm geometry $win ${initialwidth}x${initialheight}+0+0
129 #wm positionfrom $win user
130 wm withdraw $win
131 wm maxsize $win $screenwidth $screenheight
132 wm minsize $win 100 100
133 wm protocol $win delete "DeleteHeadWindow $win ;"
134 wm fullscreen $win on
135
136 global $win.postedMenu
137 global $win.Sound
138
139 frame $win.col1
140 tk_bindForTraversal $win.col1
141
142 LinkWindow $win.col1 $win.col1
143
144 frame $win.col1.w1\
145 -width $HeadPanelWidth\
146 -height $HeadPanelHeight
147 tk_bindForTraversal $win.col1.w1
148
149 frame $win.col1.w1.f1\
150 -borderwidth 1\
151 -relief raised
152 tk_bindForTraversal $win.col1.w1.f1
153 bind $win.col1.w1.f1 <F10> {tk_firstMenu %W}
154 bind $win.col1.w1.f1 <Mod2-Key> {tk_traverseToMenu %W %A}
155
156 SetHelp $win.col1.w1.f1.micropolis Head.MicropolisMenu
157
158 menubutton $win.col1.w1.f1.micropolis\
159 -menu $win.col1.w1.f1.micropolis.m\
160 -text {Micropolis}\
161 -font [Font $win Medium]\
162 -variable $win.postedMenu
163 tk_bindForTraversal $win.col1.w1.f1.micropolis
164 bind $win.col1.w1.f1.micropolis <F10> {tk_firstMenu %W}
165 bind $win.col1.w1.f1.micropolis <Mod2-Key> {tk_traverseToMenu %W %A}
166
167 tk_menus $win $win.col1.w1.f1.micropolis
168
169 menu $win.col1.w1.f1.micropolis.m\
170 -font [Font $win Medium]
171 tk_bindForTraversal $win.col1.w1.f1.micropolis.m
172 bind $win.col1.w1.f1.micropolis.m <F10> {tk_firstMenu %W}
173 bind $win.col1.w1.f1.micropolis.m <Mod2-Key> {tk_traverseToMenu %W %A}
174 $win.col1.w1.f1.micropolis.m add command\
175 -label {About...}\
176 -command "UIShowPicture 300"
177 $win.col1.w1.f1.micropolis.m add command\
178 -label {Save City}\
179 -command "UISaveCity $win"
180 $win.col1.w1.f1.micropolis.m add command\
181 -label {Save City as...}\
182 -command "UISaveCityAs $win"
183 if {[sim MultiPlayerMode]} {
184 $win.col1.w1.f1.micropolis.m add command\
185 -label {Add Player...}\
186 -command "UIShowPlayer $win"
187 }
188 $win.col1.w1.f1.micropolis.m add command\
189 -label {Choose City!}\
190 -command "UISelectCity $win"
191 $win.col1.w1.f1.micropolis.m add command\
192 -label {Quit Playing!}\
193 -command "UIQuit $win"
194
195 SetHelp $win.col1.w1.f1.options Head.OptionsMenu
196
197 menubutton $win.col1.w1.f1.options\
198 -menu $win.col1.w1.f1.options.m\
199 -text {Options}\
200 -font [Font $win Medium]\
201 -variable $win.postedMenu
202 tk_bindForTraversal $win.col1.w1.f1.options
203 bind $win.col1.w1.f1.options <F10> {tk_firstMenu %W}
204 bind $win.col1.w1.f1.options <Mod2-Key> {tk_traverseToMenu %W %A}
205
206 tk_menus $win $win.col1.w1.f1.options
207
208 menu $win.col1.w1.f1.options.m\
209 -font [Font $win Medium]
210 tk_bindForTraversal $win.col1.w1.f1.options.m
211 bind $win.col1.w1.f1.options.m <F10> {tk_firstMenu %W}
212 bind $win.col1.w1.f1.options.m <Mod2-Key> {tk_traverseToMenu %W %A}
213 $win.col1.w1.f1.options.m add checkbutton\
214 -label {Auto Budget}\
215 -variable AutoBudget\
216 -command {sim AutoBudget $AutoBudget}
217 $win.col1.w1.f1.options.m add checkbutton\
218 -label {Auto Bulldoze}\
219 -variable AutoBulldoze\
220 -command {sim AutoBulldoze $AutoBulldoze}
221 $win.col1.w1.f1.options.m add checkbutton\
222 -label {Disasters}\
223 -variable Disasters\
224 -command {sim Disasters $Disasters}
225 $win.col1.w1.f1.options.m add checkbutton\
226 -label {Sound}\
227 -variable Sound\
228 -command {sim Sound $Sound}
229 $win.col1.w1.f1.options.m add checkbutton\
230 -label {Animation}\
231 -variable DoAnimation\
232 -command {sim DoAnimation $DoAnimation}
233 $win.col1.w1.f1.options.m add checkbutton\
234 -label {Messages}\
235 -variable DoMessages\
236 -command {sim DoMessages $DoMessages}
237 $win.col1.w1.f1.options.m add checkbutton\
238 -label {Notices}\
239 -variable DoNotices\
240 -command {sim DoNotices $DoNotices}
241
242 SetHelp $win.col1.w1.f1.disasters Head.DisastersMenu
243
244 menubutton $win.col1.w1.f1.disasters\
245 -menu $win.col1.w1.f1.disasters.m\
246 -text {Disasters}\
247 -font [Font $win Medium]\
248 -variable $win.postedMenu
249 tk_bindForTraversal $win.col1.w1.f1.disasters
250 bind $win.col1.w1.f1.disasters <F10> {tk_firstMenu %W}
251 bind $win.col1.w1.f1.disasters <Mod2-Key> {tk_traverseToMenu %W %A}
252
253 tk_menus $win $win.col1.w1.f1.disasters
254
255 menu $win.col1.w1.f1.disasters.m\
256 -font [Font $win Medium]
257 tk_bindForTraversal $win.col1.w1.f1.disasters.m
258 bind $win.col1.w1.f1.disasters.m <F10> {tk_firstMenu %W}
259 bind $win.col1.w1.f1.disasters.m <Mod2-Key> {tk_traverseToMenu %W %A}
260 $win.col1.w1.f1.disasters.m add command\
261 -label {Monster}\
262 -command "UIDisaster $win \"UIMakeMonster\" \"release a monster?\""
263 $win.col1.w1.f1.disasters.m add command\
264 -label {Fire}\
265 -command "UIDisaster $win \"sim MakeFire\" \"start a fire?\""
266 $win.col1.w1.f1.disasters.m add command\
267 -label {Flood}\
268 -command "UIDisaster $win \"sim MakeFlood\" \"bring on a flood?\""
269 $win.col1.w1.f1.disasters.m add command\
270 -label {Meltdown}\
271 -command "UIDisaster $win \"sim MakeMeltdown\" \"have a nuclear meltdown?\""
272 if {[sim HasAirCrash]} {
273 $win.col1.w1.f1.disasters.m add command\
274 -label {Air Crash}\
275 -command "UIDisaster $win \"sim MakeAirCrash\" \"crash an airplane?\""
276 }
277 $win.col1.w1.f1.disasters.m add command\
278 -label {Tornado}\
279 -command "UIDisaster $win \"sim MakeTornado\" \"spin up a tornado?\""
280 $win.col1.w1.f1.disasters.m add command\
281 -label {Earthquake}\
282 -command "UIDisaster $win \"sim MakeEarthquake\" \"cause an earthquake?\""
283
284 SetHelp $win.col1.w1.f1.priority Head.PriorityMenu
285
286 menubutton $win.col1.w1.f1.priority\
287 -menu $win.col1.w1.f1.priority.m\
288 -text {Priority}\
289 -font [Font $win Medium]\
290 -variable $win.postedMenu
291 tk_bindForTraversal $win.col1.w1.f1.priority
292 bind $win.col1.w1.f1.priority <F10> {tk_firstMenu %W}
293 bind $win.col1.w1.f1.priority <Mod2-Key> {tk_traverseToMenu %W %A}
294
295 tk_menus $win $win.col1.w1.f1.priority
296
297 menu $win.col1.w1.f1.priority.m\
298 -font [Font $win Medium]
299 tk_bindForTraversal $win.col1.w1.f1.priority.m
300 bind $win.col1.w1.f1.priority.m <F10> {tk_firstMenu %W}
301 bind $win.col1.w1.f1.priority.m <Mod2-Key> {tk_traverseToMenu %W %A}
302 $win.col1.w1.f1.priority.m add radiobutton\
303 -label {Super Fast}\
304 -command {SetPriority 4}\
305 -value {4}\
306 -variable Priority
307 $win.col1.w1.f1.priority.m add radiobutton\
308 -label {Fast}\
309 -command {SetPriority 3}\
310 -value {3}\
311 -variable Priority
312 $win.col1.w1.f1.priority.m add radiobutton\
313 -label {Normal}\
314 -command {SetPriority 2}\
315 -value {2}\
316 -variable Priority
317 $win.col1.w1.f1.priority.m add radiobutton\
318 -label {Slow}\
319 -command {SetPriority 1}\
320 -value {1}\
321 -variable Priority
322 $win.col1.w1.f1.priority.m add radiobutton\
323 -label {Super Slow}\
324 -command {SetPriority 0}\
325 -value {0}\
326 -variable Priority
327
328 SetHelp $win.col1.w1.f1.windows Head.WindowsMenu
329
330 menubutton $win.col1.w1.f1.windows\
331 -menu $win.col1.w1.f1.windows.m\
332 -text {Windows}\
333 -font [Font $win Medium]\
334 -variable $win.postedMenu
335 tk_bindForTraversal $win.col1.w1.f1.windows
336 bind $win.col1.w1.f1.windows <F10> {tk_firstMenu %W}
337 bind $win.col1.w1.f1.windows <Mod2-Key> {tk_traverseToMenu %W %A}
338
339 tk_menus $win $win.col1.w1.f1.windows
340
341 menu $win.col1.w1.f1.windows.m\
342 -font [Font $win Medium]
343 tk_bindForTraversal $win.col1.w1.f1.windows.m
344 bind $win.col1.w1.f1.windows.m <F10> {tk_firstMenu %W}
345 bind $win.col1.w1.f1.windows.m <Mod2-Key> {tk_traverseToMenu %W %A}
346 $win.col1.w1.f1.windows.m add command\
347 -label {Budget}\
348 -command "UIShowBudgetAndWait"
349 $win.col1.w1.f1.windows.m add command\
350 -label {Evaluation}\
351 -command "ShowEvaluationOf $win"
352 $win.col1.w1.f1.windows.m add command\
353 -label {Graph}\
354 -command "ShowGraphOf $win"
355 #$win.col1.w1.f1.windows.m add command\
356 # -label {Map}\
357 # -command "ShowMapOf $win"
358 #$win.col1.w1.f1.windows.m add command\
359 # -label {Editor}\
360 # -command "ShowEditorOf $win"
361 #$win.col1.w1.f1.windows.m add command\
362 # -label {Frob}\
363 # -command "ShowFrobOf $win"
364 #$win.col1.w1.f1.windows.m add command\
365 # -label {New Map}\
366 # -command "NewMapOf $win"
367 #$win.col1.w1.f1.windows.m add command\
368 # -label {New Editor}\
369 # -command "NewEditorOf $win"
370
371 LinkWindow $win.m0 $win.col1.w1.f1.micropolis.m
372 LinkWindow $win.m1 $win.col1.w1.f1.options.m
373 LinkWindow $win.m2 $win.col1.w1.f1.disasters.m
374 LinkWindow $win.m3 $win.col1.w1.f1.priority.m
375 LinkWindow $win.m4 $win.col1.w1.f1.windows.m
376
377 LinkWindow $win.b0 $win.col1.w1.f1.micropolis
378 LinkWindow $win.b1 $win.col1.w1.f1.options
379 LinkWindow $win.b2 $win.col1.w1.f1.disasters
380 LinkWindow $win.b3 $win.col1.w1.f1.priority
381 LinkWindow $win.b4 $win.col1.w1.f1.windows
382
383 pack append $win.col1.w1.f1\
384 $win.col1.w1.f1.micropolis {left frame nw} \
385 $win.col1.w1.f1.options {left frame nw} \
386 $win.col1.w1.f1.disasters {left frame nw} \
387 $win.col1.w1.f1.priority {left frame nw} \
388 $win.col1.w1.f1.windows {left frame nw}
389
390 frame $win.col1.w1.f2\
391 -background #BFBFBF \
392 -borderwidth 1\
393 -relief raised
394
395 frame $win.col1.w1.f2.f1\
396 -background #BFBFBF \
397 -borderwidth 1\
398 -relief flat
399
400 frame $win.col1.w1.f2.f1.frame \
401 -background #BFBFBF \
402 -borderwidth 0\
403 -relief flat
404
405 canvas $win.col1.w1.f2.f1.frame.demand\
406 -scrollincrement 0 \
407 -borderwidth 0 \
408 -background #BFBFBF \
409 -width 80 -height 55
410 LinkWindow $win.demand $win.col1.w1.f2.f1.frame.demand
411 $win.col1.w1.f2.f1.frame.demand create bitmap 41 4 \
412 -tags picture \
413 -bitmap "@images/demandg.xpm" \
414 -anchor nw
415 $win.col1.w1.f2.f1.frame.demand create rectangle -10 -10 1 1 \
416 -tags r \
417 -fill [Color $win #00ff00 #000000]
418 $win.col1.w1.f2.f1.frame.demand create rectangle -10 -10 1 1 \
419 -tags c \
420 -fill [Color $win #0000ff #000000]
421 $win.col1.w1.f2.f1.frame.demand create rectangle -10 -10 1 1 \
422 -tags i \
423 -fill [Color $win #ffff00 #000000]
424 $win.col1.w1.f2.f1.frame.demand create bitmap 0 4 \
425 -tags micropolis \
426 -bitmap "@images/micropoliss.xpm" \
427 -anchor nw
428
429 $win.col1.w1.f2.f1.frame.demand bind micropolis <1> {TogglePause}
430 $win.col1.w1.f2.f1.frame.demand bind micropolis <2> {TogglePause}
431 $win.col1.w1.f2.f1.frame.demand bind micropolis <3> {TogglePause}
432 $win.col1.w1.f2.f1.frame.demand bind picture <1> "ToggleEvaluationOf $win"
433 $win.col1.w1.f2.f1.frame.demand bind picture <2> "ToggleEvaluationOf $win"
434 $win.col1.w1.f2.f1.frame.demand bind picture <3> "ToggleEvaluationOf $win"
435 $win.col1.w1.f2.f1.frame.demand bind r <1> "ToggleEvaluationOf $win"
436 $win.col1.w1.f2.f1.frame.demand bind r <2> "ToggleEvaluationOf $win"
437 $win.col1.w1.f2.f1.frame.demand bind r <3> "ToggleEvaluationOf $win"
438 $win.col1.w1.f2.f1.frame.demand bind c <1> "ToggleEvaluationOf $win"
439 $win.col1.w1.f2.f1.frame.demand bind c <2> "ToggleEvaluationOf $win"
440 $win.col1.w1.f2.f1.frame.demand bind c <3> "ToggleEvaluationOf $win"
441 $win.col1.w1.f2.f1.frame.demand bind i <1> "ToggleEvaluationOf $win"
442 $win.col1.w1.f2.f1.frame.demand bind i <2> "ToggleEvaluationOf $win"
443 $win.col1.w1.f2.f1.frame.demand bind i <3> "ToggleEvaluationOf $win"
444
445 SetHelp $win.col1.w1.f2.f1.frame.demand Head.Demand
446
447 frame $win.col1.w1.f2.f1.frame.graphframe \
448 -background #BFBFBF \
449 -borderwidth 1\
450 -relief sunken
451
452 graphview $win.col1.w1.f2.f1.frame.graphframe.graph\
453 -background #BFBFBF \
454 -font [Font $win Tiny]
455 $win.col1.w1.f2.f1.frame.graphframe.graph Range 10
456 $win.col1.w1.f2.f1.frame.graphframe.graph Mask 7
457 LinkWindow $win.graphview $win.col1.w1.f2.f1.frame.graphframe.graph
458 bind $win.col1.w1.f2.f1.frame.graphframe.graph <ButtonPress> "ToggleGraphOf $win"
459
460
461 SetHelp $win.col1.w1.f2.f1.frame.graphframe.graph Head.Graph
462
463 pack append $win.col1.w1.f2.f1.frame.graphframe \
464 $win.col1.w1.f2.f1.frame.graphframe.graph {left expand fill}
465
466 pack append $win.col1.w1.f2.f1.frame \
467 $win.col1.w1.f2.f1.frame.demand {left frame sw padx 4} \
468 $win.col1.w1.f2.f1.frame.graphframe {right frame center expand fill}
469
470 frame $win.col1.w1.f2.f1.info\
471 -background #BFBFBF \
472 -borderwidth 1\
473 -relief flat
474
475 dateview $win.col1.w1.f2.f1.info.date\
476 -background #BFBFBF \
477 -width 20 \
478 -font [Font $win Medium]
479 LinkWindow $win.date $win.col1.w1.f2.f1.info.date
480
481 SetHelp $win.col1.w1.f2.f1.info.date Head.Date
482
483 label $win.col1.w1.f2.f1.info.fundslabel\
484 -background #BFBFBF \
485 -relief flat\
486 -font [Font $win Medium]\
487 -text {}\
488 -anchor w\
489 -width 20
490 LinkWindow $win.funds $win.col1.w1.f2.f1.info.fundslabel
491 bind $win.col1.w1.f2.f1.info.fundslabel <ButtonPress> "UIShowBudgetAndWait"
492
493 SetHelp $win.col1.w1.f2.f1.info.fundslabel Head.Funds
494
495 label $win.col1.w1.f2.f1.info.rate\
496 -background #BFBFBF \
497 -relief flat\
498 -font [Font $win Medium]\
499 -text {Tax Rate: 7%} \
500 -anchor w\
501 -width 20
502 LinkWindow $win.taxlabel $win.col1.w1.f2.f1.info.rate
503 bind $win.col1.w1.f2.f1.info.rate <ButtonPress> "UIShowBudgetAndWait"
504
505
506 scale $win.col1.w1.f2.f1.info.scale\
507 -background #BFBFBF \
508 -command {SetTaxRate}\
509 -orient horizontal\
510 -showvalue false\
511 -font [Font $win Medium]\
512 -sliderlength 15\
513 -to 20
514 $win.col1.w1.f2.f1.info.scale set 7
515 LinkWindow $win.taxrate $win.col1.w1.f2.f1.info.scale
516
517
518 pack append $win.col1.w1.f2.f1.info \
519 $win.col1.w1.f2.f1.info.date {top frame nw} \
520 $win.col1.w1.f2.f1.info.fundslabel {top frame nw} \
521 $win.col1.w1.f2.f1.info.rate {top frame nw} \
522 $win.col1.w1.f2.f1.info.scale {top frame nw fill expand}
523
524 pack append $win.col1.w1.f2.f1 \
525 $win.col1.w1.f2.f1.frame {left frame nw expand fill} \
526 $win.col1.w1.f2.f1.info {left frame nw}
527
528 frame $win.col1.w1.f2.f2\
529 -borderwidth 1 \
530 -relief flat
531 tk_bindForTraversal $win.col1.w1.f2.f2
532 bind $win.col1.w1.f2.f2 <F10> {tk_firstMenu %W}
533 bind $win.col1.w1.f2.f2 <Mod2-Key> {tk_traverseToMenu %W %A}
534
535 SetHelp $win.col1.w1.f2.f2 Head.Log
536
537 scrollbar $win.col1.w1.f2.f2.scroll\
538 -command "$win.col1.w1.f2.f2.text yview" \
539 -borderwidth 1
540
541 SetHelp $win.col1.w1.f2.f2.scroll Head.Scrollbar
542
543 text $win.col1.w1.f2.f2.text \
544 -yscroll "$win.col1.w1.f2.f2.scroll set" \
545 -borderwidth 1 \
546 -relief sunken \
547 -wrap word \
548 -state disabled \
549 -height 5 \
550 -font [Font $win Text]
551 LinkWindow $win.text $win.col1.w1.f2.f2.text
552
553 $win.col1.w1.f2.f2.text tag configure status \
554 -font [Font $win Message]
555
556 $win.col1.w1.f2.f2.text tag configure message \
557 -font [Font $win Message] \
558 -foreground #ffffff \
559 -background #3f3f3f
560
561 $win.col1.w1.f2.f2.text tag configure alert \
562 -font [Font $win Alert] \
563 -foreground [Color $win #ff3f3f #000000]
564
565 pack append $win.col1.w1.f2.f2 \
566 $win.col1.w1.f2.f2.scroll {left frame center filly} \
567 $win.col1.w1.f2.f2.text {right frame center fill expand}
568
569 if {[sim MultiPlayerMode]} {
570 frame $win.col1.w1.f2.f3 \
571 -borderwidth 1 \
572 -relief flat
573 tk_bindForTraversal $win.col1.w1.f2.f3
574 bind $win.col1.w1.f2.f3 <F10> {tk_firstMenu %W}
575 bind $win.col1.w1.f2.f3 <Mod2-Key> {tk_traverseToMenu %W %A}
576
577 button $win.col1.w1.f2.f3.chat \
578 -font [Font $win Large] \
579 -relief flat \
580 -text {Chat:}
581 LinkWindow $win.chat $win.col1.w1.f2.f3.chat
582 bind $win.col1.w1.f2.f3.chat <1> {ChatDown %W}
583 bind $win.col1.w1.f2.f3.chat <ButtonRelease-1> {ChatUp %W}
584
585 SetHelp $win.col1.w1.f2.f3.chat Head.Chat
586
587 entry $win.col1.w1.f2.f3.entry \
588 -relief sunken\
589 -text {}\
590 -foreground #ffffff\
591 -background #4f4f4f\
592 -textvariable $win.col1.w1.f2.f3.entry.value\
593 -font [Font $win Message]
594 global $win.col1.w1.f2.f3.entry.value
595 set $win.col1.w1.f2.f3.entry.value ""
596 tk_bindForTraversal $win.col1.w1.f2.f3.entry
597 bind $win.col1.w1.f2.f3.entry <F10> {tk_firstMenu %W}
598 bind $win.col1.w1.f2.f3.entry <Mod2-Key> {tk_traverseToMenu %W %A}
599 bind $win.col1.w1.f2.f3.entry <Return> "DoEnterMessage %W %W.value"
600 bind $win.col1.w1.f2.f3.entry <Escape> "DoEvalMessage %W %W.value"
601 bind $win.col1.w1.f2.f3.entry <Any-Enter> {focus %W}
602 LinkWindow $win.entry $win.col1.w1.f2.f3.entry
603
604 SetHelp $win.col1.w1.f2.f3.entry Head.Entry
605 }
606
607 frame $win.col1.w2
608 tk_bindForTraversal $win.col1.w2
609
610 LinkWindow $win.w2 $win.col1.w2
611
612 frame $win.col1.w3
613 tk_bindForTraversal $win.col1.w3
614
615 LinkWindow $win.w3 $win.col1.w3
616
617 frame $win.col2
618 tk_bindForTraversal $win.col2
619
620 LinkWindow $win.col2 $win.col2
621
622 #frame $win.col2.x1 -width 400 -height 400
623 #tk_bindForTraversal $win.col2.x1
624
625 #LinkWindow $win.x1 $win.col2.x1
626
627 #frame $win.col2.x2
628 #tk_bindForTraversal $win.col2.x2
629
630 #LinkWindow $win.x2 $win.col2.x2
631
632 #frame $win.col2.x3
633 #tk_bindForTraversal $win.col2.x3
634
635 #LinkWindow $win.x3 $win.col2.x3
636
637 #frame $win.col2.x4
638 #tk_bindForTraversal $win.col2.x4
639
640 #LinkWindow $win.x4 $win.col2.x4
641
642 if {[sim MultiPlayerMode]} {
643
644 pack append $win.col1.w1.f2.f3 \
645 $win.col1.w1.f2.f3.chat {left frame center padx 4} \
646 $win.col1.w1.f2.f3.entry {left frame center fillx expand padx 4}
647
648 pack append $win.col1.w1.f2 \
649 $win.col1.w1.f2.f1 {top frame center fillx} \
650 $win.col1.w1.f2.f2 {top frame center expand fill} \
651 $win.col1.w1.f2.f3 {top frame center fillx}
652
653 } else {
654
655 pack append $win.col1.w1.f2 \
656 $win.col1.w1.f2.f1 {top frame center fillx} \
657 $win.col1.w1.f2.f2 {top frame center expand fill}
658
659 }
660
661 pack append $win.col1.w1\
662 $win.col1.w1.f1 {top frame center fillx} \
663 $win.col1.w1.f2 {top frame center expand fill}
664
665 #pack append $win\
666 # $win.col1 {left frame center filly} \
667 # $win.col2 {left frame center expand fill}
668
669 place configure $win.col1\
670 -x 0\
671 -y 0\
672 -width $HeadPanelWidth\
673 -relheight 1.0
674
675 pack append $win.col1\
676 $win.col1.w1 {top frame nw fillx} \
677 $win.col1.w2 {top frame nw fillx} \
678 $win.col1.w3 {bottom frame sw fillx}
679
680 #place configure $win.col1.w1\
681 # -x 0\
682 # -y 0\
683 # -width $HeadPanelWidth\
684 # -height $HeadPanelHeight
685
686 #place configure $win.col1.w2\
687 # -x 0\
688 # -y $HeadPanelHeight\
689 # -width $MapPanelWidth\
690 # -height $MapPanelHeight
691
692 #place configure $win.col1.w3\
693 # -x 0\
694 # -y [expr "$HeadPanelHeight + $MapPanelHeight"]\
695 # -width $NoticePanelWidth\
696 # -height [expr "$screenheight - ($HeadPanelHeight + $MapPanelHeight)"]
697
698 place configure $win.col2\
699 -x [expr "$HeadPanelWidth + 5"]\
700 -y 0\
701 -relheight 1.0\
702 -width [expr "($screenwidth - $HeadPanelWidth) - 5"]
703
704 proc resizeeditor {win width} {
705 global HeadPanelWidth
706
707 place configure $win.col2\
708 -width [expr "($width - $HeadPanelWidth) - 5"]
709 }
710
711 bind $win <Configure> "resizeeditor $win %w"
712
713 #pack append $win.col2\
714 # $win.col2.x1 {top frame nw fillx} \
715 # $win.col2.x2 {top frame nw fillx} \
716 # $win.col2.x3 {top frame nw expand fill} \
717 # $win.col2.x4 {top frame nw fillx}
718
719 SetupSoundServer $win
720
721 InitHead $win
722 InitHeadMenus $win
723
724 update idletasks
Impressum, Datenschutz