1 # Windows: Maps, 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.w2
] 
  65 set MapWindows 
[linsert $MapWindows 0 $win] 
  70 LinkWindow 
$head.map 
$win 
  71 LinkWindow 
$win.head 
$head 
  72 LinkWindow 
$win.parent 
$parent 
  73 LinkWindow 
$win.top 
$win 
  80 bind $win <Visibility
> {[WindowLink 
%W.view
] Visible 
[string compare 
%s FullyObscured
]} 
  81 bind $win <Map
> {[WindowLink 
%W.view
] Visible 
1} 
  82 bind $win <Unmap
> {[WindowLink 
%W.view
] Visible 
0} 
  84 frame $win.centerframe
\ 
  88 SetHelp 
$win.centerframe Map.View
 
  90 mapview 
$win.centerframe.view
\ 
  91   -font [Font 
$win Large
] 
  92 $win.centerframe.view size 
[expr "[sim WorldX] * 3"] [expr "[sim WorldY] * 3"] 
  94 LinkWindow 
$win.view 
$win.centerframe.view
 
  95 LinkWindow 
$win.centerframe.view.pallet 
$win.topframe
 
  96 LinkWindow 
$win.centerframe.view.win 
$win 
  98 bind $win.centerframe.view 
<1> {MapPanDown 
%W 
%x 
%y
} 
  99 bind $win.centerframe.view 
<B1-Motion
> {MapPanDrag 
%W 
%x 
%y
} 
 100 bind $win.centerframe.view 
<ButtonRelease-1
> {MapPanUp 
%W 
%x 
%y
} 
 102 bind $win.centerframe.view 
<2> {MapPanDown 
%W 
%x 
%y
} 
 103 bind $win.centerframe.view 
<B2-Motion
> {MapPanDrag 
%W 
%x 
%y
} 
 104 bind $win.centerframe.view 
<ButtonRelease-2
> {MapPanUp 
%W 
%x 
%y
} 
 106 bind $win.centerframe.view 
<3> {MapPanDown 
%W 
%x 
%y
} 
 107 bind $win.centerframe.view 
<B3-Motion
> {MapPanDrag 
%W 
%x 
%y
} 
 108 bind $win.centerframe.view 
<ButtonRelease-3
> {MapPanUp 
%W 
%x 
%y
} 
 110 pack append $win.centerframe
\ 
 111   $win.centerframe.view 
{top 
frame center expand
} 
 117 menubutton $win.topframe.zones
\ 
 118   -menu $win.topframe.zones.m
\ 
 120   -font [Font 
$win Medium
]\ 
 121   -variable $win.postedMenu
\ 
 124 LinkWindow 
$win.zones 
$win.topframe.zones
 
 125 tk_bindForTraversal 
$win.topframe.zones
 
 126 bind $win.topframe.zones 
<F10
> {tk_firstMenu 
%W
}  
 127 bind $win.topframe.zones 
<Alt-Key
> {tk_traverseToMenu 
%W 
%A
}  
 128 tk_menus 
$win $win.topframe.zones
 
 130 SetHelp 
$win.topframe.zones Map.Zones
 
 132 menu $win.topframe.zones.m
\ 
 133   -font [Font 
$win Medium
] 
 134 tk_bindForTraversal 
$win.topframe.zones.m
 
 135 bind $win.topframe.zones.m 
<F10
> {tk_firstMenu 
%W
}  
 136 bind $win.topframe.zones.m 
<Alt-Key
> {tk_traverseToMenu 
%W 
%A
}  
 137   $win.topframe.zones.m add 
radiobutton\ 
 139     -variable MapState.
$win\ 
 141     -command "SetMapState $win 0" 
 142   $win.topframe.zones.m add 
radiobutton\ 
 143     -label {Residential
}\ 
 144     -variable MapState.
$win\ 
 146     -command "SetMapState $win 1" 
 147   $win.topframe.zones.m add 
radiobutton\ 
 149     -variable MapState.
$win\ 
 151     -command "SetMapState $win 2" 
 152   $win.topframe.zones.m add 
