]> git.zerfleddert.de Git - micropolis/blame - res/wfile.tcl
src/sim/makefile: Micropolis build fixes for recent macOS
[micropolis] / res / wfile.tcl
CommitLineData
6a5fa4e0
MG
1# Window: File Chooser, 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 micropolis@laptop.org.
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.
61global FileWindows
62set n [Unique]
63set win .file$n
64set FileWindows [linsert $FileWindows 0 $win]
65
66LinkWindow $head.file $win
67LinkWindow $win.head $head
68
69catch "destroy $win"
70toplevel $win -screen $display
71
72SetHelp $win File
73
74wm title $win {File Chooser}
75wm iconname $win {File Chooser}
76wm geometry $win 350x480+5+5
77wm positionfrom $win user
78wm sizefrom $win user
79wm maxsize $win 700 700
80wm minsize $win 100 100
81wm protocol $win delete "DeleteWindow file FileWindows"
82wm transient $win $head
83
84# Based on xf file selection box code by:
85# garfield@cs.tu-berlin.de
86# svoboda@transam.ece.cmu.edu (David Svoboda)
87
88message $win.message1 \
89 -aspect 1500 \
90 -anchor n \
91 -justify center \
92 -relief flat \
93 -font [Font $win Large] \
94 -text ""
95
96frame $win.frame1 \
97 -borderwidth 0
98
99button $win.frame1.ok -text {OK} -font [Font $win Large]
100
101SetHelp $win.frame1.ok File.OK
102
103button $win.frame1.rescan -text {Rescan} -font [Font $win Large]
104
105SetHelp $win.frame1.rescan File.Rescan
106
107button $win.frame1.cancel -text {Cancel} -font [Font $win Large]
108
109SetHelp $win.frame1.cancel File.Cancel
110
111frame $win.path \
112 -borderwidth 2 \
113 -relief flat
114
115SetHelp $win.path File.Directory
116
117label $win.path.pathlabel -text {Directory:} -font [Font $win Large]
118entry $win.path.path -relief sunken -font [Font $win Large]
119
120frame $win.files \
121 -borderwidth 2 \
122 -relief flat
123
124SetHelp $win.files File.List
125
126scrollbar $win.files.vscroll \
127 -command "$win.files.files yview"
128
129scrollbar $win.files.hscroll \
130 -orient horizontal \
131 -command "$win.files.files xview"
132
133listbox $win.files.files \
134 -exportselection false \
135 -font [Font $win Large] \
136 -xscrollcommand "$win.files.hscroll set" \
137 -yscrollcommand "$win.files.vscroll set"
138
139pack append $win.files \
140 $win.files.vscroll {left filly} \
141 $win.files.hscroll {bottom fillx} \
142 $win.files.files {left fill expand}
143
144frame $win.file \
145 -borderwidth 2 \
146 -relief flat
147
148SetHelp $win.file File.File
149
150label $win.file.labelfile \
151 -relief flat \
152 -font [Font $win Large] \
153 -text "File:"
154
155entry $win.file.file \
156 -font [Font $win Large] \
157 -relief sunken
158
159pack append $win.file \
160 $win.file.labelfile {left} \
161 $win.file.file {left fill expand}
162
163bind $win.files.files <ButtonPress-1> "FileSelect $win %W %y"
164bind $win.files.files <Button1-Motion> "FileSelect $win %W %y"
165bind $win.files.files <Shift-Button1-Motion> "FileSelect $win %W %y"
166bind $win.files.files <Shift-ButtonPress-1> "FileSelect $win %W %y"
167bind $win.path.path <Tab> "NameComplete $win path"
168catch "bind $win.path.path <Up> {}"
169bind $win.path.path <Down> "
170 $win.file.file cursor 0
171 focus $win.file.file"
172
173bind $win.file.file <Tab> "NameComplete $win file"
174bind $win.file.file <Up> "
175 $win.path.path cursor 0
176 focus $win.path.path"
177catch "bind $win.path.path <Down> {}"
178
179pack append $win.frame1 \
180 $win.frame1.ok {left fill expand} \
181 $win.frame1.rescan {left fill expand} \
182 $win.frame1.cancel {left fill expand}
183pack append $win.path \
184 $win.path.pathlabel {left} \
185 $win.path.path {left fill expand}
186pack append $win \
187 $win.message1 {top fill} \
188 $win.frame1 {bottom fill} \
189 $win.file {bottom fill} \
190 $win.path {bottom fill} \
191 $win.files {left fill expand}
192
193update idletasks
Impressum, Datenschutz