]>
Commit | Line | Data |
---|---|---|
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. | |
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] | |
2b896476 MG |
81 | set screenwidth [winfo screenwidth $win] |
82 | set screenheight [winfo screenheight $win] | |
83 | #set screenwidth 1200 | |
84 | #set screenheight 900 | |
6a5fa4e0 MG |
85 | |
86 | if {!(("$visual" == "pseudocolor") || | |
87 | ("$visual" == "truecolor") || | |
88 | (("$visual" == "staticgray") && | |
89 | ($depth == 1)))} { | |
90 | catch "destroy $win" | |
91 | puts stderr "Micropolis can't find an appropriate visual on display \"$display\"." | |
92 | set win "" | |
93 | return "" | |
94 | } | |
95 | ||
96 | set HeadWindows [linsert $HeadWindows 0 $win] | |
97 | ||
98 | SetHelp $win Head | |
99 | ||
100 | LinkWindow $win.head $win | |
101 | LinkWindow $win.editor {} | |
102 | LinkWindow $win.map {} | |
103 | LinkWindow $win.graph {} | |
104 | LinkWindow $win.budget {} | |
105 | LinkWindow $win.evaluation {} | |
106 | LinkWindow $win.splash {} | |
107 | LinkWindow $win.scenario {} | |
108 | LinkWindow $win.file {} | |
109 | LinkWindow $win.config {} | |
110 | LinkWindow $win.notice {} | |
111 | LinkWindow $win.ask {} | |
112 | ||
113 | tk_bindForTraversal $win | |
114 | bind $win <F10> {tk_firstMenu %W} | |
115 | bind $win <Mod2-Key> {tk_traverseToMenu %W %A} | |
116 | ||
117 | wm title $win "Micropolis Controls" | |
118 | wm iconname $win {Micropolis Controls} | |
119 | wm geometry $win 1200x900+0+0 | |
120 | #wm positionfrom $win user | |
121 | wm withdraw $win | |
e7d465f2 MG |
122 | wm maxsize $win $screenwidth $screenheight |
123 | wm minsize $win 100 100 | |
6a5fa4e0 MG |
124 | wm protocol $win delete "DeleteHeadWindow $win ;" |
125 | wm fullscreen $win on | |
126 | ||
127 | global $win.postedMenu | |
128 | global $win.Sound | |
129 | ||
130 | frame $win.col1 | |
131 | tk_bindForTraversal $win.col1 | |
132 | ||
133 | LinkWindow $win.col1 $win.col1 | |
134 | ||
135 | frame $win.col1.w1\ | |
136 | -width $HeadPanelWidth\ | |
137 | -height $HeadPanelHeight | |
138 | tk_bindForTraversal $win.col1.w1 | |
139 | ||
140 | frame $win.col1.w1.f1\ | |
141 | -borderwidth 1\ | |
142 | -relief raised | |
143 | tk_bindForTraversal $win.col1.w1.f1 | |
144 | bind $win.col1.w1.f1 <F10> {tk_firstMenu %W} | |
145 | bind $win.col1.w1.f1 <Mod2-Key> {tk_traverseToMenu %W %A} | |
146 | ||
147 | SetHelp $win.col1.w1.f1.micropolis Head.MicropolisMenu | |
148 | ||
149 | menubutton $win.col1.w1.f1.micropolis\ | |
150 | -menu $win.col1.w1.f1.micropolis.m\ | |
151 | -text {Micropolis}\ | |
152 | -font [Font $win Medium]\ | |
153 | -variable $win.postedMenu | |
154 | tk_bindForTraversal $win.col1.w1.f1.micropolis | |
155 | bind $win.col1.w1.f1.micropolis <F10> {tk_firstMenu %W} | |
156 | bind $win.col1.w1.f1.micropolis <Mod2-Key> {tk_traverseToMenu %W %A} | |
157 | ||
158 | tk_menus $win $win.col1.w1.f1.micropolis | |
159 | ||
160 | menu $win.col1.w1.f1.micropolis.m\ | |
161 | -font [Font $win Medium] | |
162 | tk_bindForTraversal $win.col1.w1.f1.micropolis.m | |
163 | bind $win.col1.w1.f1.micropolis.m <F10> {tk_firstMenu %W} | |
164 | bind $win.col1.w1.f1.micropolis.m <Mod2-Key> {tk_traverseToMenu %W %A} | |
165 | $win.col1.w1.f1.micropolis.m add command\ | |
166 | -label {About...}\ | |
167 | -command "UIShowPicture 300" | |
168 | $win.col1.w1.f1.micropolis.m add command\ | |
169 | -label {Save City}\ | |
170 | -command "UISaveCity $win" | |
171 | $win.col1.w1.f1.micropolis.m add command\ | |
172 | -label {Save City as...}\ | |
173 | -command "UISaveCityAs $win" | |
174 | if {[sim MultiPlayerMode]} { | |
175 | $win.col1.w1.f1.micropolis.m add command\ | |
176 | -label {Add Player...}\ | |
177 | -command "UIShowPlayer $win" | |
178 | } | |
179 | $win.col1.w1.f1.micropolis.m add command\ | |
180 | -label {Choose City!}\ | |
181 | -command "UISelectCity $win" | |
182 | $win.col1.w1.f1.micropolis.m add command\ | |
183 | -label {Quit Playing!}\ | |
184 | -command "UIQuit $win" | |
185 | ||
186 | SetHelp $win.col1.w1.f1.options Head.OptionsMenu | |
187 | ||
188 | menubutton $win.col1.w1.f1.options\ | |
189 | -menu $win.col1.w1.f1.options.m\ | |
190 | -text {Options}\ | |
191 | -font [Font $win Medium]\ | |
192 | -variable $win.postedMenu | |
193 | tk_bindForTraversal $win.col1.w1.f1.options | |
194 | bind $win.col1.w1.f1.options <F10> {tk_firstMenu %W} | |
195 | bind $win.col1.w1.f1.options <Mod2-Key> {tk_traverseToMenu %W %A} | |
196 | ||
197 | tk_menus $win $win.col1.w1.f1.options | |
198 | ||
199 | menu $win.col1.w1.f1.options.m\ | |
200 | -font [Font $win Medium] | |
201 | tk_bindForTraversal $win.col1.w1.f1.options.m | |
202 | bind $win.col1.w1.f1.options.m <F10> {tk_firstMenu %W} | |
203 | bind $win.col1.w1.f1.options.m <Mod2-Key> {tk_traverseToMenu %W %A} | |
204 | $win.col1.w1.f1.options.m add checkbutton\ | |
205 | -label {Auto Budget}\ | |
206 | -variable AutoBudget\ | |
207 | -command {sim AutoBudget $AutoBudget} | |
208 | $win.col1.w1.f1.options.m add checkbutton\ | |
209 | -label {Auto Bulldoze}\ | |
210 | -variable AutoBulldoze\ | |
211 | -command {sim AutoBulldoze $AutoBulldoze} | |
212 | $win.col1.w1.f1.options.m add checkbutton\ | |
213 | -label {Disasters}\ | |
214 | -variable Disasters\ | |
215 | -command {sim Disasters $Disasters} | |
216 | $win.col1.w1.f1.options.m add checkbutton\ | |
217 | -label {Sound}\ | |
218 | -variable Sound\ | |
219 | -command {sim Sound $Sound} | |
220 | $win.col1.w1.f1.options.m add checkbutton\ | |
221 | -label {Animation}\ | |
222 | -variable DoAnimation\ | |
223 | -command {sim DoAnimation $DoAnimation} | |
224 | $win.col1.w1.f1.options.m add checkbutton\ | |
225 | -label {Messages}\ | |
226 | -variable DoMessages\ | |
227 | -command {sim DoMessages $DoMessages} | |
228 | $win.col1.w1.f1.options.m add checkbutton\ | |
229 | -label {Notices}\ | |
230 | -variable DoNotices\ | |
231 | -command {sim DoNotices $DoNotices} | |
232 | ||
233 | SetHelp $win.col1.w1.f1.disasters Head.DisastersMenu | |
234 | ||
235 | menubutton $win.col1.w1.f1.disasters\ | |
236 | -menu $win.col1.w1.f1.disasters.m\ | |
237 | -text {Disasters}\ | |
238 | -font [Font $win Medium]\ | |
239 | -variable $win.postedMenu | |
240 | tk_bindForTraversal $win.col1.w1.f1.disasters | |
241 | bind $win.col1.w1.f1.disasters <F10> {tk_firstMenu %W} | |
242 | bind $win.col1.w1.f1.disasters <Mod2-Key> {tk_traverseToMenu %W %A} | |
243 | ||
244 | tk_menus $win $win.col1.w1.f1.disasters | |
245 | ||
246 | menu $win.col1.w1.f1.disasters.m\ | |
247 | -font [Font $win Medium] | |
248 | tk_bindForTraversal $win.col1.w1.f1.disasters.m | |
249 | bind $win.col1.w1.f1.disasters.m <F10> {tk_firstMenu %W} | |
250 | bind $win.col1.w1.f1.disasters.m <Mod2-Key> {tk_traverseToMenu %W %A} | |
251 | $win.col1.w1.f1.disasters.m add command\ | |
252 | -label {Monster}\ | |
253 | -command "UIDisaster $win \"UIMakeMonster\" \"release a monster?\"" | |
254 | $win.col1.w1.f1.disasters.m add command\ | |
255 | -label {Fire}\ | |
256 | -command "UIDisaster $win \"sim MakeFire\" \"start a fire?\"" | |
257 | $win.col1.w1.f1.disasters.m add command\ | |
258 | -label {Flood}\ | |
259 | -command "UIDisaster $win \"sim MakeFlood\" \"bring on a flood?\"" | |
260 | $win.col1.w1.f1.disasters.m add command\ | |
261 | -label {Meltdown}\ | |
262 | -command "UIDisaster $win \"sim MakeMeltdown\" \"have a nuclear meltdown?\"" | |
263 | $win.col1.w1.f1.disasters.m add command\ | |
264 | -label {Tornado}\ | |
265 | -command "UIDisaster $win \"sim MakeTornado\" \"spin up a tornado?\"" | |
266 | $win.col1.w1.f1.disasters.m add command\ | |
267 | -label {Earthquake}\ | |
268 | -command "UIDisaster $win \"sim MakeEarthquake\" \"cause an earthquake?\"" | |
269 | ||
270 | SetHelp $win.col1.w1.f1.priority Head.PriorityMenu | |
271 | ||
272 | menubutton $win.col1.w1.f1.priority\ | |
273 | -menu $win.col1.w1.f1.priority.m\ | |
274 | -text {Priority}\ | |
275 | -font [Font $win Medium]\ | |
276 | -variable $win.postedMenu | |
277 | tk_bindForTraversal $win.col1.w1.f1.priority | |
278 | bind $win.col1.w1.f1.priority <F10> {tk_firstMenu %W} | |
279 | bind $win.col1.w1.f1.priority <Mod2-Key> {tk_traverseToMenu %W %A} | |
280 | ||
281 | tk_menus $win $win.col1.w1.f1.priority | |
282 | ||
283 | menu $win.col1.w1.f1.priority.m\ | |
284 | -font [Font $win Medium] | |
285 | tk_bindForTraversal $win.col1.w1.f1.priority.m | |
286 | bind $win.col1.w1.f1.priority.m <F10> {tk_firstMenu %W} | |
287 | bind $win.col1.w1.f1.priority.m <Mod2-Key> {tk_traverseToMenu %W %A} | |
288 | $win.col1.w1.f1.priority.m add radiobutton\ | |
289 | -label {Super Fast}\ | |
290 | -command {SetPriority 4}\ | |
291 | -value {4}\ | |
292 | -variable Priority | |
293 | $win.col1.w1.f1.priority.m add radiobutton\ | |
294 | -label {Fast}\ | |
295 | -command {SetPriority 3}\ | |
296 | -value {3}\ | |
297 | -variable Priority | |
298 | $win.col1.w1.f1.priority.m add radiobutton\ | |
299 | -label {Normal}\ | |
300 | -command {SetPriority 2}\ | |
301 | -value {2}\ | |
302 | -variable Priority | |
303 | $win.col1.w1.f1.priority.m add radiobutton\ | |
304 | -label {Slow}\ | |
305 | -command {SetPriority 1}\ | |
306 | -value {1}\ | |
307 | -variable Priority | |
308 | $win.col1.w1.f1.priority.m add radiobutton\ | |
309 | -label {Super Slow}\ | |
310 | -command {SetPriority 0}\ | |
311 | -value {0}\ | |
312 | -variable Priority | |
313 | ||
314 | SetHelp $win.col1.w1.f1.windows Head.WindowsMenu | |
315 | ||
316 | menubutton $win.col1.w1.f1.windows\ | |
317 | -menu $win.col1.w1.f1.windows.m\ | |
318 | -text {Windows}\ | |
319 | -font [Font $win Medium]\ | |
320 | -variable $win.postedMenu | |
321 | tk_bindForTraversal $win.col1.w1.f1.windows | |
322 | bind $win.col1.w1.f1.windows <F10> {tk_firstMenu %W} | |
323 | bind $win.col1.w1.f1.windows <Mod2-Key> {tk_traverseToMenu %W %A} | |
324 | ||
325 | tk_menus $win $win.col1.w1.f1.windows | |
326 | ||
327 | menu $win.col1.w1.f1.windows.m\ | |
328 | -font [Font $win Medium] | |
329 | tk_bindForTraversal $win.col1.w1.f1.windows.m | |
330 | bind $win.col1.w1.f1.windows.m <F10> {tk_firstMenu %W} | |
331 | bind $win.col1.w1.f1.windows.m <Mod2-Key> {tk_traverseToMenu %W %A} | |
332 | $win.col1.w1.f1.windows.m add command\ | |
333 | -label {Budget}\ | |
334 | -command "UIShowBudgetAndWait" | |
335 | $win.col1.w1.f1.windows.m add command\ | |
336 | -label {Evaluation}\ | |
337 | -command "ShowEvaluationOf $win" | |
338 | $win.col1.w1.f1.windows.m add command\ | |
339 | -label {Graph}\ | |
340 | -command "ShowGraphOf $win" | |
341 | #$win.col1.w1.f1.windows.m add command\ | |
342 | # -label {Map}\ | |
343 | # -command "ShowMapOf $win" | |
344 | #$win.col1.w1.f1.windows.m add command\ | |
345 | # -label {Editor}\ | |
346 | # -command "ShowEditorOf $win" | |
347 | #$win.col1.w1.f1.windows.m add command\ | |
348 | # -label {Frob}\ | |
349 | # -command "ShowFrobOf $win" | |
350 | #$win.col1.w1.f1.windows.m add command\ | |
351 | # -label {New Map}\ | |
352 | # -command "NewMapOf $win" | |
353 | #$win.col1.w1.f1.windows.m add command\ | |
354 | # -label {New Editor}\ | |
355 | # -command "NewEditorOf $win" | |
356 | ||
357 | LinkWindow $win.m0 $win.col1.w1.f1.micropolis.m | |
358 | LinkWindow $win.m1 $win.col1.w1.f1.options.m | |
359 | LinkWindow $win.m2 $win.col1.w1.f1.disasters.m | |
360 | LinkWindow $win.m3 $win.col1.w1.f1.priority.m | |
361 | LinkWindow $win.m4 $win.col1.w1.f1.windows.m | |
362 | ||
363 | LinkWindow $win.b0 $win.col1.w1.f1.micropolis | |
364 | LinkWindow $win.b1 $win.col1.w1.f1.options | |
365 | LinkWindow $win.b2 $win.col1.w1.f1.disasters | |
366 | LinkWindow $win.b3 $win.col1.w1.f1.priority | |
367 | LinkWindow $win.b4 $win.col1.w1.f1.windows | |
368 | ||
369 | pack append $win.col1.w1.f1\ | |
370 | $win.col1.w1.f1.micropolis {left frame nw} \ | |
371 | $win.col1.w1.f1.options {left frame nw} \ | |
372 | $win.col1.w1.f1.disasters {left frame nw} \ | |
373 | $win.col1.w1.f1.priority {left frame nw} \ | |
374 | $win.col1.w1.f1.windows {left frame nw} | |
375 | ||
376 | frame $win.col1.w1.f2\ | |
377 | -background #BFBFBF \ | |
378 | -borderwidth 1\ | |
379 | -relief raised | |
380 | ||
381 | frame $win.col1.w1.f2.f1\ | |
382 | -background #BFBFBF \ | |
383 | -borderwidth 1\ | |
384 | -relief flat | |
385 | ||
386 | frame $win.col1.w1.f2.f1.frame \ | |
387 | -background #BFBFBF \ | |
388 | -borderwidth 0\ | |
389 | -relief flat | |
390 | ||
391 | canvas $win.col1.w1.f2.f1.frame.demand\ | |
392 | -scrollincrement 0 \ | |
393 | -borderwidth 0 \ | |
394 | -background #BFBFBF \ | |
395 | -width 80 -height 55 | |
396 | LinkWindow $win.demand $win.col1.w1.f2.f1.frame.demand | |
397 | $win.col1.w1.f2.f1.frame.demand create bitmap 41 4 \ | |
398 | -tags picture \ | |
399 | -bitmap "@images/demandg.xpm" \ | |
400 | -anchor nw | |
401 | $win.col1.w1.f2.f1.frame.demand create rectangle -10 -10 1 1 \ | |
402 | -tags r \ | |
403 | -fill [Color $win #00ff00 #000000] | |
404 | $win.col1.w1.f2.f1.frame.demand create rectangle -10 -10 1 1 \ | |
405 | -tags c \ | |
406 | -fill [Color $win #0000ff #000000] | |
407 | $win.col1.w1.f2.f1.frame.demand create rectangle -10 -10 1 1 \ | |
408 | -tags i \ | |
409 | -fill [Color $win #ffff00 #000000] | |
410 | $win.col1.w1.f2.f1.frame.demand create bitmap 0 4 \ | |
411 | -tags micropolis \ | |
412 | -bitmap "@images/micropoliss.xpm" \ | |
413 | -anchor nw | |
414 | ||
415 | $win.col1.w1.f2.f1.frame.demand bind micropolis <1> {TogglePause} | |
416 | $win.col1.w1.f2.f1.frame.demand bind micropolis <2> {TogglePause} | |
417 | $win.col1.w1.f2.f1.frame.demand bind micropolis <3> {TogglePause} | |
418 | $win.col1.w1.f2.f1.frame.demand bind picture <1> "ToggleEvaluationOf $win" | |
419 | $win.col1.w1.f2.f1.frame.demand bind picture <2> "ToggleEvaluationOf $win" | |
420 | $win.col1.w1.f2.f1.frame.demand bind picture <3> "ToggleEvaluationOf $win" | |
421 | $win.col1.w1.f2.f1.frame.demand bind r <1> "ToggleEvaluationOf $win" | |
422 | $win.col1.w1.f2.f1.frame.demand bind r <2> "ToggleEvaluationOf $win" | |
423 | $win.col1.w1.f2.f1.frame.demand bind r <3> "ToggleEvaluationOf $win" | |
424 | $win.col1.w1.f2.f1.frame.demand bind c <1> "ToggleEvaluationOf $win" | |
425 | $win.col1.w1.f2.f1.frame.demand bind c <2> "ToggleEvaluationOf $win" | |
426 | $win.col1.w1.f2.f1.frame.demand bind c <3> "ToggleEvaluationOf $win" | |
427 | $win.col1.w1.f2.f1.frame.demand bind i <1> "ToggleEvaluationOf $win" | |
428 | $win.col1.w1.f2.f1.frame.demand bind i <2> "ToggleEvaluationOf $win" | |
429 | $win.col1.w1.f2.f1.frame.demand bind i <3> "ToggleEvaluationOf $win" | |
430 | ||
431 | SetHelp $win.col1.w1.f2.f1.frame.demand Head.Demand | |
432 | ||
433 | frame $win.col1.w1.f2.f1.frame.graphframe \ | |
434 | -background #BFBFBF \ | |
435 | -borderwidth 1\ | |
436 | -relief sunken | |
437 | ||
438 | graphview $win.col1.w1.f2.f1.frame.graphframe.graph\ | |
439 | -background #BFBFBF \ | |
440 | -font [Font $win Tiny] | |
441 | $win.col1.w1.f2.f1.frame.graphframe.graph Range 10 | |
442 | $win.col1.w1.f2.f1.frame.graphframe.graph Mask 7 | |
443 | LinkWindow $win.graphview $win.col1.w1.f2.f1.frame.graphframe.graph | |
444 | bind $win.col1.w1.f2.f1.frame.graphframe.graph <ButtonPress> "ToggleGraphOf $win" | |
445 | ||
446 | ||
447 | SetHelp $win.col1.w1.f2.f1.frame.graphframe.graph Head.Graph | |
448 | ||
449 | pack append $win.col1.w1.f2.f1.frame.graphframe \ | |
450 | $win.col1.w1.f2.f1.frame.graphframe.graph {left expand fill} | |
451 | ||
452 | pack append $win.col1.w1.f2.f1.frame \ | |
453 | $win.col1.w1.f2.f1.frame.demand {left frame sw padx 4} \ | |
454 | $win.col1.w1.f2.f1.frame.graphframe {right frame center expand fill} | |
455 | ||
456 | frame $win.col1.w1.f2.f1.info\ | |
457 | -background #BFBFBF \ | |
458 | -borderwidth 1\ | |
459 | -relief flat | |
460 | ||
461 | dateview $win.col1.w1.f2.f1.info.date\ | |
462 | -background #BFBFBF \ | |
463 | -width 20 \ | |
464 | -font [Font $win Medium] | |
465 | LinkWindow $win.date $win.col1.w1.f2.f1.info.date | |
466 | ||
467 | SetHelp $win.col1.w1.f2.f1.info.date Head.Date | |
468 | ||
469 | label $win.col1.w1.f2.f1.info.fundslabel\ | |
470 | -background #BFBFBF \ | |
471 | -relief flat\ | |
472 | -font [Font $win Medium]\ | |
473 | -text {}\ | |
474 | -anchor w\ | |
475 | -width 20 | |
476 | LinkWindow $win.funds $win.col1.w1.f2.f1.info.fundslabel | |
477 | bind $win.col1.w1.f2.f1.info.fundslabel <ButtonPress> "UIShowBudgetAndWait" | |
478 | ||
479 | SetHelp $win.col1.w1.f2.f1.info.fundslabel Head.Funds | |
480 | ||
481 | label $win.col1.w1.f2.f1.info.rate\ | |
482 | -background #BFBFBF \ | |
483 | -relief flat\ | |
484 | -font [Font $win Medium]\ | |
485 | -text {Tax Rate: 7%} \ | |
486 | -anchor w\ | |
487 | -width 20 | |
488 | LinkWindow $win.taxlabel $win.col1.w1.f2.f1.info.rate | |
489 | bind $win.col1.w1.f2.f1.info.rate <ButtonPress> "UIShowBudgetAndWait" | |
490 | ||
491 | ||
492 | scale $win.col1.w1.f2.f1.info.scale\ | |
493 | -background #BFBFBF \ | |
494 | -command {SetTaxRate}\ | |
495 | -orient horizontal\ | |
496 | -showvalue false\ | |
497 | -font [Font $win Medium]\ | |
498 | -sliderlength 15\ | |
499 | -to 20 | |
500 | $win.col1.w1.f2.f1.info.scale set 7 | |
501 | LinkWindow $win.taxrate $win.col1.w1.f2.f1.info.scale | |
502 | ||
503 | ||
504 | pack append $win.col1.w1.f2.f1.info \ | |
505 | $win.col1.w1.f2.f1.info.date {top frame nw} \ | |
506 | $win.col1.w1.f2.f1.info.fundslabel {top frame nw} \ | |
507 | $win.col1.w1.f2.f1.info.rate {top frame nw} \ | |
508 | $win.col1.w1.f2.f1.info.scale {top frame nw fill expand} | |
509 | ||
510 | pack append $win.col1.w1.f2.f1 \ | |
511 | $win.col1.w1.f2.f1.frame {left frame nw expand fill} \ | |
512 | $win.col1.w1.f2.f1.info {left frame nw} | |
513 | ||
514 | frame $win.col1.w1.f2.f2\ | |
515 | -borderwidth 1 \ | |
516 | -relief flat | |
517 | tk_bindForTraversal $win.col1.w1.f2.f2 | |
518 | bind $win.col1.w1.f2.f2 <F10> {tk_firstMenu %W} | |
519 | bind $win.col1.w1.f2.f2 <Mod2-Key> {tk_traverseToMenu %W %A} | |
520 | ||
521 | SetHelp $win.col1.w1.f2.f2 Head.Log | |
522 | ||
523 | scrollbar $win.col1.w1.f2.f2.scroll\ | |
524 | -command "$win.col1.w1.f2.f2.text yview" \ | |
525 | -borderwidth 1 | |
526 | ||
527 | SetHelp $win.col1.w1.f2.f2.scroll Head.Scrollbar | |
528 | ||
529 | text $win.col1.w1.f2.f2.text \ | |
530 | -yscroll "$win.col1.w1.f2.f2.scroll set" \ | |
531 | -borderwidth 1 \ | |
532 | -relief sunken \ | |
533 | -wrap word \ | |
534 | -state disabled \ | |
535 | -height 5 \ | |
536 | -font [Font $win Text] | |
537 | LinkWindow $win.text $win.col1.w1.f2.f2.text | |
538 | ||
539 | $win.col1.w1.f2.f2.text tag configure status \ | |
540 | -font [Font $win Message] | |
541 | ||
542 | $win.col1.w1.f2.f2.text tag configure message \ | |
543 | -font [Font $win Message] \ | |
544 | -foreground #ffffff \ | |
545 | -background #3f3f3f | |
546 | ||
547 | $win.col1.w1.f2.f2.text tag configure alert \ | |
548 | -font [Font $win Alert] \ | |
549 | -foreground [Color $win #ff3f3f #000000] | |
550 | ||
551 | pack append $win.col1.w1.f2.f2 \ | |
552 | $win.col1.w1.f2.f2.scroll {left frame center filly} \ | |
553 | $win.col1.w1.f2.f2.text {right frame center fill expand} | |
554 | ||
555 | if {[sim MultiPlayerMode]} { | |
556 | frame $win.col1.w1.f2.f3 \ | |
557 | -borderwidth 1 \ | |
558 | -relief flat | |
559 | tk_bindForTraversal $win.col1.w1.f2.f3 | |
560 | bind $win.col1.w1.f2.f3 <F10> {tk_firstMenu %W} | |
561 | bind $win.col1.w1.f2.f3 <Mod2-Key> {tk_traverseToMenu %W %A} | |
562 | ||
563 | button $win.col1.w1.f2.f3.chat \ | |
564 | -font [Font $win Large] \ | |
565 | -relief flat \ | |
566 | -text {Chat:} | |
567 | LinkWindow $win.chat $win.col1.w1.f2.f3.chat | |
568 | bind $win.col1.w1.f2.f3.chat <1> {ChatDown %W} | |
569 | bind $win.col1.w1.f2.f3.chat <ButtonRelease-1> {ChatUp %W} | |
570 | ||
571 | SetHelp $win.col1.w1.f2.f3.chat Head.Chat | |
572 | ||
573 | entry $win.col1.w1.f2.f3.entry \ | |
574 | -relief sunken\ | |
575 | -text {}\ | |
576 | -foreground #ffffff\ | |
577 | -background #4f4f4f\ | |
578 | -textvariable $win.col1.w1.f2.f3.entry.value\ | |
579 | -font [Font $win Message] | |
580 | global $win.col1.w1.f2.f3.entry.value | |
581 | set $win.col1.w1.f2.f3.entry.value "" | |
582 | tk_bindForTraversal $win.col1.w1.f2.f3.entry | |
583 | bind $win.col1.w1.f2.f3.entry <F10> {tk_firstMenu %W} | |
584 | bind $win.col1.w1.f2.f3.entry <Mod2-Key> {tk_traverseToMenu %W %A} | |
585 | bind $win.col1.w1.f2.f3.entry <Return> "DoEnterMessage %W %W.value" | |
586 | bind $win.col1.w1.f2.f3.entry <Escape> "DoEvalMessage %W %W.value" | |
587 | bind $win.col1.w1.f2.f3.entry <Any-Enter> {focus %W} | |
588 | LinkWindow $win.entry $win.col1.w1.f2.f3.entry | |
589 | ||
590 | SetHelp $win.col1.w1.f2.f3.entry Head.Entry | |
591 | } | |
592 | ||
593 | frame $win.col1.w2 | |
594 | tk_bindForTraversal $win.col1.w2 | |
595 | ||
596 | LinkWindow $win.w2 $win.col1.w2 | |
597 | ||
598 | frame $win.col1.w3 | |
599 | tk_bindForTraversal $win.col1.w3 | |
600 | ||
601 | LinkWindow $win.w3 $win.col1.w3 | |
602 | ||
603 | frame $win.col2 | |
604 | tk_bindForTraversal $win.col2 | |
605 | ||
606 | LinkWindow $win.col2 $win.col2 | |
607 | ||
608 | #frame $win.col2.x1 -width 400 -height 400 | |
609 | #tk_bindForTraversal $win.col2.x1 | |
610 | ||
611 | #LinkWindow $win.x1 $win.col2.x1 | |
612 | ||
613 | #frame $win.col2.x2 | |
614 | #tk_bindForTraversal $win.col2.x2 | |
615 | ||
616 | #LinkWindow $win.x2 $win.col2.x2 | |
617 | ||
618 | #frame $win.col2.x3 | |
619 | #tk_bindForTraversal $win.col2.x3 | |
620 | ||
621 | #LinkWindow $win.x3 $win.col2.x3 | |
622 | ||
623 | #frame $win.col2.x4 | |
624 | #tk_bindForTraversal $win.col2.x4 | |
625 | ||
626 | #LinkWindow $win.x4 $win.col2.x4 | |
627 | ||
628 | if {[sim MultiPlayerMode]} { | |
629 | ||
630 | pack append $win.col1.w1.f2.f3 \ | |
631 | $win.col1.w1.f2.f3.chat {left frame center padx 4} \ | |
632 | $win.col1.w1.f2.f3.entry {left frame center fillx expand padx 4} | |
633 | ||
634 | pack append $win.col1.w1.f2 \ | |
635 | $win.col1.w1.f2.f1 {top frame center fillx} \ | |
636 | $win.col1.w1.f2.f2 {top frame center expand fill} \ | |
637 | $win.col1.w1.f2.f3 {top frame center fillx} | |
638 | ||
639 | } else { | |
640 | ||
641 | pack append $win.col1.w1.f2 \ | |
642 | $win.col1.w1.f2.f1 {top frame center fillx} \ | |
643 | $win.col1.w1.f2.f2 {top frame center expand fill} | |
644 | ||
645 | } | |
646 | ||
647 | pack append $win.col1.w1\ | |
648 | $win.col1.w1.f1 {top frame center fillx} \ | |
649 | $win.col1.w1.f2 {top frame center expand fill} | |
650 | ||
651 | #pack append $win\ | |
652 | # $win.col1 {left frame center filly} \ | |
653 | # $win.col2 {left frame center expand fill} | |
654 | ||
655 | place configure $win.col1\ | |
656 | -x 0\ | |
657 | -y 0\ | |
658 | -width $HeadPanelWidth\ | |
659 | -height $screenheight | |
660 | ||
661 | pack append $win.col1\ | |
662 | $win.col1.w1 {top frame nw fillx} \ | |
663 | $win.col1.w2 {top frame nw fillx} \ | |
664 | $win.col1.w3 {bottom frame sw fillx} | |
665 | ||
666 | #place configure $win.col1.w1\ | |
667 | # -x 0\ | |
668 | # -y 0\ | |
669 | # -width $HeadPanelWidth\ | |
670 | # -height $HeadPanelHeight | |
671 | ||
672 | #place configure $win.col1.w2\ | |
673 | # -x 0\ | |
674 | # -y $HeadPanelHeight\ | |
675 | # -width $MapPanelWidth\ | |
676 | # -height $MapPanelHeight | |
677 | ||
678 | #place configure $win.col1.w3\ | |
679 | # -x 0\ | |
680 | # -y [expr "$HeadPanelHeight + $MapPanelHeight"]\ | |
681 | # -width $NoticePanelWidth\ | |
682 | # -height [expr "$screenheight - ($HeadPanelHeight + $MapPanelHeight)"] | |
683 | ||
684 | place configure $win.col2\ | |
685 | -x [expr "$HeadPanelWidth + 5"]\ | |
686 | -y 0\ | |
2b896476 | 687 | -relheight 1.0\ |
cac78bde MG |
688 | -width [expr "($screenwidth - $HeadPanelWidth) - 5"] |
689 | ||
690 | proc resizeeditor {win width} { | |
691 | global HeadPanelWidth | |
692 | ||
693 | place configure $win.col2\ | |
694 | -width [expr "($width - $HeadPanelWidth) - 5"] | |
695 | } | |
696 | ||
697 | bind $win <Configure> "resizeeditor $win %w" | |
6a5fa4e0 MG |
698 | |
699 | #pack append $win.col2\ | |
700 | # $win.col2.x1 {top frame nw fillx} \ | |
701 | # $win.col2.x2 {top frame nw fillx} \ | |
702 | # $win.col2.x3 {top frame nw expand fill} \ | |
703 | # $win.col2.x4 {top frame nw fillx} | |
704 | ||
705 | SetupSoundServer $win | |
706 | ||
707 | InitHead $win | |
708 | InitHeadMenus $win | |
709 | ||
710 | update idletasks |