radiobutton\ 
 154     -variable MapState.
$win\ 
 156     -command "SetMapState $win 3" 
 157   $win.topframe.zones.m add 
radiobutton\ 
 158     -label {Transportation
}\ 
 159     -variable MapState.
$win\ 
 161     -command "SetMapState $win 5" 
 162   # Disabled dynamic filter for now. 
 163   #$win.topframe.zones.m add radiobutton\ 
 165   #  -variable MapState.$win\ 
 167   #  -command "SetMapState $win 14" 
 169 menubutton $win.topframe.overlays
\ 
 170   -menu $win.topframe.overlays.m
\ 
 172   -font [Font 
$win Medium
]\ 
 173   -variable $win.postedMenu
\ 
 176 LinkWindow 
$win.overlays 
$win.topframe.overlays
 
 177 tk_bindForTraversal 
$win.topframe.overlays
 
 178 bind $win.topframe.overlays 
<F10
> {tk_firstMenu 
%W
}  
 179 bind $win.topframe.overlays 
<Alt-Key
> {tk_traverseToMenu 
%W 
%A
}  
 180 tk_menus 
$win $win.topframe.overlays
 
 182 SetHelp 
$win.topframe.overlays Map.Overlays
 
 184 menu $win.topframe.overlays.m
\ 
 185   -font [Font 
$win Medium
] 
 186 tk_bindForTraversal 
$win.topframe.overlays.m
 
 187 bind $win.topframe.overlays.m 
<F10
> {tk_firstMenu 
%W
}  
 188 bind $win.topframe.overlays.m 
<Alt-Key
> {tk_traverseToMenu 
%W 
%A
}  
 189   $win.topframe.overlays.m add 
radiobutton\ 
 190     -label {Population Density
}\ 
 191     -variable MapState.
$win\ 
 193     -command "SetMapState $win 6" 
 194   $win.topframe.overlays.m add 
radiobutton\ 
 195     -label {Rate of Growth
}\ 
 196     -variable MapState.
$win\ 
 198     -command "SetMapState $win 7" 
 199   $win.topframe.overlays.m add 
radiobutton\ 
 201     -variable MapState.
$win\ 
 203     -command "SetMapState $win 11" 
 204   $win.topframe.overlays.m add 
radiobutton\ 
 206     -variable MapState.
$win\ 
 208     -command "SetMapState $win 10" 
 209   $win.topframe.overlays.m add 
radiobutton\ 
 210     -label {Pollution Density
}\ 
 211     -variable MapState.
$win\ 
 213     -command "SetMapState $win 9" 
 214   $win.topframe.overlays.m add 
radiobutton\ 
 215     -label {Traffic Density
}\ 
 216     -variable MapState.
$win\ 
 218     -command "SetMapState $win 8" 
 219   $win.topframe.overlays.m add 
radiobutton\ 
 221     -variable MapState.
$win\ 
 223     -command "SetMapState $win 4" 
 224   $win.topframe.overlays.m add 
radiobutton\ 
 225     -label {Fire Coverage
}\ 
 226     -variable MapState.
$win\ 
 228     -command "SetMapState $win 12" 
 229   $win.topframe.overlays.m add 
radiobutton\ 
 230     -label {Police Coverage
}\ 
 231     -variable MapState.
$win\ 
 233     -command "SetMapState $win 13" 
 235 label $win.topframe.legend
\ 
 236   -bitmap "@images/legendn.xpm" \ 
 237   -font [Font 
$win Medium
] 
 238 LinkWindow 
$win.legend 
$win.topframe.legend
 
 240 pack append $win.topframe
\ 
 241   $win.topframe.zones           
{left 
frame nw
} \ 
 242   $win.topframe.overlays        
{left 
frame nw
} \ 
 243   $win.topframe.legend          
{right 
frame ne
} 
 246   $win.topframe                 
{top 
frame center fillx
} \ 
 247   $win.centerframe              
{top 
frame center fill
} 
 250   $win {top 
frame nw expand fill
}