|
|
1.1 root 1: # Window: Graphs of money, crime, etc, 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 [email protected].
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 GraphWindows
62: set n [Unique]
63: set parent [WindowLink $head.col2]
64: set win $parent.graph$n
65: set GraphWindows [linsert $GraphWindows 0 $win]
66:
67: LinkWindow $head.graph $win
68: LinkWindow $win.head $head
69: LinkWindow $win.parent $parent
70: LinkWindow $win.top $win
71:
72: catch "destroy $win"
73: frame $win
74:
75: SetHelp $win Graph
76:
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}
80:
81: #wm title $win {Micropolis Graph}
82: #wm iconname $win {Micropolis Graph}
83: #wm group $win $head
84: #wm geometry $win 550x200+440+730
85: #wm positionfrom $win user
86: #wm withdraw $win
87: #wm maxsize $win 1000 500
88: #wm minsize $win 150 85
89: #wm protocol $win delete "DeleteWindow graph GraphWindows"
90:
91:
92: frame $win.centerframe\
93: -borderwidth 1\
94: -relief raised
95:
96: SetHelp $win.centerframe Graph.View
97:
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
102:
103: pack append $win.centerframe\
104: $win.centerframe.graph {top frame center fill expand}
105:
106: frame $win.leftframe\
107: -borderwidth 1\
108: -relief raised
109:
110: frame $win.leftframe.left\
111: -borderwidth 0
112:
113: button $win.leftframe.left.res\
114: -bitmap "@images/grres.xpm"\
115: -font [Font $win Medium]\
116: -borderwidth 0\
117: -relief flat\
118: -padx 0\
119: -pady 0\
120: -text {}\
121: -command "GraphPallet $win 0"
122:
123: SetHelp $win.leftframe.left.res Graph.Res
124:
125: button $win.leftframe.left.com\
126: -bitmap "@images/grcom.xpm"\
127: -font [Font $win Medium]\
128: -borderwidth 0\
129: -relief flat\
130: -padx 0\
131: -pady 0\
132: -text {}\
133: -command "GraphPallet $win 1"
134:
135: SetHelp $win.leftframe.left.com Graph.Com
136:
137: button $win.leftframe.left.ind\
138: -bitmap "@images/grind.xpm"\
139: -font [Font $win Medium]\
140: -borderwidth 0\
141: -relief flat\
142: -padx 0\
143: -pady 0\
144: -text {}\
145: -command "GraphPallet $win 2"
146:
147: SetHelp $win.leftframe.left.ind Graph.Ind
148:
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}
153:
154: frame $win.leftframe.right\
155: -borderwidth 0
156:
157: button $win.leftframe.right.money\
158: -bitmap "@images/grmony.xpm"\
159: -font [Font $win Medium]\
160: -borderwidth 0\
161: -relief flat\
162: -padx 0\
163: -pady 0\
164: -text {}\
165: -command "GraphPallet $win 3"
166:
167: SetHelp $win.leftframe.right.money Graph.Money
168:
169: button $win.leftframe.right.crime\
170: -bitmap "@images/grcrim.xpm"\
171: -font [Font $win Medium]\
172: -borderwidth 0\
173: -relief flat\
174: -padx 0\
175: -pady 0\
176: -text {}\
177: -command "GraphPallet $win 4"
178:
179: SetHelp $win.leftframe.right.crime Graph.Crime
180:
181: button $win.leftframe.right.pollution\
182: -bitmap "@images/grpoll.xpm"\
183: -font [Font $win Medium]\
184: -borderwidth 0\
185: -relief flat\
186: -padx 0\
187: -pady 0\
188: -text {}\
189: -command "GraphPallet $win 5"
190:
191: SetHelp $win.leftframe.right.pollution Graph.Pollution
192:
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}
197:
198: frame $win.leftframe.year\
199: -borderwidth 0
200:
201: button $win.leftframe.year.year10\
202: -bitmap "@images/gr10.xpm"\
203: -font [Font $win Medium]\
204: -borderwidth 0\
205: -relief flat\
206: -padx 0\
207: -pady 0\
208: -text {}\
209: -command "GraphYearPallet $win 0"
210:
211: SetHelp $win.leftframe.year.year10 Graph.10Years
212:
213: button $win.leftframe.year.year120\
214: -bitmap "@images/gr120.xpm"\
215: -font [Font $win Medium]\
216: -borderwidth 0\
217: -relief flat\
218: -padx 0\
219: -pady 0\
220: -text {}\
221: -command "GraphYearPallet $win 1"
222:
223: SetHelp $win.leftframe.year.year120 Graph.120Years
224:
225: pack append $win.leftframe.year\
226: $win.leftframe.year.year10 {top frame center} \
227: $win.leftframe.year.year120 {top frame center} \
228:
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} \
233:
234:
235: frame $win.bottomframe\
236: -borderwidth 0
237:
238: SetHelp $win.bottomframe Graph.Dismiss
239:
240: button $win.bottomframe.button\
241: -font [Font $win Large]\
242: -text {Dismiss Graph}\
243: -borderwidth 1 \
244: -command "pack unpack $win"
245:
246: pack append $win.bottomframe\
247: $win.bottomframe.button {top frame center expand fillx}
248:
249: pack append $win\
250: $win.bottomframe {bottom frame center fillx}\
251: $win.leftframe {left frame center filly} \
252: $win.centerframe {right frame center expand fill}
253:
254: InitGraph $win
255:
256: update idletasks
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.