1 # Window: Budget, for Unix Micropolis
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.
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.
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/>.
21 # ADDITIONAL TERMS per GNU GPL Section 7
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.
29 # Any propagation or conveyance of this program must include this
30 # copyright notice and these terms.
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.
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.
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
64 set BudgetWindows
[linsert $BudgetWindows 0 $win]
66 LinkWindow
$head.budget
$win
67 LinkWindow
$win.head
$head
70 toplevel $win -screen $display
74 global [set var
$win.visible
]
77 wm title
$win {Micropolis Budget
}
78 wm iconname
$win {Micropolis Budget
}
80 wm geometry
$win 600x600
+5+5
81 wm positionfrom
$win user
82 wm maxsize
$win 700 700
83 wm minsize
$win 150 200
84 wm protocol
$win delete
"BudgetCancel"
85 wm transient
$win $head
90 -font [Font
$win Large
]\
91 -text {Micropolis has paused to
set the budget...
}
93 SetHelp
$win.
label Budget.Label
95 frame $win.rightframe
\
98 frame $win.rightframe.roadframe
\
102 SetHelp
$win.rightframe.roadframe Budget.Road
104 label $win.rightframe.roadframe.
label\
106 -font [Font
$win Large
]\
109 frame $win.rightframe.roadframe.
frame\
112 LinkWindow
$win.road
$win.rightframe.roadframe.
frame
114 label $win.rightframe.roadframe.
frame.request
\
116 -font [Font
$win Medium
]\
117 -text {100% of
$0 = $0}
119 scale $win.rightframe.roadframe.
frame.fund
\
120 -command {BudgetSetRoadFund
}\
121 -font [Font
$win Medium
]\
128 pack 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
}
132 pack append $win.rightframe.roadframe
\
133 $win.rightframe.roadframe.
label {top
frame center fillx
} \
134 $win.rightframe.roadframe.
frame {top
frame center expand fill
}
137 frame $win.rightframe.fireframe
\
141 SetHelp
$win.rightframe.fireframe Budget.Fire
143 label $win.rightframe.fireframe.
label\
144 -font [Font
$win Large
]\
148 frame $win.rightframe.fireframe.
frame\
151 LinkWindow
$win.fire
$win.rightframe.fireframe.
frame
153 label $win.rightframe.fireframe.
frame.request
\
155 -font [Font
$win Medium
]\
156 -text {100% of
$0 = $0}
158 scale $win.rightframe.fireframe.
frame.fund
\
159 -command {BudgetSetFireFund
}\
160 -font [Font
$win Medium
]\
167 pack 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
}
171 pack append $win.rightframe.fireframe
\
172 $win.rightframe.fireframe.
label {top
frame center fillx
} \
173 $win.rightframe.fireframe.
frame {top
frame center expand fill
}
176 frame $win.rightframe.policeframe
\
180 SetHelp
$win.rightframe.policeframe Budget.Police
182 label $win.rightframe.policeframe.
label\
184 -font [Font
$win Large
]\
187 frame $win.rightframe.policeframe.
frame\
190 LinkWindow
$win.police
$win.rightframe.policeframe.
frame
192 label $win.rightframe.policeframe.
frame.request
\
194 -font [Font
$win Medium
]\
195 -text {100% of
$0 = $0}
197 scale $win.rightframe.policeframe.
frame.fund
\
198 -command {BudgetSetPoliceFund
}\
199 -font [Font
$win Medium
]\
206 pack 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
}
210 pack append $win.rightframe.policeframe
\
211 $win.rightframe.policeframe.
label {top
frame center fillx
} \
212 $win.rightframe.policeframe.
frame {top
frame center expand fill
}
215 frame $win.rightframe.taxrateframe
\
219 SetHelp
$win.rightframe.taxrateframe Budget.Tax
221 label $win.rightframe.taxrateframe.
label\
223 -font [Font
$win Large
]\
226 frame $win.rightframe.taxrateframe.
frame\
230 label $win.rightframe.taxrateframe.
frame.rate
\
232 -font [Font
$win Medium
]\
234 LinkWindow
$win.taxlabel
$win.rightframe.taxrateframe.
frame.rate
236 scale $win.rightframe.taxrateframe.
frame.
scale\
237 -command {BudgetSetTaxRate
}\
238 -font [Font
$win Medium
]\
244 LinkWindow
$win.taxrate
$win.rightframe.taxrateframe.
frame.
scale
246 pack 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
}
250 pack append $win.rightframe.taxrateframe
\
251 $win.rightframe.taxrateframe.
label {top
frame center fillx
} \
252 $win.rightframe.taxrateframe.
frame {top
frame center expand fill
}
255 pack 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
}
262 frame $win.leftframe
\
265 frame $win.leftframe.collectedframe
\
269 SetHelp
$win.leftframe.collectedframe Budget.Collected
271 label $win.leftframe.collectedframe.
label\
273 -font [Font
$win Large
]\
274 -text {Taxes Collected
}
276 label $win.leftframe.collectedframe.value
\
278 -font [Font
$win Medium
]\
280 LinkWindow
$win.collected
$win.leftframe.collectedframe.value
282 pack append $win.leftframe.collectedframe
\
283 $win.leftframe.collectedframe.
label {top
frame center fillx
} \
284 $win.leftframe.collectedframe.value
{top
frame center expand fill
}
286 frame $win.leftframe.cashflowframe
\
289 LinkWindow
$win.cashflow
$win.leftframe.cashflowframe.value
291 SetHelp
$win.leftframe.cashflowframe Budget.Flow
293 label $win.leftframe.cashflowframe.
label\
295 -font [Font
$win Large
]\
298 label $win.leftframe.cashflowframe.value
\
300 -font [Font
$win Medium
]\
303 pack append $win.leftframe.cashflowframe
\
304 $win.leftframe.cashflowframe.
label {top
frame center fillx
} \
305 $win.leftframe.cashflowframe.value
{top
frame center expand fill
}
307 frame $win.leftframe.previousframe
\
310 LinkWindow
$win.previous
$win.leftframe.previousframe.value
312 SetHelp
$win.leftframe.previousframe Budget.Previous
314 label $win.leftframe.previousframe.
label\
316 -font [Font
$win Large
]\
317 -text {Previous Funds
}
319 label $win.leftframe.previousframe.value
\
321 -font [Font
$win Medium
]\
324 pack append $win.leftframe.previousframe
\
325 $win.leftframe.previousframe.
label {top
frame center fillx
} \
326 $win.leftframe.previousframe.value
{top
frame center expand fill
}
328 frame $win.leftframe.currentframe
\
331 LinkWindow
$win.current
$win.leftframe.currentframe.value
333 SetHelp
$win.leftframe.currentframe Budget.Current
335 label $win.leftframe.currentframe.
label\
337 -font [Font
$win Large
]\
338 -text {Current Funds
}
340 label $win.leftframe.currentframe.value
\
342 -font [Font
$win Medium
]\
345 pack append $win.leftframe.currentframe
\
346 $win.leftframe.currentframe.
label {top
frame center fillx
} \
347 $win.leftframe.currentframe.value
{top
frame center expand fill
}
349 pack 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
}
355 frame $win.bottomframe
\
358 frame $win.bottomframe.voteframe
\
361 LinkWindow
$win.voteframe
$win.bottomframe.voteframe
363 button $win.bottomframe.voteframe.
continue\
364 -text {Continue With These Figures
}\
365 -font [Font
$win Large
]\
367 -command "DoVote $win Budget BudgetContinue {}"
368 LinkWindow
$win.vote
$win.bottomframe.voteframe.
continue
370 SetHelp
$win.bottomframe.voteframe Budget.Continue
372 pack append $win.bottomframe.voteframe
\
373 $win.bottomframe.voteframe.
continue {top
frame center fillx
}
375 BindVotingButton
$win $win.bottomframe.voteframe.
continue Budget
377 button $win.bottomframe.reset
\
378 -text {Reset to Original Figures
}\
379 -font [Font
$win Large
]\
380 -command "BudgetReset"
382 SetHelp
$win.bottomframe.reset Budget.Reset
384 button $win.bottomframe.cancel
\
385 -text {Cancel Changes and Continue
}\
386 -font [Font
$win Large
]\
387 -command "BudgetCancel"
389 SetHelp
$win.bottomframe.cancel Budget.Cancel
391 button $win.bottomframe.timer
\
392 -text {Timeout in
0 seconds ...
}\
393 -font [Font
$win Large
]\
394 -command "ToggleBudgetTimer"
395 LinkWindow
$win.timer
$win.bottomframe.timer
397 SetHelp
$win.bottomframe.timer Budget.AutoCancel
399 button $win.bottomframe.autobudget
\
400 -text {Enable Auto Budget
}\
401 -font [Font
$win Large
]\
402 -command "ToggleAutoBudget"
403 LinkWindow
$win.autobudget
$win.bottomframe.autobudget
405 SetHelp
$win.bottomframe.autobudget Budget.AutoBudget
407 pack 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
}
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
}