]> git.zerfleddert.de Git - micropolis/blame - res/wbudget.tcl
src/sim/makefile: Micropolis build fixes for recent macOS
[micropolis] / res / wbudget.tcl
CommitLineData
6a5fa4e0
MG
1# Window: Budget, 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 BudgetWindows
62set n [Unique]
63set win .budget$n
64set BudgetWindows [linsert $BudgetWindows 0 $win]
65
66LinkWindow $head.budget $win
67LinkWindow $win.head $head
68
69catch "destroy $win"
70toplevel $win -screen $display
71
72SetHelp $win Budget
73
74global [set var $win.visible]
75set $var 0
76
77wm title $win {Micropolis Budget}
78wm iconname $win {Micropolis Budget}
79wm group $win $head
80wm geometry $win 600x600+5+5
81wm positionfrom $win user
82wm maxsize $win 700 700
83wm minsize $win 150 200
84wm protocol $win delete "BudgetCancel"
85wm transient $win $head
86
87label $win.label\
88 -borderwidth 1\
89 -relief raised\
90 -font [Font $win Large]\
91 -text {Micropolis has paused to set the budget...}
92
93SetHelp $win.label Budget.Label
94
95frame $win.rightframe\
96 -borderwidth 0
97
98frame $win.rightframe.roadframe\
99 -borderwidth 1\
100 -relief raised
101
102SetHelp $win.rightframe.roadframe Budget.Road
103
104label $win.rightframe.roadframe.label\
105 -relief flat\
106 -font [Font $win Large]\
107 -text { Road Fund }
108
109frame $win.rightframe.roadframe.frame\
110 -borderwidth 2\
111 -relief flat
112LinkWindow $win.road $win.rightframe.roadframe.frame
113
114label $win.rightframe.roadframe.frame.request\
115 -relief flat\
116 -font [Font $win Medium]\
117 -text {100% of $0 = $0}
118
119scale $win.rightframe.roadframe.frame.fund\
120 -command {BudgetSetRoadFund}\
121 -font [Font $win Medium]\
122 -orient horizontal\
123 -showvalue false\
124 -sliderlength 15\
125 -to 100\
126 -width 10
127
128pack append $win.rightframe.roadframe.frame\
129 $win.rightframe.roadframe.frame.fund {top frame center expand fill} \
130 $win.rightframe.roadframe.frame.request {top frame center expand fill}
131
132pack append $win.rightframe.roadframe\
133 $win.rightframe.roadframe.label {top frame center fillx} \
134 $win.rightframe.roadframe.frame {top frame center expand fill}
135
136
137frame $win.rightframe.fireframe\
138 -borderwidth 1\
139 -relief raised
140
141SetHelp $win.rightframe.fireframe Budget.Fire
142
143label $win.rightframe.fireframe.label\
144 -font [Font $win Large]\
145 -relief flat\
146 -text {Fire Fund}
147
148frame $win.rightframe.fireframe.frame\
149 -borderwidth 2\
150 -relief flat
151LinkWindow $win.fire $win.rightframe.fireframe.frame
152
153label $win.rightframe.fireframe.frame.request\
154 -relief flat\
155 -font [Font $win Medium]\
156 -text {100% of $0 = $0}
157
158scale $win.rightframe.fireframe.frame.fund\
159 -command {BudgetSetFireFund}\
160 -font [Font $win Medium]\
161 -orient horizontal\
162 -showvalue false\
163 -sliderlength 15\
164 -to 100\
165 -width 10
166
167pack append $win.rightframe.fireframe.frame\
168 $win.rightframe.fireframe.frame.fund {top frame center expand fill} \
169 $win.rightframe.fireframe.frame.request {top frame center expand fill}
170
171pack append $win.rightframe.fireframe\
172 $win.rightframe.fireframe.label {top frame center fillx} \
173 $win.rightframe.fireframe.frame {top frame center expand fill}
174
175
176frame $win.rightframe.policeframe\
177 -borderwidth 1\
178 -relief raised
179
180SetHelp $win.rightframe.policeframe Budget.Police
181
182label $win.rightframe.policeframe.label\
183 -relief flat\
184 -font [Font $win Large]\
185 -text {Police Fund}
186
187frame $win.rightframe.policeframe.frame\
188 -borderwidth 2\
189 -relief flat
190LinkWindow $win.police $win.rightframe.policeframe.frame
191
192label $win.rightframe.policeframe.frame.request\
193 -relief flat\
194 -font [Font $win Medium]\
195 -text {100% of $0 = $0}
196
197scale $win.rightframe.policeframe.frame.fund\
198 -command {BudgetSetPoliceFund}\
199 -font [Font $win Medium]\
200 -orient horizontal\
201 -showvalue false\
202 -sliderlength 15\
203 -to 100\
204 -width 10
205
206pack append $win.rightframe.policeframe.frame\
207 $win.rightframe.policeframe.frame.fund {top frame center expand fill}\
208 $win.rightframe.policeframe.frame.request {top frame center expand fill}
209
210pack append $win.rightframe.policeframe\
211 $win.rightframe.policeframe.label {top frame center fillx} \
212 $win.rightframe.policeframe.frame {top frame center expand fill}
213
214
215frame $win.rightframe.taxrateframe\
216 -borderwidth 1\
217 -relief raised
218
219SetHelp $win.rightframe.taxrateframe Budget.Tax
220
221label $win.rightframe.taxrateframe.label\
222 -relief flat\
223 -font [Font $win Large]\
224 -text {Tax Rate}
225
226frame $win.rightframe.taxrateframe.frame\
227 -borderwidth 2\
228 -relief flat
229
230label $win.rightframe.taxrateframe.frame.rate\
231 -relief flat\
232 -font [Font $win Medium]\
233 -text {7%}
234LinkWindow $win.taxlabel $win.rightframe.taxrateframe.frame.rate
235
236scale $win.rightframe.taxrateframe.frame.scale\
237 -command {BudgetSetTaxRate}\
238 -font [Font $win Medium]\
239 -orient horizontal\
240 -showvalue false\
241 -sliderlength 15\
242 -to 20\
243 -width 10
244LinkWindow $win.taxrate $win.rightframe.taxrateframe.frame.scale
245
246pack append $win.rightframe.taxrateframe.frame\
247 $win.rightframe.taxrateframe.frame.scale {top frame center expand fill}\
248 $win.rightframe.taxrateframe.frame.rate {top frame center expand fill}
249
250pack append $win.rightframe.taxrateframe\
251 $win.rightframe.taxrateframe.label {top frame center fillx} \
252 $win.rightframe.taxrateframe.frame {top frame center expand fill}
253
254
255pack append $win.rightframe\
256 $win.rightframe.roadframe {top frame center expand fill} \
257 $win.rightframe.fireframe {top frame center expand fill} \
258 $win.rightframe.policeframe {top frame center expand fill} \
259 $win.rightframe.taxrateframe {top frame center expand fill}
260
261
262frame $win.leftframe\
263 -borderwidth 0
264
265frame $win.leftframe.collectedframe\
266 -borderwidth 1\
267 -relief raised
268
269SetHelp $win.leftframe.collectedframe Budget.Collected
270
271label $win.leftframe.collectedframe.label\
272 -relief flat\
273 -font [Font $win Large]\
274 -text {Taxes Collected}
275
276label $win.leftframe.collectedframe.value\
277 -relief flat\
278 -font [Font $win Medium]\
279 -text {$0}
280LinkWindow $win.collected $win.leftframe.collectedframe.value
281
282pack append $win.leftframe.collectedframe\
283 $win.leftframe.collectedframe.label {top frame center fillx} \
284 $win.leftframe.collectedframe.value {top frame center expand fill}
285
286frame $win.leftframe.cashflowframe\
287 -borderwidth 1\
288 -relief raised
289LinkWindow $win.cashflow $win.leftframe.cashflowframe.value
290
291SetHelp $win.leftframe.cashflowframe Budget.Flow
292
293label $win.leftframe.cashflowframe.label\
294 -relief flat\
295 -font [Font $win Large]\
296 -text {Cash Flow}
297
298label $win.leftframe.cashflowframe.value\
299 -relief flat\
300 -font [Font $win Medium]\
301 -text {+$0}
302
303pack append $win.leftframe.cashflowframe\
304 $win.leftframe.cashflowframe.label {top frame center fillx} \
305 $win.leftframe.cashflowframe.value {top frame center expand fill}
306
307frame $win.leftframe.previousframe\
308 -borderwidth 1\
309 -relief raised
310LinkWindow $win.previous $win.leftframe.previousframe.value
311
312SetHelp $win.leftframe.previousframe Budget.Previous
313
314label $win.leftframe.previousframe.label\
315 -relief flat\
316 -font [Font $win Large]\
317 -text {Previous Funds}
318
319label $win.leftframe.previousframe.value\
320 -relief flat\
321 -font [Font $win Medium]\
322 -text {$0}
323
324pack append $win.leftframe.previousframe\
325 $win.leftframe.previousframe.label {top frame center fillx} \
326 $win.leftframe.previousframe.value {top frame center expand fill}
327
328frame $win.leftframe.currentframe\
329 -borderwidth 1\
330 -relief raised
331LinkWindow $win.current $win.leftframe.currentframe.value
332
333SetHelp $win.leftframe.currentframe Budget.Current
334
335label $win.leftframe.currentframe.label\
336 -relief flat\
337 -font [Font $win Large]\
338 -text {Current Funds}
339
340label $win.leftframe.currentframe.value\
341 -relief flat\
342 -font [Font $win Medium]\
343 -text {$0}
344
345pack append $win.leftframe.currentframe\
346 $win.leftframe.currentframe.label {top frame center fillx} \
347 $win.leftframe.currentframe.value {top frame center expand fill}
348
349pack append $win.leftframe\
350 $win.leftframe.collectedframe {top frame center expand fill} \
351 $win.leftframe.cashflowframe {top frame center expand fill} \
352 $win.leftframe.previousframe {top frame center expand fill} \
353 $win.leftframe.currentframe {top frame center expand fill}
354
355frame $win.bottomframe\
356 -borderwidth 0
357
358frame $win.bottomframe.voteframe \
359 -borderwidth 0 \
360 -relief raised
361LinkWindow $win.voteframe $win.bottomframe.voteframe
362
363button $win.bottomframe.voteframe.continue\
364 -text {Continue With These Figures}\
365 -font [Font $win Large]\
366 -relief raised \
367 -command "DoVote $win Budget BudgetContinue {}"
368LinkWindow $win.vote $win.bottomframe.voteframe.continue
369
370SetHelp $win.bottomframe.voteframe Budget.Continue
371
372pack append $win.bottomframe.voteframe\
373 $win.bottomframe.voteframe.continue {top frame center fillx}
374
375BindVotingButton $win $win.bottomframe.voteframe.continue Budget
376
377button $win.bottomframe.reset\
378 -text {Reset to Original Figures}\
379 -font [Font $win Large]\
380 -command "BudgetReset"
381
382SetHelp $win.bottomframe.reset Budget.Reset
383
384button $win.bottomframe.cancel\
385 -text {Cancel Changes and Continue}\
386 -font [Font $win Large]\
387 -command "BudgetCancel"
388
389SetHelp $win.bottomframe.cancel Budget.Cancel
390
391button $win.bottomframe.timer\
392 -text {Timeout in 0 seconds ...}\
393 -font [Font $win Large]\
394 -command "ToggleBudgetTimer"
395LinkWindow $win.timer $win.bottomframe.timer
396
397SetHelp $win.bottomframe.timer Budget.AutoCancel
398
399button $win.bottomframe.autobudget\
400 -text {Enable Auto Budget}\
401 -font [Font $win Large]\
402 -command "ToggleAutoBudget"
403LinkWindow $win.autobudget $win.bottomframe.autobudget
404
405SetHelp $win.bottomframe.autobudget Budget.AutoBudget
406
407pack append $win.bottomframe\
408 $win.bottomframe.voteframe {top frame center expand fillx}\
409 $win.bottomframe.reset {top frame center expand fillx}\
410 $win.bottomframe.cancel {top frame center expand fillx}\
411 $win.bottomframe.timer {top frame center expand fillx}\
412 $win.bottomframe.autobudget {top frame center expand fillx}
413
414pack append $win\
415 $win.label {top frame center fillx} \
416 $win.bottomframe {bottom frame center fillx} \
417 $win.leftframe {left frame center expand fill} \
418 $win.rightframe {right frame center expand fill}
419
420sim UpdateBudget
421
422update idletasks
423
Impressum, Datenschutz