author | Claus Gittinger <cg@exept.de> |
Tue, 19 Jun 2001 17:00:58 +0200 | |
changeset 2375 | 1e3b7281d4ac |
parent 2354 | 373ee1f525e3 |
child 2376 | ec58e7de7023 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1990 by Claus Gittinger |
59 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
2231
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
13 |
"{ Package: 'stx:libwidg' }" |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
14 |
|
0 | 15 |
ListSelectionBox subclass:#FileSelectionBox |
2231
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
16 |
instanceVariableNames:'patternField selectingDirectory allowMakeDirectory' |
1320 | 17 |
classVariableNames:'LastFileSelectionDirectory' |
351 | 18 |
poolDictionaries:'' |
19 |
category:'Views-DialogBoxes' |
|
0 | 20 |
! |
21 |
||
849 | 22 |
!FileSelectionBox class methodsFor:'documentation'! |
7 | 23 |
|
38 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
59 | 27 |
All Rights Reserved |
38 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
7 | 38 |
documentation |
39 |
" |
|
38 | 40 |
this class implements file selection boxes. Instances show a list of |
41 |
files, and perform an action block with the selected pathname as |
|
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
42 |
argument when ok is clicked. It is also possible, to open the box |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
43 |
without action and ask it afterward if it has been left with ok |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
44 |
(i.e. the ST-80 way, asking 'aBox accepted ifTrue:[...]') |
38 | 45 |
|
46 |
There is an optional PatternField, which shows itself when a pattern |
|
47 |
is defined (i.e. if there is no pattern, it is hidden). |
|
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
48 |
If there is a pattern, only files matching the pattern are shown in |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
49 |
the list. Directories are not affected by the patternField. |
38 | 50 |
|
51 |
In addition, there is an optional matchBlock (actually this is defined |
|
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
52 |
in the FileSelectionList). Only names for which this matchblock |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
53 |
returns true will be presented. The matchBlock affects both regular files |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
54 |
and names of directories. The argument passed to the matchBlock is the full |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
55 |
pathname. |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
56 |
|
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
57 |
All of the actual work is done in the fileList; see the documentation |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
58 |
of FileSelectionList for more options |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
59 |
(you can access a boxes fileList via 'aBox>>listView' and get access to all |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
60 |
of those fancy settings) |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
61 |
For example, by accessing the list, it is possible to hide all directories |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
62 |
('aBox listView ignoreDirectories:true'), to hide the parentDirectory alone |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
63 |
('aBox listView ignoreParentDirectory') and to turn off the marking |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
64 |
of subdirectories ('aBox listView markSubdirectories:false'). |
585 | 65 |
|
66 |
[author:] |
|
67 |
Claus Gittinger |
|
68 |
||
69 |
[see also:] |
|
70 |
DialogBox |
|
648 | 71 |
EnterBox2 FilenameEnterBox YesNoBox |
593 | 72 |
ListSelectionBox FileSaveBox |
73 |
FileSelectionList SelectionInListView |
|
62 | 74 |
" |
75 |
! |
|
38 | 76 |
|
62 | 77 |
examples |
78 |
" |
|
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
79 |
simple standard queries |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
80 |
|
238 | 81 |
very simple: |
593 | 82 |
[exBegin] |
351 | 83 |
|name| |
238 | 84 |
|
593 | 85 |
name := FileSelectionBox requestFileName. |
655 | 86 |
Transcript showCR:name |
593 | 87 |
[exEnd] |
38 | 88 |
|
238 | 89 |
|
90 |
simple: |
|
593 | 91 |
[exBegin] |
351 | 92 |
|name| |
238 | 93 |
|
593 | 94 |
name := FileSelectionBox requestFileName:'which file ?'. |
655 | 95 |
Transcript showCR:name |
593 | 96 |
[exEnd] |
38 | 97 |
|
238 | 98 |
|
99 |
with initial selection: |
|
593 | 100 |
[exBegin] |
351 | 101 |
|name| |
238 | 102 |
|
593 | 103 |
name := FileSelectionBox requestFileName:'which file ?' default:'Make.proto'. |
655 | 104 |
Transcript showCR:name |
593 | 105 |
[exEnd] |
38 | 106 |
|
238 | 107 |
|
12 | 108 |
|
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
109 |
more detailed setup |
238 | 110 |
|
111 |
setting title: |
|
593 | 112 |
[exBegin] |
351 | 113 |
|box| |
114 |
box := FileSelectionBox new. |
|
115 |
box title:'Which file ?'. |
|
116 |
box open. |
|
117 |
box accepted ifTrue:[ |
|
1411 | 118 |
Transcript showCR:'you selected: ' , box pathName |
351 | 119 |
] |
593 | 120 |
[exEnd] |
38 | 121 |
|
238 | 122 |
setting a matchpattern: |
593 | 123 |
[exBegin] |
351 | 124 |
|box| |
125 |
box := FileSelectionBox new. |
|
126 |
box title:'Which file ?'. |
|
127 |
box pattern:'*.rc'. |
|
128 |
box open |
|
593 | 129 |
[exEnd] |
351 | 130 |
|
131 |
setting multiple patterns: |
|
593 | 132 |
[exBegin] |
351 | 133 |
|box| |
134 |
box := FileSelectionBox new. |
|
135 |
box title:'Which file ?'. |
|
136 |
box pattern:'*.rc;*.st'. |
|
137 |
box open |
|
593 | 138 |
[exEnd] |
38 | 139 |
|
238 | 140 |
setting a matchblock: |
593 | 141 |
[exBegin] |
351 | 142 |
|box| |
143 |
box := FileSelectionBox new. |
|
144 |
box title:'Which file ?'. |
|
145 |
box directory:'/etc'. |
|
146 |
box pattern:'*'. |
|
147 |
box matchBlock:[:name | name asFilename baseName first between:$a and:$z]. |
|
148 |
box open |
|
593 | 149 |
[exEnd] |
44 | 150 |
|
238 | 151 |
both pattern and matchBlock: |
593 | 152 |
[exBegin] |
351 | 153 |
|box| |
154 |
box := FileSelectionBox new. |
|
155 |
box title:'Which directory ?'. |
|
156 |
box selectingDirectory:true. |
|
157 |
box pattern:'l*'. |
|
158 |
box matchBlock:[:name | OperatingSystem isDirectory:name]. |
|
655 | 159 |
box action:[:fn | Transcript showCR:fn]. |
351 | 160 |
box open |
593 | 161 |
[exEnd] |
238 | 162 |
|
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
163 |
dont show the parent directory: |
593 | 164 |
[exBegin] |
351 | 165 |
|box| |
166 |
box := FileSelectionBox new. |
|
167 |
box title:'Which directory ?'. |
|
168 |
box listView ignoreParentDirectory:true. |
|
169 |
box open |
|
593 | 170 |
[exEnd] |
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
171 |
|
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
172 |
dont show any directory: |
593 | 173 |
[exBegin] |
351 | 174 |
|box| |
175 |
box := FileSelectionBox new. |
|
176 |
box title:'Which file ?'. |
|
177 |
box listView ignoreDirectories:true. |
|
178 |
box open |
|
593 | 179 |
[exEnd] |
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
180 |
|
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
181 |
dont show any directory or hidden file: |
842
a27a1c6ddde0
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
800
diff
changeset
|
182 |
(notice the basename extraction - we are not interested in the full pathName) |
593 | 183 |
[exBegin] |
351 | 184 |
|box| |
185 |
box := FileSelectionBox new. |
|
186 |
box title:'Which file ?'. |
|
187 |
box listView ignoreDirectories:true. |
|
188 |
box matchBlock:[:name | (name asFilename baseName startsWith:'.') not]. |
|
189 |
box open |
|
593 | 190 |
[exEnd] |
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
191 |
|
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
192 |
dont allow direct filename entry: |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
193 |
(i.e. avoid the user choosing files from other directories) |
593 | 194 |
[exBegin] |
351 | 195 |
|box| |
196 |
box := FileSelectionBox new. |
|
197 |
box title:'Which one ?'. |
|
198 |
box enterField beInvisible. |
|
199 |
box open. |
|
200 |
box accepted ifTrue:[ |
|
655 | 201 |
Transcript showCR:'path is ' , box pathName |
351 | 202 |
]. |
593 | 203 |
[exEnd] |
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
204 |
|
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
205 |
combined with above directory ignoring, |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
206 |
this limits selection of files from a single directory: |
593 | 207 |
[exBegin] |
351 | 208 |
|box| |
209 |
box := FileSelectionBox new. |
|
210 |
box title:'Which file ?'. |
|
211 |
box enterField beInvisible. |
|
212 |
box listView ignoreDirectories:true. |
|
213 |
box open. |
|
214 |
box accepted ifTrue:[ |
|
655 | 215 |
Transcript showCR:'path is ' , box pathName |
351 | 216 |
]. |
593 | 217 |
[exEnd] |
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
218 |
|
238 | 219 |
finally, an action: |
593 | 220 |
[exBegin] |
351 | 221 |
|box| |
222 |
box := FileSelectionBox new. |
|
223 |
box title:'Which directory ?'. |
|
224 |
box pattern:'l*'. |
|
225 |
box matchBlock:[:name | OperatingSystem isDirectory:name]. |
|
655 | 226 |
box action:[:name | Transcript showCR:name]. |
351 | 227 |
box open |
593 | 228 |
[exEnd] |
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
229 |
|
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
230 |
concrete examples: |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
231 |
|
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
232 |
only show files beginning with lowercase characters |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
233 |
and ending in '.c': |
593 | 234 |
[exBegin] |
351 | 235 |
|box| |
236 |
box := FileSelectionBox new. |
|
237 |
box title:'Which directory ?'. |
|
238 |
box matchBlock:[:name | |
|
239 |
box pathName asFilename isDirectory |
|
240 |
or:[name first isLowercase |
|
241 |
and:[name endsWith:'.c']] |
|
242 |
]. |
|
243 |
box open. |
|
244 |
box accepted ifTrue:[ |
|
655 | 245 |
Transcript showCR:'full path: ' , box pathName. |
246 |
Transcript showCR:'files name: ' , box fileName. |
|
1643
2710f3be2a77
fixed #fileName - return fileName only (not full path)
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
247 |
Transcript showCR:'directory : ' , box directory pathName. |
351 | 248 |
] |
593 | 249 |
[exEnd] |
7 | 250 |
" |
251 |
! ! |
|
0 | 252 |
|
1320 | 253 |
!FileSelectionBox class methodsFor:'accessing'! |
254 |
||
255 |
lastFileSelectionDirectory |
|
1571
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
256 |
"return the name of the directory used in the previous |
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
257 |
fileSelection dialog. This will be used as default for the next dialog, |
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
258 |
if no explicit path is specified (see requestFileName:* methods)" |
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
259 |
|
1574 | 260 |
|f| |
261 |
||
1571
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
262 |
LastFileSelectionDirectory notNil ifTrue:[ |
1574 | 263 |
((f := LastFileSelectionDirectory asFilename) exists |
264 |
and:[f isDirectory]) ifFalse:[ |
|
265 |
LastFileSelectionDirectory := nil. |
|
266 |
] |
|
1571
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
267 |
]. |
1320 | 268 |
^ LastFileSelectionDirectory |
269 |
||
1571
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
270 |
"Created: / 9.9.1997 / 10:03:17 / cg" |
1574 | 271 |
"Modified: / 16.6.1998 / 15:11:20 / cg" |
1320 | 272 |
! |
273 |
||
274 |
lastFileSelectionDirectory:aDirectoryString |
|
1571
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
275 |
"set the name of the directory used in the previous |
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
276 |
fileSelection dialog. This will be used as default for the next dialog, |
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
277 |
if no explicit path is specified (see requestFileName:* methods)" |
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
278 |
|
1320 | 279 |
LastFileSelectionDirectory := aDirectoryString |
280 |
||
1571
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
281 |
"Created: / 9.9.1997 / 10:03:42 / cg" |
fdaa3b9aa746
flush lastFileSelectionDirectory, if it does not exists
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
282 |
"Modified: / 15.6.1998 / 14:05:21 / cg" |
1320 | 283 |
! ! |
284 |
||
849 | 285 |
!FileSelectionBox class methodsFor:'defaults'! |
12 | 286 |
|
287 |
listViewType |
|
288 |
"return the type of listView - using a FileSelectionList here" |
|
289 |
||
290 |
^ FileSelectionList |
|
291 |
! ! |
|
292 |
||
2231
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
293 |
!FileSelectionBox class methodsFor:'menu specs'! |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
294 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
295 |
fileListMenu |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
296 |
"This resource specification was automatically generated |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
297 |
by the MenuEditor of ST/X." |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
298 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
299 |
"Do not manually edit this!! If it is corrupted, |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
300 |
the MenuEditor may not be able to read the specification." |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
301 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
302 |
" |
2354 | 303 |
MenuEditor new openOnClass:FileSelectionBox andSelector:#fileListMenu |
304 |
(Menu new fromLiteralArrayEncoding:(FileSelectionBox fileListMenu)) startUp |
|
2231
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
305 |
" |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
306 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
307 |
<resource: #menu> |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
308 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
309 |
^ |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
310 |
#(#Menu |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
311 |
#( |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
312 |
#(#MenuItem |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
313 |
#label: 'New Folder...' |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
314 |
#translateLabel: true |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
315 |
#value: #fileListMenuNewFolder |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
316 |
) |
2354 | 317 |
#(#MenuItem |
318 |
#label: '-' |
|
319 |
) |
|
320 |
#(#MenuItem |
|
321 |
#label: 'Remove...' |
|
322 |
#translateLabel: true |
|
323 |
#value: #fileListMenuRemove |
|
324 |
) |
|
2231
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
325 |
) |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
326 |
nil |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
327 |
nil |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
328 |
) |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
329 |
! ! |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
330 |
|
197 | 331 |
!FileSelectionBox methodsFor:'accessing'! |
3 | 332 |
|
2231
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
333 |
allowMakeDirectory:aBoolean |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
334 |
"allow or deny creation of new directories; |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
335 |
The default is to allow it." |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
336 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
337 |
allowMakeDirectory := aBoolean. |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
338 |
! |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
339 |
|
197 | 340 |
contents |
341 |
"return the current entered value (i.e. the enterFields string). |
|
342 |
redefined to return the full pathname." |
|
343 |
||
1809 | 344 |
|string| |
3 | 345 |
|
197 | 346 |
string := super contents. |
347 |
string isNil ifTrue:[ |
|
1670
8d24855a9f0b
oops - handle absolute filenames correctly under vms and msdos
Claus Gittinger <cg@exept.de>
parents:
1643
diff
changeset
|
348 |
^ selectionList directory pathName |
121 | 349 |
]. |
1670
8d24855a9f0b
oops - handle absolute filenames correctly under vms and msdos
Claus Gittinger <cg@exept.de>
parents:
1643
diff
changeset
|
350 |
(string asFilename isAbsolute) ifTrue:[ |
8d24855a9f0b
oops - handle absolute filenames correctly under vms and msdos
Claus Gittinger <cg@exept.de>
parents:
1643
diff
changeset
|
351 |
^ string |
77 | 352 |
]. |
197 | 353 |
^ (selectionList directory pathName asFilename construct:string) asString |
1670
8d24855a9f0b
oops - handle absolute filenames correctly under vms and msdos
Claus Gittinger <cg@exept.de>
parents:
1643
diff
changeset
|
354 |
|
8d24855a9f0b
oops - handle absolute filenames correctly under vms and msdos
Claus Gittinger <cg@exept.de>
parents:
1643
diff
changeset
|
355 |
"Modified: / 9.9.1998 / 21:23:16 / cg" |
132 | 356 |
! |
357 |
||
1672 | 358 |
directory |
359 |
"return the directory which is currently shown" |
|
360 |
||
361 |
^ selectionList directory |
|
296
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
362 |
! |
e1b9431b3aef
more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents:
240
diff
changeset
|
363 |
|
1672 | 364 |
directory:directoryName |
365 |
"change the directory shown in the list." |
|
366 |
||
367 |
selectionList directory:directoryName |
|
132 | 368 |
! |
369 |
||
1672 | 370 |
fileName |
371 |
"if some filename has been entered, return it (without the directory path) |
|
372 |
otherwise, return nil" |
|
373 |
||
374 |
|string| |
|
375 |
||
376 |
string := super contents. |
|
377 |
string isNil ifTrue:[^ nil]. |
|
378 |
^ self pathName asFilename baseName |
|
379 |
||
380 |
"Modified: / 12.8.1998 / 09:54:01 / cg" |
|
351 | 381 |
! |
382 |
||
1672 | 383 |
matchBlock:aBlock |
384 |
"set the matchBlock (in the selectionList). Only files |
|
385 |
for which the block returns true are shown. |
|
386 |
The matching is actually done in the fileSelectionList." |
|
387 |
||
388 |
selectionList matchBlock:aBlock |
|
197 | 389 |
! |
0 | 390 |
|
1672 | 391 |
openOn:aPath |
392 |
"open the box showing files in aPath. |
|
393 |
This is only a shortcut message - no new functionality." |
|
394 |
||
395 |
self directory:aPath. |
|
396 |
self showAtPointer |
|
38 | 397 |
! |
398 |
||
351 | 399 |
pathName |
400 |
"same as contents - return the full pathname of the selected file, |
|
401 |
or the pathname of the directory if nothing has been entered" |
|
402 |
||
403 |
^ self contents |
|
404 |
! |
|
405 |
||
1672 | 406 |
pattern:aPattern |
407 |
"set the pattern - this also enables the PatternField |
|
408 |
(if the pattern is non-nil) or hides it (if nil)." |
|
409 |
||
410 |
|focusSequence| |
|
130 | 411 |
|
1672 | 412 |
patternField initialText:aPattern. |
413 |
selectionList pattern:aPattern. |
|
414 |
aPattern isNil ifTrue:[ |
|
415 |
patternField beInvisible. |
|
416 |
self makeUntabable:patternField. |
|
417 |
focusSequence := (Array |
|
418 |
with:enterField |
|
419 |
with:selectionList |
|
420 |
with:okButton |
|
421 |
with:abortButton) |
|
422 |
] ifFalse:[ |
|
423 |
patternField beVisible. |
|
424 |
self makeTabable:patternField before:enterField. |
|
425 |
focusSequence := (Array |
|
426 |
with:patternField |
|
427 |
with:enterField |
|
428 |
with:selectionList |
|
429 |
with:okButton |
|
430 |
with:abortButton) |
|
431 |
]. |
|
432 |
||
433 |
windowGroup notNil ifTrue:[ |
|
434 |
windowGroup focusSequence:focusSequence |
|
435 |
]. |
|
436 |
||
437 |
"Modified: 18.10.1997 / 03:02:05 / cg" |
|
351 | 438 |
! |
439 |
||
440 |
selectingDirectory:aBoolean |
|
849 | 441 |
"setup the box for directory selection (hides regular files). |
442 |
Use this, to ask the user for a directories name" |
|
443 |
||
548
c418699a90c0
moved all request methods (class protocol) to DialogBox
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
444 |
selectingDirectory := aBoolean. |
c418699a90c0
moved all request methods (class protocol) to DialogBox
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
445 |
aBoolean ifTrue:[ |
c418699a90c0
moved all request methods (class protocol) to DialogBox
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
446 |
selectionList directoryChangeAction:[:entry | self directoryChanged]. |
c418699a90c0
moved all request methods (class protocol) to DialogBox
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
447 |
selectionList directorySelectAction:[:entry | self directorySelected]. |
c418699a90c0
moved all request methods (class protocol) to DialogBox
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
448 |
selectionList ignoreFiles:true. |
c418699a90c0
moved all request methods (class protocol) to DialogBox
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
449 |
] |
c418699a90c0
moved all request methods (class protocol) to DialogBox
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
450 |
|
849 | 451 |
"Modified: 22.10.1996 / 13:24:50 / cg" |
197 | 452 |
! ! |
453 |
||
454 |
!FileSelectionBox methodsFor:'change & update'! |
|
455 |
||
456 |
update:something with:argument from:changedObject |
|
457 |
|commonName index s| |
|
458 |
||
459 |
something == #directory ifTrue:[ |
|
460 |
" |
|
461 |
sent by fileNameEnterField, if a filename |
|
462 |
completion was not possible due to multiple |
|
463 |
matches. |
|
464 |
" |
|
465 |
selectionList directory:argument. |
|
466 |
s := enterField contents. |
|
467 |
s notNil ifTrue:[ |
|
468 |
commonName := s asFilename baseName. |
|
469 |
commonName size > 0 ifTrue:[ |
|
470 |
index := selectionList list findFirst:[:entry | entry startsWith:commonName]. |
|
471 |
index ~~ 0 ifTrue:[ |
|
472 |
selectionList makeLineVisible:index |
|
473 |
] |
|
474 |
] |
|
475 |
] |
|
476 |
] |
|
477 |
! ! |
|
478 |
||
479 |
!FileSelectionBox methodsFor:'initialization'! |
|
480 |
||
1672 | 481 |
createEnterField |
482 |
"if the (optional) class FilenameEditField is present, use |
|
483 |
it, since it provides filename completion. Otherwise, we have |
|
484 |
to live with the dumb (default) field ... |
|
485 |
" |
|
486 |
FilenameEditField notNil ifTrue:[ |
|
487 |
^ FilenameEditField new. |
|
488 |
]. |
|
489 |
^ super createEnterField |
|
548
c418699a90c0
moved all request methods (class protocol) to DialogBox
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
490 |
|
1672 | 491 |
"Modified: 18.4.1996 / 20:02:24 / cg" |
38 | 492 |
! |
0 | 493 |
|
1672 | 494 |
initialize |
495 |
|corner| |
|
496 |
||
497 |
super initialize. |
|
498 |
selectingDirectory := false. |
|
2231
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
499 |
allowMakeDirectory := true. |
1672 | 500 |
|
501 |
label := resources string:'File dialog'. |
|
502 |
||
503 |
labelField extent:(0.7 @ labelField height). |
|
504 |
labelField label:(resources string:'select a file:'). |
|
505 |
labelField adjust:#left. |
|
506 |
||
507 |
patternField := EditField in:self. |
|
508 |
self is3D ifTrue:[ |
|
509 |
corner := (1.0 @ (labelField origin y+patternField heightIncludingBorder)). |
|
510 |
] ifFalse:[ |
|
511 |
corner := [(width - ViewSpacing - (patternField borderWidth * 2)) @ (labelField origin y+patternField height"IncludingBorder")]. |
|
512 |
]. |
|
513 |
patternField origin:(0.7 @ labelField origin y) corner:corner. |
|
514 |
patternField rightInset:ViewSpacing. |
|
515 |
patternField initialText:'*'. |
|
516 |
patternField leaveAction:[:reason | self patternChanged]. |
|
517 |
patternField crAction:[self patternChanged]. |
|
518 |
patternField hiddenOnRealize:true. "delay showing, until a pattern is defined" |
|
519 |
"/ no, since its invisible |
|
520 |
"/ self makeTabable:patternField before:enterField. |
|
521 |
||
522 |
enterField addDependent:self. |
|
523 |
||
2231
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
524 |
selectionList menuHolder:self; menuMessage:#fileListMenu; menuPerformer:self. |
2375
1e3b7281d4ac
added optional ignoreCase in matchpattern
Claus Gittinger <cg@exept.de>
parents:
2354
diff
changeset
|
525 |
selectionList ignoreCaseInPattern:true. |
2231
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
526 |
|
1672 | 527 |
" |
528 |
FileSelectionBox open |
|
529 |
FileSelectionBox new show |
|
530 |
" |
|
531 |
||
532 |
"Modified: 18.10.1997 / 02:47:49 / cg" |
|
533 |
! |
|
534 |
||
535 |
postRealize |
|
536 |
"if some default is present in the enterField, |
|
537 |
scroll to make this one visible" |
|
538 |
||
539 |
|contents| |
|
540 |
||
541 |
super postRealize. |
|
542 |
(contents := enterField contents) notNil ifTrue:[ |
|
543 |
contents notEmpty ifTrue:[ |
|
544 |
selectionList makeVisible:contents |
|
545 |
] |
|
546 |
] |
|
547 |
||
548 |
"Created: 24.7.1997 / 18:19:14 / cg" |
|
197 | 549 |
! ! |
550 |
||
2231
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
551 |
!FileSelectionBox methodsFor:'menu'! |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
552 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
553 |
fileListMenu |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
554 |
allowMakeDirectory ifFalse:[^ self]. |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
555 |
^ self class fileListMenu |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
556 |
! |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
557 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
558 |
fileListMenuNewFolder |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
559 |
|newDirName d| |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
560 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
561 |
newDirName := Dialog request:'Name of new Folder:'. |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
562 |
newDirName size == 0 ifTrue:[^ self]. |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
563 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
564 |
d := self directory asFilename construct:newDirName. |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
565 |
d exists ifTrue:[ |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
566 |
d isDirectory ifTrue:[ |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
567 |
^ self |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
568 |
]. |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
569 |
self warn:(resources string:'A file named %1 already exists.' with:newDirName). |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
570 |
^ self |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
571 |
]. |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
572 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
573 |
d makeDirectory. |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
574 |
self updateList. |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
575 |
|
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
576 |
" |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
577 |
self open |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
578 |
" |
2354 | 579 |
! |
580 |
||
581 |
fileListMenuRemove |
|
582 |
|selectedFilename baseName| |
|
583 |
||
584 |
selectedFilename := self pathName asFilename. |
|
585 |
baseName := selectedFilename baseName. |
|
586 |
||
587 |
(Dialog confirm:(resources string:'Really remove ''%1'' ?' with:baseName allBold)) ifFalse:[ |
|
588 |
^ self. |
|
589 |
]. |
|
590 |
||
591 |
selectedFilename isDirectory ifTrue:[ |
|
592 |
self warn:(resources string:'%1 is a directory..' with:baseName). |
|
593 |
^ self. |
|
594 |
]. |
|
595 |
||
596 |
selectedFilename delete. |
|
597 |
self updateList. |
|
2231
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
598 |
! ! |
48ab82d819bc
added makeDirectory popUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
599 |
|
197 | 600 |
!FileSelectionBox methodsFor:'private'! |
601 |
||
1672 | 602 |
updateList |
603 |
selectionList updateList |
|
604 |
! ! |
|
38 | 605 |
|
197 | 606 |
!FileSelectionBox methodsFor:'queries'! |
607 |
||
1672 | 608 |
preferredExtent |
609 |
"return my preferred extent - thats the minimum size |
|
610 |
to make everything visible" |
|
611 |
||
612 |
|wWanted hWanted mm| |
|
613 |
||
614 |
"/ If I have an explicit preferredExtent .. |
|
615 |
||
616 |
preferredExtent notNil ifTrue:[ |
|
617 |
^ preferredExtent |
|
618 |
]. |
|
619 |
||
620 |
mm := ViewSpacing. |
|
621 |
||
622 |
wWanted := mm + |
|
623 |
labelField preferredExtent x + |
|
624 |
(mm * 2) + |
|
625 |
patternField preferredExtent x + |
|
626 |
mm. |
|
627 |
(wWanted < width) ifTrue:[ |
|
628 |
wWanted := width |
|
629 |
]. |
|
630 |
hWanted := mm + labelField height + |
|
631 |
mm + enterField height + |
|
632 |
mm + selectionList height + |
|
633 |
mm + buttonPanel preferredExtent y + |
|
634 |
mm. |
|
635 |
||
636 |
(hWanted < height) ifTrue:[ |
|
637 |
hWanted := height |
|
638 |
]. |
|
639 |
^ (wWanted @ hWanted) |
|
640 |
||
641 |
"Modified: 19.7.1996 / 20:44:04 / cg" |
|
642 |
! ! |
|
197 | 643 |
|
644 |
!FileSelectionBox methodsFor:'user actions'! |
|
645 |
||
1672 | 646 |
directoryChanged |
647 |
selectingDirectory ifTrue:[ |
|
648 |
selectionList changeDirectory. |
|
649 |
enterField contents:(selectionList directory pathName). |
|
650 |
selectionList setSelection:nil. |
|
651 |
]. |
|
548
c418699a90c0
moved all request methods (class protocol) to DialogBox
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
652 |
|
1672 | 653 |
"Created: 18.4.1996 / 18:38:21 / cg" |
654 |
"Modified: 25.5.1996 / 12:27:05 / cg" |
|
548
c418699a90c0
moved all request methods (class protocol) to DialogBox
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
655 |
! |
c418699a90c0
moved all request methods (class protocol) to DialogBox
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
656 |
|
1672 | 657 |
directorySelected |
658 |
"a directory was selected - show the new path in the inputField, |
|
659 |
if we are in directory mode" |
|
660 |
||
661 |
selectingDirectory ifTrue:[ |
|
662 |
|newDir| |
|
663 |
||
664 |
newDir := (selectionList directory) |
|
665 |
construct:selectionList selectionValue. |
|
666 |
enterField contents:newDir pathName. |
|
667 |
]. |
|
668 |
||
669 |
"Created: / 18.4.1996 / 18:46:15 / cg" |
|
670 |
"Modified: / 7.8.1998 / 17:19:26 / cg" |
|
671 |
! |
|
672 |
||
673 |
doubleClick |
|
674 |
|entry| |
|
675 |
||
676 |
entry := selectionList selectionValue. |
|
677 |
entry notNil ifTrue:[ |
|
678 |
((selectionList directory asFilename construct:entry) isDirectory) ifFalse:[ |
|
679 |
selectingDirectory ifFalse:[ |
|
680 |
enterField contents:entry. |
|
681 |
self okPressed |
|
682 |
] |
|
683 |
] |
|
684 |
]. |
|
685 |
||
686 |
"Modified: 19.10.1997 / 00:17:37 / cg" |
|
197 | 687 |
! |
688 |
||
689 |
okPressed |
|
690 |
"called for both on ok-press and on return-key" |
|
691 |
||
692 |
|dir string fname| |
|
693 |
||
694 |
string := enterField contents. |
|
351 | 695 |
(string notNil and:[string notEmpty]) ifTrue:[ |
696 |
string := string withoutSeparators. |
|
697 |
string asFilename isAbsolute ifTrue:[ |
|
698 |
fname := string asFilename |
|
699 |
] ifFalse:[ |
|
700 |
dir := selectionList directory pathName asFilename. |
|
701 |
fname := dir construct:string |
|
702 |
]. |
|
703 |
fname isDirectory ifTrue:[ |
|
704 |
selectingDirectory ifFalse:[ |
|
705 |
selectionList directory:fname asString. |
|
706 |
self updateList. |
|
707 |
^ self |
|
708 |
] |
|
709 |
] |
|
710 |
] ifFalse:[ |
|
711 |
selectingDirectory ifTrue:[ |
|
712 |
enterField contents:(selectionList directory pathName). |
|
713 |
]. |
|
38 | 714 |
]. |
351 | 715 |
|
197 | 716 |
super okPressed |
351 | 717 |
|
1674
75149fa16b10
oops - leftover halt removed.
Claus Gittinger <cg@exept.de>
parents:
1672
diff
changeset
|
718 |
"Modified: / 10.9.1998 / 22:19:11 / cg" |
197 | 719 |
! |
720 |
||
1672 | 721 |
patternChanged |
722 |
selectionList pattern:patternField contents. |
|
746
4442a4d4121f
dont want return in patternField to be accept of box
Claus Gittinger <cg@exept.de>
parents:
740
diff
changeset
|
723 |
self updateList |
4442a4d4121f
dont want return in patternField to be accept of box
Claus Gittinger <cg@exept.de>
parents:
740
diff
changeset
|
724 |
|
4442a4d4121f
dont want return in patternField to be accept of box
Claus Gittinger <cg@exept.de>
parents:
740
diff
changeset
|
725 |
"Created: 4.6.1996 / 20:30:23 / cg" |
1672 | 726 |
! |
727 |
||
728 |
selectionChanged |
|
729 |
|entry| |
|
730 |
||
731 |
entry := selectionList selectionValue. |
|
732 |
(selectionList directory asFilename construct:entry) type == #directory ifFalse:[ |
|
733 |
selectingDirectory ifTrue:[ |
|
734 |
enterField contents:(selectionList directory pathName). |
|
735 |
selectionList setSelection:nil. |
|
736 |
^ self |
|
737 |
] |
|
738 |
]. |
|
739 |
enterField contents:entry |
|
740 |
||
741 |
"Modified: 21.9.1997 / 12:07:55 / cg" |
|
0 | 742 |
! ! |
197 | 743 |
|
849 | 744 |
!FileSelectionBox class methodsFor:'documentation'! |
240 | 745 |
|
746 |
version |
|
2375
1e3b7281d4ac
added optional ignoreCase in matchpattern
Claus Gittinger <cg@exept.de>
parents:
2354
diff
changeset
|
747 |
^ '$Header: /cvs/stx/stx/libwidg/FileSelectionBox.st,v 1.59 2001-06-19 15:00:58 cg Exp $' |
240 | 748 |
! ! |