1 # Window: Graphs of money, crime, etc, 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
63 set parent
[WindowLink
$head.col2
]
64 set win
$parent.graph
$n
65 set GraphWindows
[linsert $GraphWindows 0 $win]
67 LinkWindow
$head.graph
$win
68 LinkWindow
$win.head
$head
69 LinkWindow
$win.parent
$parent
70 LinkWindow
$win.top
$win
77 bind $win <Visibility
> {[WindowLink
%W.graphview
] Visible
[string compare
%s FullyObscured
]}
78 bind $win <Map
> {[WindowLink
%W.graphview
] Visible
1}
79 bind $win <Unmap
> {[WindowLink
%W.graphview
] Visible
0}
81 #wm title $win {Micropolis Graph}
82 #wm iconname $win {Micropolis Graph}
84 #wm geometry $win 550x200+440+730
85 #wm positionfrom $win user
87 #wm maxsize $win 1000 500
88 #wm minsize $win 150 85
89 #wm protocol $win delete "DeleteWindow graph GraphWindows"
92 frame $win.centerframe
\
96 SetHelp
$win.centerframe Graph.View
98 graphview
$win.centerframe.graph
\
99 -font [Font
$win Small
]
100 LinkWindow
$win.centerframe.graph.pallet
$win.leftframe
101 LinkWindow
$win.graphview
$win.centerframe.graph
103 pack append $win.centerframe
\
104 $win.centerframe.graph
{top
frame center fill expand
}
106 frame $win.leftframe
\
110 frame $win.leftframe.left
\
113 button $win.leftframe.left.res
\
114 -bitmap "@images/grres.xpm"\
115 -font [Font
$win Medium
]\
121 -command "GraphPallet $win 0"
123 SetHelp
$win.leftframe.left.res Graph.Res
125 button $win.leftframe.left.com
\
126 -bitmap "@images/grcom.xpm"\
127 -font [Font
$win Medium
]\
133 -command "GraphPallet $win 1"
135 SetHelp
$win.leftframe.left.com Graph.Com
137 button $win.leftframe.left.ind
\
138 -bitmap "@images/grind.xpm"\
139 -font [Font
$win Medium
]\
145 -command "GraphPallet $win 2"
147 SetHelp
$win.leftframe.left.ind Graph.Ind
149 pack append $win.leftframe.left
\
150 $win.leftframe.left.res
{top
frame center padx
2 pady
2} \
151 $win.leftframe.left.com
{top
frame center padx
2 pady
2} \
152 $win.leftframe.left.ind
{top
frame center padx
2 pady
2}
154 frame $win.leftframe.right
\
157 button $win.leftframe.right.money
\
158 -bitmap "@images/grmony.xpm"\
159 -font [Font
$win Medium
]\
165 -command "GraphPallet $win 3"
167 SetHelp
$win.leftframe.right.money Graph.Money
169 button $win.leftframe.right.crime
\
170 -bitmap "@images/grcrim.xpm"\
171 -font [Font
$win Medium
]\
177 -command "GraphPallet $win 4"
179 SetHelp
$win.leftframe.right.crime Graph.Crime
181 button $win.leftframe.right.pollution
\
182 -bitmap "@images/grpoll.xpm"\
183 -font [Font
$win Medium
]\
189 -command "GraphPallet $win 5"
191 SetHelp
$win.leftframe.right.pollution Graph.Pollution
193 pack append $win.leftframe.right
\
194 $win.leftframe.right.money
{top
frame center padx
2 pady
2} \
195 $win.leftframe.right.crime
{top
frame center padx
2 pady
2} \
196 $win.leftframe.right.pollution
{top
frame center padx
2 pady
2}
198 frame $win.leftframe.year
\
201 button $win.leftframe.year.year10
\
202 -bitmap "@images/gr10.xpm"\
203 -font [Font
$win Medium
]\
209 -command "GraphYearPallet $win 0"
211 SetHelp
$win.leftframe.year.year10 Graph
.10Years
213 button $win.leftframe.year.year120
\
214 -bitmap "@images/gr120.xpm"\
215 -font [Font
$win Medium
]\
221 -command "GraphYearPallet $win 1"
223 SetHelp
$win.leftframe.year.year120 Graph
.120Years
225 pack append $win.leftframe.year
\
226 $win.leftframe.year.year10
{top
frame center
} \
227 $win.leftframe.year.year120
{top
frame center
} \
229 pack append $win.leftframe
\
230 $win.leftframe.year
{top
frame center padx
2 pady
2} \
231 $win.leftframe.left
{left
frame center
} \
232 $win.leftframe.right
{right
frame center
} \
235 frame $win.bottomframe
\
238 SetHelp
$win.bottomframe Graph.Dismiss
240 button $win.bottomframe.
button\
241 -font [Font
$win Large
]\
242 -text {Dismiss Graph
}\
244 -command "pack unpack $win"
246 pack append $win.bottomframe
\
247 $win.bottomframe.
button {top
frame center expand fillx
}
250 $win.bottomframe
{bottom
frame center fillx
}\
251 $win.leftframe
{left
frame center filly
} \
252 $win.centerframe
{right
frame center expand fill
}