1 # Window: Player evaluation, 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
61 global EvaluationWindows
63 set parent
[WindowLink
$head.col2
]
64 set win
$parent.evaluation
$n
65 set EvaluationWindows
[linsert $EvaluationWindows 0 $win]
67 LinkWindow
$head.evaluation
$win
68 LinkWindow
$win.head
$head
69 LinkWindow
$win.parent
$parent
70 LinkWindow
$win.top
$win
75 SetHelp
$win Evaluation
77 global [set var
$win.visible
]
80 bind $win <Visibility
> {EvaluationVisible
%W
[string compare
%s FullyObscured
]}
81 bind $win <Map
> {EvaluationVisible
%W
1}
82 bind $win <Unmap
> {EvaluationVisible
%W
0}
84 #wm title $win {Micropolis Evaluation}
85 #wm iconname $win {Micropolis Evaluation}
87 #wm geometry $win 480x240+5-5
89 #wm maxsize $win 700 700
90 #wm minsize $win 400 200
91 #wm protocol $win delete "DeleteWindow evaluation EvaluationWindows"
98 SetHelp
$win.leftframe Evaluation.Opinion
100 label $win.leftframe.title
\
101 -font [Font
$win Big
]\
104 -text {Public Opinion
}\
107 label $win.leftframe.isthe
\
108 -font [Font
$win Large
]\
109 -text {Is the mayor doing a good job?
}
111 SetHelp
$win.leftframe.isthe Evaluation.GoodJob
113 frame $win.leftframe.goodjobframe
\
116 SetHelp
$win.leftframe.goodjobframe Evaluation.GoodJob
118 message $win.leftframe.goodjobframe.yesno
\
123 -font [Font
$win Medium
]\
127 message $win.leftframe.goodjobframe.percents
\
132 -font [Font
$win Medium
]\
135 LinkWindow
$win.goodjob
$win.leftframe.goodjobframe.percents
137 pack append $win.leftframe.goodjobframe
\
138 $win.leftframe.goodjobframe.percents
{right
frame w expand
} \
139 $win.leftframe.goodjobframe.yesno
{right
frame e expand
}
141 label $win.leftframe.whatare
\
142 -font [Font
$win Large
]\
143 -text {What are the worst problems?
}
145 SetHelp
$win.leftframe.whatare Evaluation.WorstProblems
147 frame $win.leftframe.worstproblems
\
150 SetHelp
$win.leftframe.worstproblems Evaluation.WorstProblems
152 message $win.leftframe.worstproblems.problemnames
\
157 -font [Font
$win Medium
]\
163 LinkWindow
$win.problemnames
$win.leftframe.worstproblems.problemnames
165 message $win.leftframe.worstproblems.problempercents
\
170 -font [Font
$win Medium
]\
176 LinkWindow
$win.problempercents
$win.leftframe.worstproblems.problempercents
178 pack append $win.leftframe.worstproblems
\
179 $win.leftframe.worstproblems.problempercents
{right
frame w expand
} \
180 $win.leftframe.worstproblems.problemnames
{right
frame e expand
}
182 pack append $win.leftframe
\
183 $win.leftframe.title
{top
frame center fillx expand
} \
184 $win.leftframe.isthe
{top
frame center fillx expand
} \
185 $win.leftframe.goodjobframe
{top
frame center fillx expand
} \
186 $win.leftframe.whatare
{top
frame center fillx expand
} \
187 $win.leftframe.worstproblems
{top
frame center fillx expand
}
189 frame $win.rightframe
\
193 SetHelp
$win.rightframe Evaluation.Statistics
195 label $win.rightframe.title
\
196 -font [Font
$win Big
]\
202 frame $win.rightframe.statsframe
\
205 message $win.rightframe.statsframe.statlabels
\
210 -font [Font
$win Medium
]\
218 message $win.rightframe.statsframe.stats
\
223 -font [Font
$win Medium
]\
230 LinkWindow
$win.stats
$win.rightframe.statsframe.stats
232 pack append $win.rightframe.statsframe
\
233 $win.rightframe.statsframe.statlabels
{left
frame e expand
} \
234 $win.rightframe.statsframe.stats
{right
frame w expand
}
236 message $win.rightframe.cityscore
\
241 -font [Font
$win Medium
]\
242 -text {Overall City Score
245 SetHelp
$win.rightframe.cityscore Evaluation.Score
247 frame $win.rightframe.scoreframe
\
250 SetHelp
$win.rightframe.scoreframe Evaluation.Score
252 message $win.rightframe.scoreframe.scorelabels
\
257 -font [Font
$win Medium
]\
258 -text {Current Score
:
261 message $win.rightframe.scoreframe.scores
\
266 -font [Font
$win Medium
]\
270 LinkWindow
$win.score
$win.rightframe.scoreframe.scores
272 pack append $win.rightframe.scoreframe
\
273 $win.rightframe.scoreframe.scorelabels
{left
frame e expand
} \
274 $win.rightframe.scoreframe.scores
{right
frame w expand
}
276 pack append $win.rightframe
\
277 $win.rightframe.title
{top
frame center fillx expand
} \
278 $win.rightframe.statsframe
{top
frame center fillx expand
} \
279 $win.rightframe.cityscore
{top
frame center fillx expand
} \
280 $win.rightframe.scoreframe
{top
frame center fillx expand
}
282 frame $win.bottomframe
\
285 SetHelp
$win.bottomframe Evaluation.Dismiss
287 button $win.bottomframe.
button\
288 -font [Font
$win Large
]\
289 -text {Dismiss Evaluation
}\
290 -command "pack unpack $win"
292 pack append $win.bottomframe
\
293 $win.bottomframe.
button {top
frame center expand fillx
}
296 $win.bottomframe
{bottom
frame center fillx
}\
297 $win.leftframe
{left
frame center expand fill
} \
298 $win.rightframe
{right
frame center expand fill
}