]> git.zerfleddert.de Git - micropolis/blame - res/whead.tcl
src/tk/tkrawtcp.c: Micropolis build fixes for recent macOS
[micropolis] / res / whead.tcl
CommitLineData
6a5fa4e0
MG
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.
61global HeadWindows
62set n [Unique]
63set win .head$n
64
65catch "destroy $win"
66if {[catch "toplevel $win -screen $display"]} {
67 puts stderr "Couldn't open X11 display \"$display\"."
68 set win ""
69 return ""
70}
71
72global HeadPanelWidth
73global HeadPanelHeight
74global MapPanelWidth
75global MapPanelHeight
76global NoticePanelWidth
77global NoticePanelHeight
78
79set visual [winfo screenvisual $win]
80set depth [winfo screendepth $win]
2b896476
MG
81set screenwidth [winfo screenwidth $win]
82set screenheight [winfo screenheight $win]
da740e09
MG
83set initialwidth 1200
84set initialheight 900
85
86if {$screenwidth < $initialwidth} {
87 set initialwidth $screenwidth
88}
89
90if {$screenheight < $initialheight} {
91 set initialheight $screenheight
92}
93
6a5fa4e0
MG
94
95if {!(("$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
105set HeadWindows [linsert $HeadWindows 0 $win]
106
107SetHelp $win Head
108
109LinkWindow $win.head $win
110LinkWindow $win.editor {}
111LinkWindow $win.map {}
112LinkWindow $win.graph {}
113LinkWindow $win.budget {}
114LinkWindow $win.evaluation {}
115LinkWindow $win.splash {}
116LinkWindow $win.scenario {}
117LinkWindow $win.file {}
118LinkWindow $win.config {}
119LinkWindow $win.notice {}
120LinkWindow $win.ask {}
121
122tk_bindForTraversal $win
123bind $win <F10> {tk_firstMenu %W}
a0e770d2 124bind $win <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
125
126wm title $win "Micropolis Controls"
127wm iconname $win {Micropolis Controls}
da740e09 128wm geometry $win ${initialwidth}x${initialheight}+0+0
6a5fa4e0
MG
129#wm positionfrom $win user
130wm withdraw $win
e7d465f2
MG
131wm maxsize $win $screenwidth $screenheight
132wm minsize $win 100 100
6a5fa4e0
MG
133wm protocol $win delete "DeleteHeadWindow $win ;"
134wm fullscreen $win on
135
136global $win.postedMenu
137global $win.Sound
138
139frame $win.col1
140tk_bindForTraversal $win.col1
141
142LinkWindow $win.col1 $win.col1
143
144frame $win.col1.w1\
145 -width $HeadPanelWidth\
146 -height $HeadPanelHeight
147tk_bindForTraversal $win.col1.w1
148
149frame $win.col1.w1.f1\
150 -borderwidth 1\
151 -relief raised
152tk_bindForTraversal $win.col1.w1.f1
153bind $win.col1.w1.f1 <F10> {tk_firstMenu %W}
a0e770d2 154bind $win.col1.w1.f1 <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
155
156SetHelp $win.col1.w1.f1.micropolis Head.MicropolisMenu
157
158menubutton $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
163tk_bindForTraversal $win.col1.w1.f1.micropolis
164bind $win.col1.w1.f1.micropolis <F10> {tk_firstMenu %W}
a0e770d2 165bind $win.col1.w1.f1.micropolis <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
166
167tk_menus $win $win.col1.w1.f1.micropolis
168
169menu $win.col1.w1.f1.micropolis.m\
170 -font [Font $win Medium]
171tk_bindForTraversal $win.col1.w1.f1.micropolis.m
172bind $win.col1.w1.f1.micropolis.m <F10> {tk_firstMenu %W}
a0e770d2 173bind $win.col1.w1.f1.micropolis.m <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
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
195SetHelp $win.col1.w1.f1.options Head.OptionsMenu
196
197menubutton $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
202tk_bindForTraversal $win.col1.w1.f1.options
203bind $win.col1.w1.f1.options <F10> {tk_firstMenu %W}
a0e770d2 204bind $win.col1.w1.f1.options <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
205
206tk_menus $win $win.col1.w1.f1.options
207
208menu $win.col1.w1.f1.options.m\
209 -font [Font $win Medium]
210tk_bindForTraversal $win.col1.w1.f1.options.m
211bind $win.col1.w1.f1.options.m <F10> {tk_firstMenu %W}
a0e770d2 212bind $win.col1.w1.f1.options.m <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
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
242SetHelp $win.col1.w1.f1.disasters Head.DisastersMenu
243
244menubutton $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
249tk_bindForTraversal $win.col1.w1.f1.disasters
250bind $win.col1.w1.f1.disasters <F10> {tk_firstMenu %W}
a0e770d2 251bind $win.col1.w1.f1.disasters <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
252
253tk_menus $win $win.col1.w1.f1.disasters
254
255menu $win.col1.w1.f1.disasters.m\
256 -font [Font $win Medium]
257tk_bindForTraversal $win.col1.w1.f1.disasters.m
258bind $win.col1.w1.f1.disasters.m <F10> {tk_firstMenu %W}
a0e770d2 259bind $win.col1.w1.f1.disasters.m <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
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?\""
368d83ae
MG
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 }
6a5fa4e0
MG
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
284SetHelp $win.col1.w1.f1.priority Head.PriorityMenu
285
286menubutton $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
291tk_bindForTraversal $win.col1.w1.f1.priority
292bind $win.col1.w1.f1.priority <F10> {tk_firstMenu %W}
a0e770d2 293bind $win.col1.w1.f1.priority <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
294
295tk_menus $win $win.col1.w1.f1.priority
296
297menu $win.col1.w1.f1.priority.m\
298 -font [Font $win Medium]
299tk_bindForTraversal $win.col1.w1.f1.priority.m
300bind $win.col1.w1.f1.priority.m <F10> {tk_firstMenu %W}
a0e770d2 301bind $win.col1.w1.f1.priority.m <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
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
e555720e
MG
327 $win.col1.w1.f1.priority.m add checkbutton\
328 -label {Pause}\
329 -command {TogglePause}\
330 -variable Pause
6a5fa4e0
MG
331
332SetHelp $win.col1.w1.f1.windows Head.WindowsMenu
333
334menubutton $win.col1.w1.f1.windows\
335 -menu $win.col1.w1.f1.windows.m\
336 -text {Windows}\
337 -font [Font $win Medium]\
338 -variable $win.postedMenu
339tk_bindForTraversal $win.col1.w1.f1.windows
340bind $win.col1.w1.f1.windows <F10> {tk_firstMenu %W}
a0e770d2 341bind $win.col1.w1.f1.windows <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
342
343tk_menus $win $win.col1.w1.f1.windows
344
345menu $win.col1.w1.f1.windows.m\
346 -font [Font $win Medium]
347tk_bindForTraversal $win.col1.w1.f1.windows.m
348bind $win.col1.w1.f1.windows.m <F10> {tk_firstMenu %W}
a0e770d2 349bind $win.col1.w1.f1.windows.m <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
350 $win.col1.w1.f1.windows.m add command\
351 -label {Budget}\
352 -command "UIShowBudgetAndWait"
353 $win.col1.w1.f1.windows.m add command\
354 -label {Evaluation}\
355 -command "ShowEvaluationOf $win"
356 $win.col1.w1.f1.windows.m add command\
357 -label {Graph}\
358 -command "ShowGraphOf $win"
359 #$win.col1.w1.f1.windows.m add command\
360 # -label {Map}\
361 # -command "ShowMapOf $win"
362 #$win.col1.w1.f1.windows.m add command\
363 # -label {Editor}\
364 # -command "ShowEditorOf $win"
365 #$win.col1.w1.f1.windows.m add command\
366 # -label {Frob}\
367 # -command "ShowFrobOf $win"
368 #$win.col1.w1.f1.windows.m add command\
369 # -label {New Map}\
370 # -command "NewMapOf $win"
371 #$win.col1.w1.f1.windows.m add command\
372 # -label {New Editor}\
373 # -command "NewEditorOf $win"
374
375LinkWindow $win.m0 $win.col1.w1.f1.micropolis.m
376LinkWindow $win.m1 $win.col1.w1.f1.options.m
377LinkWindow $win.m2 $win.col1.w1.f1.disasters.m
378LinkWindow $win.m3 $win.col1.w1.f1.priority.m
379LinkWindow $win.m4 $win.col1.w1.f1.windows.m
380
381LinkWindow $win.b0 $win.col1.w1.f1.micropolis
382LinkWindow $win.b1 $win.col1.w1.f1.options
383LinkWindow $win.b2 $win.col1.w1.f1.disasters
384LinkWindow $win.b3 $win.col1.w1.f1.priority
385LinkWindow $win.b4 $win.col1.w1.f1.windows
386
387pack append $win.col1.w1.f1\
388 $win.col1.w1.f1.micropolis {left frame nw} \
389 $win.col1.w1.f1.options {left frame nw} \
390 $win.col1.w1.f1.disasters {left frame nw} \
391 $win.col1.w1.f1.priority {left frame nw} \
392 $win.col1.w1.f1.windows {left frame nw}
393
394frame $win.col1.w1.f2\
395 -background #BFBFBF \
396 -borderwidth 1\
397 -relief raised
398
399frame $win.col1.w1.f2.f1\
400 -background #BFBFBF \
401 -borderwidth 1\
402 -relief flat
403
404frame $win.col1.w1.f2.f1.frame \
405 -background #BFBFBF \
406 -borderwidth 0\
407 -relief flat
408
409canvas $win.col1.w1.f2.f1.frame.demand\
410 -scrollincrement 0 \
411 -borderwidth 0 \
412 -background #BFBFBF \
413 -width 80 -height 55
414LinkWindow $win.demand $win.col1.w1.f2.f1.frame.demand
415$win.col1.w1.f2.f1.frame.demand create bitmap 41 4 \
416 -tags picture \
417 -bitmap "@images/demandg.xpm" \
418 -anchor nw
419$win.col1.w1.f2.f1.frame.demand create rectangle -10 -10 1 1 \
420 -tags r \
421 -fill [Color $win #00ff00 #000000]
422$win.col1.w1.f2.f1.frame.demand create rectangle -10 -10 1 1 \
423 -tags c \
424 -fill [Color $win #0000ff #000000]
425$win.col1.w1.f2.f1.frame.demand create rectangle -10 -10 1 1 \
426 -tags i \
427 -fill [Color $win #ffff00 #000000]
428$win.col1.w1.f2.f1.frame.demand create bitmap 0 4 \
429 -tags micropolis \
430 -bitmap "@images/micropoliss.xpm" \
431 -anchor nw
432
433$win.col1.w1.f2.f1.frame.demand bind micropolis <1> {TogglePause}
434$win.col1.w1.f2.f1.frame.demand bind micropolis <2> {TogglePause}
435$win.col1.w1.f2.f1.frame.demand bind micropolis <3> {TogglePause}
436$win.col1.w1.f2.f1.frame.demand bind picture <1> "ToggleEvaluationOf $win"
437$win.col1.w1.f2.f1.frame.demand bind picture <2> "ToggleEvaluationOf $win"
438$win.col1.w1.f2.f1.frame.demand bind picture <3> "ToggleEvaluationOf $win"
439$win.col1.w1.f2.f1.frame.demand bind r <1> "ToggleEvaluationOf $win"
440$win.col1.w1.f2.f1.frame.demand bind r <2> "ToggleEvaluationOf $win"
441$win.col1.w1.f2.f1.frame.demand bind r <3> "ToggleEvaluationOf $win"
442$win.col1.w1.f2.f1.frame.demand bind c <1> "ToggleEvaluationOf $win"
443$win.col1.w1.f2.f1.frame.demand bind c <2> "ToggleEvaluationOf $win"
444$win.col1.w1.f2.f1.frame.demand bind c <3> "ToggleEvaluationOf $win"
445$win.col1.w1.f2.f1.frame.demand bind i <1> "ToggleEvaluationOf $win"
446$win.col1.w1.f2.f1.frame.demand bind i <2> "ToggleEvaluationOf $win"
447$win.col1.w1.f2.f1.frame.demand bind i <3> "ToggleEvaluationOf $win"
448
449SetHelp $win.col1.w1.f2.f1.frame.demand Head.Demand
450
451frame $win.col1.w1.f2.f1.frame.graphframe \
452 -background #BFBFBF \
453 -borderwidth 1\
454 -relief sunken
455
456graphview $win.col1.w1.f2.f1.frame.graphframe.graph\
457 -background #BFBFBF \
458 -font [Font $win Tiny]
459$win.col1.w1.f2.f1.frame.graphframe.graph Range 10
460$win.col1.w1.f2.f1.frame.graphframe.graph Mask 7
461LinkWindow $win.graphview $win.col1.w1.f2.f1.frame.graphframe.graph
462bind $win.col1.w1.f2.f1.frame.graphframe.graph <ButtonPress> "ToggleGraphOf $win"
463
464
465SetHelp $win.col1.w1.f2.f1.frame.graphframe.graph Head.Graph
466
467pack append $win.col1.w1.f2.f1.frame.graphframe \
468 $win.col1.w1.f2.f1.frame.graphframe.graph {left expand fill}
469
470pack append $win.col1.w1.f2.f1.frame \
471 $win.col1.w1.f2.f1.frame.demand {left frame sw padx 4} \
472 $win.col1.w1.f2.f1.frame.graphframe {right frame center expand fill}
473
474frame $win.col1.w1.f2.f1.info\
475 -background #BFBFBF \
476 -borderwidth 1\
477 -relief flat
478
479dateview $win.col1.w1.f2.f1.info.date\
480 -background #BFBFBF \
481 -width 20 \
482 -font [Font $win Medium]
483LinkWindow $win.date $win.col1.w1.f2.f1.info.date
484
485SetHelp $win.col1.w1.f2.f1.info.date Head.Date
486
487label $win.col1.w1.f2.f1.info.fundslabel\
488 -background #BFBFBF \
489 -relief flat\
490 -font [Font $win Medium]\
491 -text {}\
492 -anchor w\
493 -width 20
494LinkWindow $win.funds $win.col1.w1.f2.f1.info.fundslabel
495bind $win.col1.w1.f2.f1.info.fundslabel <ButtonPress> "UIShowBudgetAndWait"
496
497SetHelp $win.col1.w1.f2.f1.info.fundslabel Head.Funds
498
499label $win.col1.w1.f2.f1.info.rate\
500 -background #BFBFBF \
501 -relief flat\
502 -font [Font $win Medium]\
503 -text {Tax Rate: 7%} \
504 -anchor w\
505 -width 20
506LinkWindow $win.taxlabel $win.col1.w1.f2.f1.info.rate
507bind $win.col1.w1.f2.f1.info.rate <ButtonPress> "UIShowBudgetAndWait"
508
509
510scale $win.col1.w1.f2.f1.info.scale\
511 -background #BFBFBF \
512 -command {SetTaxRate}\
513 -orient horizontal\
514 -showvalue false\
515 -font [Font $win Medium]\
516 -sliderlength 15\
517 -to 20
518$win.col1.w1.f2.f1.info.scale set 7
519LinkWindow $win.taxrate $win.col1.w1.f2.f1.info.scale
520
521
522pack append $win.col1.w1.f2.f1.info \
523 $win.col1.w1.f2.f1.info.date {top frame nw} \
524 $win.col1.w1.f2.f1.info.fundslabel {top frame nw} \
525 $win.col1.w1.f2.f1.info.rate {top frame nw} \
526 $win.col1.w1.f2.f1.info.scale {top frame nw fill expand}
527
528pack append $win.col1.w1.f2.f1 \
529 $win.col1.w1.f2.f1.frame {left frame nw expand fill} \
530 $win.col1.w1.f2.f1.info {left frame nw}
531
532frame $win.col1.w1.f2.f2\
533 -borderwidth 1 \
534 -relief flat
535tk_bindForTraversal $win.col1.w1.f2.f2
536bind $win.col1.w1.f2.f2 <F10> {tk_firstMenu %W}
a0e770d2 537bind $win.col1.w1.f2.f2 <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
538
539SetHelp $win.col1.w1.f2.f2 Head.Log
540
541scrollbar $win.col1.w1.f2.f2.scroll\
542 -command "$win.col1.w1.f2.f2.text yview" \
543 -borderwidth 1
544
545SetHelp $win.col1.w1.f2.f2.scroll Head.Scrollbar
546
6fa85479
MG
547global EventLines
548
6a5fa4e0
MG
549text $win.col1.w1.f2.f2.text \
550 -yscroll "$win.col1.w1.f2.f2.scroll set" \
551 -borderwidth 1 \
552 -relief sunken \
553 -wrap word \
554 -state disabled \
6fa85479 555 -height $EventLines \
6a5fa4e0
MG
556 -font [Font $win Text]
557LinkWindow $win.text $win.col1.w1.f2.f2.text
558
559$win.col1.w1.f2.f2.text tag configure status \
560 -font [Font $win Message]
561
562$win.col1.w1.f2.f2.text tag configure message \
563 -font [Font $win Message] \
564 -foreground #ffffff \
565 -background #3f3f3f
566
567$win.col1.w1.f2.f2.text tag configure alert \
568 -font [Font $win Alert] \
569 -foreground [Color $win #ff3f3f #000000]
570
571pack append $win.col1.w1.f2.f2 \
572 $win.col1.w1.f2.f2.scroll {left frame center filly} \
573 $win.col1.w1.f2.f2.text {right frame center fill expand}
574
575if {[sim MultiPlayerMode]} {
576 frame $win.col1.w1.f2.f3 \
577 -borderwidth 1 \
578 -relief flat
579 tk_bindForTraversal $win.col1.w1.f2.f3
580 bind $win.col1.w1.f2.f3 <F10> {tk_firstMenu %W}
a0e770d2 581 bind $win.col1.w1.f2.f3 <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
582
583 button $win.col1.w1.f2.f3.chat \
584 -font [Font $win Large] \
585 -relief flat \
586 -text {Chat:}
587 LinkWindow $win.chat $win.col1.w1.f2.f3.chat
588 bind $win.col1.w1.f2.f3.chat <1> {ChatDown %W}
589 bind $win.col1.w1.f2.f3.chat <ButtonRelease-1> {ChatUp %W}
590
591 SetHelp $win.col1.w1.f2.f3.chat Head.Chat
592
593 entry $win.col1.w1.f2.f3.entry \
594 -relief sunken\
595 -text {}\
596 -foreground #ffffff\
597 -background #4f4f4f\
598 -textvariable $win.col1.w1.f2.f3.entry.value\
599 -font [Font $win Message]
600 global $win.col1.w1.f2.f3.entry.value
601 set $win.col1.w1.f2.f3.entry.value ""
602 tk_bindForTraversal $win.col1.w1.f2.f3.entry
603 bind $win.col1.w1.f2.f3.entry <F10> {tk_firstMenu %W}
a0e770d2 604 bind $win.col1.w1.f2.f3.entry <Alt-Key> {tk_traverseToMenu %W %A}
6a5fa4e0
MG
605 bind $win.col1.w1.f2.f3.entry <Return> "DoEnterMessage %W %W.value"
606 bind $win.col1.w1.f2.f3.entry <Escape> "DoEvalMessage %W %W.value"
607 bind $win.col1.w1.f2.f3.entry <Any-Enter> {focus %W}
608 LinkWindow $win.entry $win.col1.w1.f2.f3.entry
609
610 SetHelp $win.col1.w1.f2.f3.entry Head.Entry
611}
612
613frame $win.col1.w2
614tk_bindForTraversal $win.col1.w2
615
616LinkWindow $win.w2 $win.col1.w2
617
618frame $win.col1.w3
619tk_bindForTraversal $win.col1.w3
620
621LinkWindow $win.w3 $win.col1.w3
622
623frame $win.col2
624tk_bindForTraversal $win.col2
625
626LinkWindow $win.col2 $win.col2
627
628#frame $win.col2.x1 -width 400 -height 400
629#tk_bindForTraversal $win.col2.x1
630
631#LinkWindow $win.x1 $win.col2.x1
632
633#frame $win.col2.x2
634#tk_bindForTraversal $win.col2.x2
635
636#LinkWindow $win.x2 $win.col2.x2
637
638#frame $win.col2.x3
639#tk_bindForTraversal $win.col2.x3
640
641#LinkWindow $win.x3 $win.col2.x3
642
643#frame $win.col2.x4
644#tk_bindForTraversal $win.col2.x4
645
646#LinkWindow $win.x4 $win.col2.x4
647
648if {[sim MultiPlayerMode]} {
649
650 pack append $win.col1.w1.f2.f3 \
651 $win.col1.w1.f2.f3.chat {left frame center padx 4} \
652 $win.col1.w1.f2.f3.entry {left frame center fillx expand padx 4}
653
654 pack append $win.col1.w1.f2 \
655 $win.col1.w1.f2.f1 {top frame center fillx} \
656 $win.col1.w1.f2.f2 {top frame center expand fill} \
657 $win.col1.w1.f2.f3 {top frame center fillx}
658
659} else {
660
661 pack append $win.col1.w1.f2 \
662 $win.col1.w1.f2.f1 {top frame center fillx} \
663 $win.col1.w1.f2.f2 {top frame center expand fill}
664
665}
666
667pack append $win.col1.w1\
668 $win.col1.w1.f1 {top frame center fillx} \
669 $win.col1.w1.f2 {top frame center expand fill}
670
671#pack append $win\
672# $win.col1 {left frame center filly} \
673# $win.col2 {left frame center expand fill}
674
675place configure $win.col1\
676 -x 0\
677 -y 0\
678 -width $HeadPanelWidth\
d3724d6d 679 -relheight 1.0
6a5fa4e0
MG
680
681pack append $win.col1\
682 $win.col1.w1 {top frame nw fillx} \
683 $win.col1.w2 {top frame nw fillx} \
684 $win.col1.w3 {bottom frame sw fillx}
685
686#place configure $win.col1.w1\
687# -x 0\
688# -y 0\
689# -width $HeadPanelWidth\
690# -height $HeadPanelHeight
691
692#place configure $win.col1.w2\
693# -x 0\
694# -y $HeadPanelHeight\
695# -width $MapPanelWidth\
696# -height $MapPanelHeight
697
698#place configure $win.col1.w3\
699# -x 0\
700# -y [expr "$HeadPanelHeight + $MapPanelHeight"]\
701# -width $NoticePanelWidth\
702# -height [expr "$screenheight - ($HeadPanelHeight + $MapPanelHeight)"]
703
704place configure $win.col2\
705 -x [expr "$HeadPanelWidth + 5"]\
706 -y 0\
2b896476 707 -relheight 1.0\
cac78bde
MG
708 -width [expr "($screenwidth - $HeadPanelWidth) - 5"]
709
710proc resizeeditor {win width} {
711 global HeadPanelWidth
712
713 place configure $win.col2\
714 -width [expr "($width - $HeadPanelWidth) - 5"]
715}
716
717bind $win <Configure> "resizeeditor $win %w"
6a5fa4e0
MG
718
719#pack append $win.col2\
720# $win.col2.x1 {top frame nw fillx} \
721# $win.col2.x2 {top frame nw fillx} \
722# $win.col2.x3 {top frame nw expand fill} \
723# $win.col2.x4 {top frame nw fillx}
724
725SetupSoundServer $win
726
727InitHead $win
728InitHeadMenus $win
729
730update idletasks
Impressum, Datenschutz