8277
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2008 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
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 |
"
|
8015
|
12 |
"{ Package: 'stx:libtool' }"
|
|
13 |
|
|
14 |
Object subclass:#Win32FileDialog
|
|
15 |
instanceVariableNames:'fileName openFileNameStruct filters lpstrFilter lpstrFile
|
|
16 |
lpstrInitialDir lpstrTitle lpstrDefExt defFilter defExtension
|
9698
|
17 |
style title smalltalkFileFilters defFilterIndex parent error'
|
13577
|
18 |
classVariableNames:'Lock InitialDirectory CommonDialogConstants
|
|
19 |
FilterPatternDescriptions'
|
8015
|
20 |
poolDictionaries:''
|
|
21 |
category:'Interface-Tools-File'
|
|
22 |
!
|
|
23 |
|
|
24 |
ByteArray variableByteSubclass:#OpenFilenameStructure
|
|
25 |
instanceVariableNames:''
|
|
26 |
classVariableNames:''
|
|
27 |
poolDictionaries:''
|
|
28 |
privateIn:Win32FileDialog
|
|
29 |
!
|
|
30 |
|
8277
|
31 |
!Win32FileDialog class methodsFor:'documentation'!
|
|
32 |
|
|
33 |
copyright
|
|
34 |
"
|
|
35 |
COPYRIGHT (c) 2008 by eXept Software AG
|
|
36 |
All Rights Reserved
|
|
37 |
|
|
38 |
This software is furnished under a license and may be used
|
|
39 |
only in accordance with the terms of that license and with the
|
|
40 |
inclusion of the above copyright notice. This software may not
|
|
41 |
be provided or otherwise made available to, or used by, any
|
|
42 |
other person. No title to or ownership of the software is
|
|
43 |
hereby transferred.
|
|
44 |
"
|
9598
|
45 |
!
|
|
46 |
|
|
47 |
documentation
|
|
48 |
"
|
|
49 |
interface to windows file dialogs
|
|
50 |
"
|
8277
|
51 |
! !
|
8015
|
52 |
|
8260
|
53 |
!Win32FileDialog class methodsFor:'initialization'!
|
|
54 |
|
9597
|
55 |
initialize
|
|
56 |
Lock := RecursionLock new.
|
|
57 |
|
|
58 |
"Created: / 26-10-2010 / 12:51:23 / cg"
|
|
59 |
!
|
|
60 |
|
8260
|
61 |
startUp
|
9345
|
62 |
"Private - Initialize the class variables.
|
|
63 |
This is called during startup."
|
8260
|
64 |
|
|
65 |
InitialDirectory := Directory pathName: Disk drivePathName.
|
|
66 |
! !
|
|
67 |
|
8015
|
68 |
!Win32FileDialog class methodsFor:'instance creation'!
|
|
69 |
|
|
70 |
new
|
9345
|
71 |
^ self basicNew initialize
|
8015
|
72 |
! !
|
|
73 |
|
|
74 |
!Win32FileDialog class methodsFor:'accessing'!
|
|
75 |
|
|
76 |
getInitialDirectory
|
9598
|
77 |
^ InitialDirectory
|
8015
|
78 |
|
9598
|
79 |
"Modified: / 26-10-2010 / 18:47:46 / cg"
|
8015
|
80 |
!
|
|
81 |
|
9598
|
82 |
setInitialDirectory:aName
|
|
83 |
InitialDirectory := Directory pathName:aName
|
8015
|
84 |
|
9598
|
85 |
"Modified: / 26-10-2010 / 18:47:48 / cg"
|
8015
|
86 |
! !
|
|
87 |
|
|
88 |
!Win32FileDialog class methodsFor:'constants'!
|
|
89 |
|
9598
|
90 |
commonDialogConstantAt:aString
|
|
91 |
^ self commonDialogConstants at:aString
|
|
92 |
ifAbsent:[
|
|
93 |
Transcript showCR:'Common Dialog Constant ' , aString , ' notfound!!'
|
|
94 |
]
|
8015
|
95 |
|
9598
|
96 |
"Modified: / 26-10-2010 / 18:47:51 / cg"
|
8015
|
97 |
!
|
|
98 |
|
|
99 |
commonDialogConstants
|
9345
|
100 |
CommonDialogConstants isNil ifTrue:[
|
9598
|
101 |
CommonDialogConstants := self generateCommonDialogConstants
|
9345
|
102 |
].
|
8015
|
103 |
^ CommonDialogConstants
|
9598
|
104 |
|
|
105 |
"Modified: / 26-10-2010 / 18:47:54 / cg"
|
8015
|
106 |
!
|
|
107 |
|
|
108 |
generateCommonDialogConstants
|
|
109 |
|dictionary|
|
|
110 |
|
|
111 |
dictionary := Dictionary new.
|
|
112 |
dictionary
|
9598
|
113 |
at:'CcPreventfullopen' put:4;
|
|
114 |
at:'FrShowhelp' put:128;
|
|
115 |
at:'PdEnablesetuptemplate' put:32768;
|
|
116 |
at:'FrNoupdown' put:1024;
|
|
117 |
at:'CfNosimulations' put:4096;
|
|
118 |
at:'OfnPathmustexist' put:2048;
|
|
119 |
at:'CfWysiwyg' put:32768;
|
|
120 |
at:'PdReturndc' put:256;
|
|
121 |
at:'PdEnableprinthook' put:4096;
|
|
122 |
at:'CfInittologfontstruct' put:64;
|
|
123 |
at:'CfScalableonly' put:131072;
|
|
124 |
at:'PdPrinttofile' put:32;
|
|
125 |
at:'CfEffects' put:256;
|
|
126 |
at:'PdShowhelp' put:2048;
|
|
127 |
at:'OfnEnabletemplatehandle' put:128;
|
|
128 |
at:'CfBoth' put:3;
|
|
129 |
at:'OfnReadonly' put:1;
|
|
130 |
at:'PdNopagenums' put:8;
|
|
131 |
at:'PdDisableprinttofile' put:524288;
|
|
132 |
at:'PdHideprinttofile' put:1048576;
|
|
133 |
at:'OfnAllowmultiselect' put:512;
|
|
134 |
at:'CfPrinterfonts' put:2;
|
|
135 |
at:'CfEnabletemplatehandle' put:32;
|
|
136 |
at:'PdSelection' put:1;
|
|
137 |
at:'OfnHidereadonly' put:4;
|
|
138 |
at:'PdPrintsetup' put:64;
|
|
139 |
at:'OfnExtentiondifferent' put:1024;
|
|
140 |
at:'FrReplaceall' put:32;
|
|
141 |
at:'FrMatchcase' put:4;
|
|
142 |
at:'OfnFilemustexist' put:4096;
|
|
143 |
at:'PdCollate' put:16;
|
|
144 |
at:'CfFixedpitchonly' put:16384;
|
|
145 |
at:'PdEnablesetuphook' put:8192;
|
|
146 |
at:'OfnShareaware' put:16384;
|
|
147 |
at:'CcEnablehook' put:16;
|
|
148 |
at:'CfEnabletemplate' put:16;
|
|
149 |
at:'Findmsgstring' put:'commdlgFindreplace';
|
|
150 |
at:'CfLimitsize' put:8192;
|
|
151 |
at:'OfnNochangedir' put:8;
|
|
152 |
at:'OfnCreateprompt' put:8192;
|
|
153 |
at:'ScreenFonttype' put:8192;
|
|
154 |
at:'PdUsedevmodecopies' put:262144;
|
|
155 |
at:'CcRgbinit' put:1;
|
|
156 |
at:'FrFindnext' put:8;
|
|
157 |
at:'CfUsestyle' put:128;
|
|
158 |
at:'FrEnablehook' put:256;
|
|
159 |
at:'PdEnableprinttemplatehandle' put:65536;
|
|
160 |
at:'CfShowhelp' put:4;
|
|
161 |
at:'FrNowholeword' put:4096.
|
|
162 |
dictionary
|
|
163 |
at:'ShareExist' put:16448;
|
|
164 |
at:'OfnOverwriteprompt' put:2;
|
|
165 |
at:'OfnEnablehook' put:32;
|
|
166 |
at:'OfnShowhelp' put:16;
|
|
167 |
at:'CcEnabletemplatehandle' put:64;
|
|
168 |
at:'SimulatedFonttype' put:32768;
|
|
169 |
at:'FrDown' put:1;
|
|
170 |
at:'PdEnableprinttemplate' put:16384;
|
|
171 |
at:'CfNovectorfonts' put:2048;
|
|
172 |
at:'PdNoselection' put:4;
|
|
173 |
at:'CfAnsionly' put:1024;
|
|
174 |
at:'OfnNovalidate' put:256;
|
|
175 |
at:'CfScreenfonts' put:1;
|
|
176 |
at:'FrWholeword' put:2;
|
|
177 |
at:'FrEnabletemplatehandle' put:8192;
|
|
178 |
at:'PdAllpages' put:0;
|
|
179 |
at:'CfForcefontexist' put:65536;
|
|
180 |
at:'CcEnabletemplate' put:32;
|
|
181 |
at:'PdPagenums' put:2;
|
|
182 |
at:'FrReplace' put:16;
|
|
183 |
at:'PdEnablesetuptemplatehandle' put:131072;
|
|
184 |
at:'CfApply' put:512;
|
|
185 |
at:'OfnEnabletemplate' put:64;
|
|
186 |
at:'DnDefaultprn' put:1;
|
|
187 |
at:'PdNowarning' put:128;
|
|
188 |
at:'CfTtonly' put:262144;
|
|
189 |
at:'PrinterFonttype' put:16384;
|
|
190 |
at:'CcShowhelp' put:8;
|
|
191 |
at:'CcFullopen' put:2;
|
|
192 |
at:'PdReturnic' put:512;
|
|
193 |
at:'FrEnabletemplate' put:512;
|
|
194 |
at:'FrDialogterm' put:64;
|
|
195 |
at:'Helpmsgstring' put:'commdlgHelp';
|
|
196 |
at:'PdReturndefault' put:1024;
|
|
197 |
at:'FrNomatchcase' put:2048;
|
|
198 |
at:'CfEnablehook' put:8.
|
8015
|
199 |
^ dictionary
|
9598
|
200 |
|
|
201 |
"Modified: / 26-10-2010 / 18:47:57 / cg"
|
8015
|
202 |
! !
|
|
203 |
|
|
204 |
!Win32FileDialog class methodsFor:'examples'!
|
|
205 |
|
|
206 |
openFile
|
9345
|
207 |
^ (Win32FileDialog new openFile: 'c:\untitled.txt') file.
|
8015
|
208 |
|
|
209 |
"
|
9345
|
210 |
self openFile
|
8015
|
211 |
"
|
|
212 |
!
|
|
213 |
|
|
214 |
saveFile
|
9345
|
215 |
^ (Win32FileDialog new saveFile: 'C:\vsw311\untitled.txt') file.
|
8015
|
216 |
|
|
217 |
"
|
9345
|
218 |
self saveFile
|
8015
|
219 |
"
|
|
220 |
! !
|
|
221 |
|
|
222 |
!Win32FileDialog class methodsFor:'filters'!
|
|
223 |
|
9598
|
224 |
filterPatternDescription:filterPattern
|
|
225 |
^ self filterPatternDescriptions at:filterPattern ifAbsent:''
|
8015
|
226 |
|
9598
|
227 |
"Modified: / 26-10-2010 / 18:48:24 / cg"
|
8015
|
228 |
!
|
|
229 |
|
|
230 |
filterPatternDescriptions
|
9598
|
231 |
FilterPatternDescriptions isNil ifTrue:[
|
|
232 |
FilterPatternDescriptions := self generateFilterPatternDescriptions
|
|
233 |
].
|
|
234 |
^ FilterPatternDescriptions
|
8015
|
235 |
|
9598
|
236 |
"Modified: / 26-10-2010 / 18:48:25 / cg"
|
8015
|
237 |
!
|
|
238 |
|
9598
|
239 |
filtersFor:pattern
|
8015
|
240 |
|filters filterPatterns|
|
|
241 |
|
9598
|
242 |
pattern isEmptyOrNil ifTrue:[
|
|
243 |
^ nil
|
|
244 |
].
|
8015
|
245 |
filters := OrderedCollection new.
|
9598
|
246 |
filterPatterns := pattern subStrings:$;.
|
8015
|
247 |
filterPatterns do:[:filterPattern |
|
|
248 |
filterPattern notEmpty ifTrue:[
|
9598
|
249 |
filters add:(Array with:(self filterPatternDescription:filterPattern)
|
|
250 |
with:filterPattern)
|
8015
|
251 |
].
|
|
252 |
].
|
|
253 |
^ filters asArray
|
9598
|
254 |
|
|
255 |
"Modified: / 26-10-2010 / 18:48:26 / cg"
|
8015
|
256 |
!
|
|
257 |
|
|
258 |
generateFilterPatternDescriptions
|
9598
|
259 |
^ (Dictionary new)
|
|
260 |
at:'*.txt' put:'Text files (*.txt)';
|
|
261 |
at:'*.st' put:'Smalltalk files (*.st)';
|
|
262 |
at:'*.csv' put:'CSV files (*.csv)';
|
|
263 |
at:'*.xml' put:'XML files (*.xml)';
|
|
264 |
at:'*.zip' put:'ZIP files (*.zip)';
|
|
265 |
at:'*.xls' put:'Excel files (*.xls)';
|
|
266 |
at:'*.ent' put:'SGML Entity files (*.ent)';
|
|
267 |
at:'*.ccs' put:'CCS files (*.ccs)';
|
|
268 |
at:'*.ini' put:'Configuration files (*.ini)';
|
|
269 |
at:'*.prn' put:'Printer Text files (*.prn)';
|
|
270 |
at:'*.dir' put:'DapasX Database files (*.dir)';
|
|
271 |
at:'*.dat' put:'DapasX Database files (*.dat)';
|
|
272 |
at:'*.prg' put:'DapasX Program files (*.prg)';
|
|
273 |
at:'*.dcf' put:'DapasX Options files (*.dcf)';
|
|
274 |
at:'*.ext' put:'DapasX Backup files (*.ext)';
|
|
275 |
at:'*.mpl' put:'DapasX Project files (*.mpl)';
|
|
276 |
yourself
|
8015
|
277 |
|
9598
|
278 |
"Modified: / 26-10-2010 / 18:48:28 / cg"
|
8015
|
279 |
! !
|
|
280 |
|
|
281 |
!Win32FileDialog class methodsFor:'opening'!
|
|
282 |
|
9345
|
283 |
fileDialogFor:ownerWindow save:isSaveDialog
|
|
284 |
title:titleOrNil inDirectory:dirPathOrNil initialAnswer:initialOrNil
|
|
285 |
filter:pattern extension:extensionOrNil
|
8015
|
286 |
|
|
287 |
"start a native open-file dialog.
|
|
288 |
If not cancelled, the selected fileName is returned; nil otherwise.
|
|
289 |
Of course, this one looks like the
|
|
290 |
Windows file dialog - no matter which viewStyle settings are active.
|
|
291 |
Notice: if no ownerWindow is given, the dialog pops up at 0@0.
|
|
292 |
|
|
293 |
EXPERIMENTAL & non-portable: use with caution"
|
|
294 |
|
|
295 |
|filePath filterArrayOrNil|
|
|
296 |
|
|
297 |
filterArrayOrNil := self filtersFor: pattern.
|
|
298 |
|
9345
|
299 |
filePath :=
|
|
300 |
self new
|
|
301 |
openFor:ownerWindow
|
|
302 |
save:isSaveDialog
|
|
303 |
title:titleOrNil
|
|
304 |
inDirectory:dirPathOrNil
|
|
305 |
initialAnswer:initialOrNil
|
|
306 |
filter:filterArrayOrNil
|
|
307 |
extension:extensionOrNil.
|
8015
|
308 |
|
|
309 |
^ filePath
|
|
310 |
! !
|
|
311 |
|
|
312 |
!Win32FileDialog methodsFor:'accessing'!
|
|
313 |
|
|
314 |
addAllFilesFilter
|
|
315 |
|
|
316 |
self addFilter: '*.*' description: 'All Files (*.*)'.
|
|
317 |
!
|
|
318 |
|
9598
|
319 |
addFilter:aFilter description:aDescription
|
|
320 |
"Add aFilter and aDescription to the list of File dialog filters."
|
|
321 |
|
|
322 |
filters add:(Association key:aFilter value:aDescription).
|
8015
|
323 |
|
9598
|
324 |
"Modified: / 26-10-2010 / 18:45:27 / cg"
|
8015
|
325 |
!
|
|
326 |
|
|
327 |
addSmalltalkFileFilters
|
9598
|
328 |
^ smalltalkFileFilters
|
8015
|
329 |
|
9598
|
330 |
"Modified: / 26-10-2010 / 18:45:29 / cg"
|
8015
|
331 |
!
|
|
332 |
|
9598
|
333 |
defExtension:aDefExtension
|
|
334 |
"Specifies the default extension of File dialog."
|
|
335 |
|
|
336 |
defExtension := aDefExtension.
|
8015
|
337 |
|
9598
|
338 |
"Modified: / 26-10-2010 / 18:45:54 / cg"
|
8015
|
339 |
!
|
|
340 |
|
|
341 |
defFilter
|
9598
|
342 |
"Answers the aDefFilterString as the default filter of File dialog."
|
|
343 |
|
|
344 |
^ defFilter
|
8015
|
345 |
|
9598
|
346 |
"Modified: / 26-10-2010 / 18:45:56 / cg"
|
8015
|
347 |
!
|
|
348 |
|
9598
|
349 |
defFilter:aDefFilterString
|
|
350 |
"Specifies the aDefFilterString as the default filter of File dialog."
|
|
351 |
|
|
352 |
defFilter := aDefFilterString
|
8015
|
353 |
|
9598
|
354 |
"Modified: / 26-10-2010 / 18:45:58 / cg"
|
8015
|
355 |
!
|
|
356 |
|
9598
|
357 |
defFilterIndex:defaultFilterIndex
|
|
358 |
defFilterIndex := defaultFilterIndex.
|
8015
|
359 |
|
9598
|
360 |
"Modified: / 26-10-2010 / 18:46:01 / cg"
|
8015
|
361 |
!
|
|
362 |
|
|
363 |
directory
|
9598
|
364 |
"Answer the selected directory."
|
|
365 |
|
8037
|
366 |
InitialDirectory isNil ifTrue:[
|
|
367 |
^ Filename currentDirectory pathName asFilename
|
|
368 |
].
|
|
369 |
^ InitialDirectory "? OperatingSystem getCurrentDirectory asFilename"
|
9598
|
370 |
|
|
371 |
"Modified: / 26-10-2010 / 18:46:03 / cg"
|
8015
|
372 |
!
|
|
373 |
|
9598
|
374 |
directory:directory
|
|
375 |
"Sets the initial directory."
|
|
376 |
|
|
377 |
|aFilename|
|
8015
|
378 |
|
9598
|
379 |
directory isNil ifTrue:[
|
|
380 |
^ self.
|
|
381 |
].
|
|
382 |
aFilename := directory asFilename.
|
|
383 |
aFilename exists ifTrue:[
|
|
384 |
InitialDirectory := aFilename
|
|
385 |
].
|
8015
|
386 |
|
9598
|
387 |
"Modified: / 26-10-2010 / 18:46:06 / cg"
|
8015
|
388 |
!
|
|
389 |
|
|
390 |
file
|
9598
|
391 |
"Answer the selected file."
|
|
392 |
|
|
393 |
^ fileName
|
8015
|
394 |
|
9598
|
395 |
"Modified: / 26-10-2010 / 18:46:10 / cg"
|
8015
|
396 |
!
|
|
397 |
|
|
398 |
fileSpec: aFileSpec
|
9598
|
399 |
"Sets the initial fileName and directory in the File Dialog."
|
8015
|
400 |
|
9598
|
401 |
| array dir |
|
8015
|
402 |
|
|
403 |
"SHOULD assign initial fileName and directory separately using #fileName: and #directory"
|
|
404 |
|
8358
|
405 |
self breakPoint:#fm.
|
8015
|
406 |
fileName := aFileSpec.
|
|
407 |
"/ array := Filename splitPath: aFileSpec in: self directory .
|
|
408 |
"/ dir :=
|
|
409 |
"/ (( String with: ( array at: 1 ) with: $: ),
|
|
410 |
"/ ( ( array at: 2 ) isEmpty ifTrue: [ '\' ] ifFalse: [ array at: 2 ] )) asFilename.
|
|
411 |
"/ dir exists ifFalse: [ dir := OperatingSystem getCurrentDirectory asFilename ].
|
|
412 |
"/
|
|
413 |
"/ self directory: dir.
|
|
414 |
"/ fileName := array at: 3
|
9598
|
415 |
|
|
416 |
"Modified: / 26-10-2010 / 18:46:22 / cg"
|
8015
|
417 |
!
|
|
418 |
|
|
419 |
filters
|
9598
|
420 |
"Private - answers a string containing all filters and sets up
|
|
421 |
the defFilterIndex property"
|
8015
|
422 |
|
|
423 |
| filterString count defaultFilterIndex defaultFilter|
|
|
424 |
|
|
425 |
smalltalkFileFilters notNil ifTrue: [
|
|
426 |
self
|
|
427 |
addFilter: '*.cls' description: 'Class Files (*.CLS)';
|
|
428 |
addFilter: '*.mth' description: 'Method Files (*.MTH)';
|
|
429 |
addFilter: '*.st' description: 'Smalltalk Files (*.ST)';
|
|
430 |
addFilter: '*.bnd' description: 'Library Bind Files (*.BND)';
|
|
431 |
addFilter: '*.map' description: 'Library Map Files (*.MAP)';
|
|
432 |
addFilter: '*.ini' description: 'Initialization Files (*.INI)';
|
|
433 |
addFilter: '*.obj' description: 'Object Files (*.OBJ)';
|
|
434 |
addFilter: '*.log' description: 'Log Files (*.LOG)'
|
|
435 |
].
|
|
436 |
|
|
437 |
defaultFilter := self defFilter.
|
|
438 |
(fileName notEmptyOrNil and:[defaultFilter isNil]) ifTrue:[
|
|
439 |
|initialFilenameSuffix|
|
|
440 |
initialFilenameSuffix := fileName asFilename suffix.
|
|
441 |
initialFilenameSuffix notEmptyOrNil ifTrue:[
|
|
442 |
defaultFilter := '*.', initialFilenameSuffix.
|
|
443 |
].
|
|
444 |
].
|
|
445 |
|
|
446 |
filterString := String new.
|
|
447 |
count := 0.
|
|
448 |
defaultFilterIndex := 0.
|
|
449 |
filters do: [:assoc |
|
|
450 |
count := count + 1.
|
|
451 |
assoc key = defaultFilter ifTrue: [ defaultFilterIndex := count ].
|
8037
|
452 |
filterString := filterString, assoc value, #[0] asString, assoc key , #[0] asString.
|
8015
|
453 |
].
|
|
454 |
|
|
455 |
self defFilterIndex: defaultFilterIndex.
|
|
456 |
^filterString
|
9598
|
457 |
|
|
458 |
"Modified: / 26-10-2010 / 18:46:35 / cg"
|
8015
|
459 |
!
|
|
460 |
|
|
461 |
flags
|
9598
|
462 |
"Private - Answers the dialog box current flags.
|
|
463 |
For compatibility reasons -> use style instead"
|
|
464 |
|
|
465 |
^ openFileNameStruct flags
|
8015
|
466 |
|
9598
|
467 |
"Modified: / 26-10-2010 / 18:46:38 / cg"
|
8015
|
468 |
!
|
|
469 |
|
9598
|
470 |
flags:flags
|
|
471 |
"Private - Specifies the dialog box creation flags.
|
|
472 |
Kept for compatibility reasons. Use style: instead"
|
|
473 |
|
|
474 |
self style:flags
|
8015
|
475 |
|
9598
|
476 |
"Modified: / 26-10-2010 / 18:46:42 / cg"
|
8015
|
477 |
!
|
|
478 |
|
|
479 |
hideReadonly
|
9598
|
480 |
"Hides the file dialog's Readonly check box. "
|
|
481 |
|
|
482 |
self
|
11948
|
483 |
style:(self style bitOr: (self class commonDialogConstantAt:'OfnHidereadonly'))
|
8015
|
484 |
|
9598
|
485 |
"Modified: / 26-10-2010 / 18:46:48 / cg"
|
8015
|
486 |
!
|
|
487 |
|
9598
|
488 |
initialFileName:filename
|
|
489 |
"Sets the initial fileName string in the File Dialog."
|
|
490 |
|
|
491 |
|aString|
|
8015
|
492 |
|
9598
|
493 |
filename isNil ifTrue:[
|
|
494 |
^ self.
|
|
495 |
].
|
8015
|
496 |
aString := filename.
|
9598
|
497 |
filename isFilename ifTrue:[
|
|
498 |
aString := filename baseName
|
|
499 |
].
|
8015
|
500 |
fileName := aString.
|
9598
|
501 |
|
|
502 |
"Modified: / 26-10-2010 / 18:46:50 / cg"
|
8015
|
503 |
!
|
|
504 |
|
|
505 |
overwritePrompt
|
9598
|
506 |
"Prompt if the user attempts to overwrite a file"
|
|
507 |
|
11948
|
508 |
self style:(self style
|
|
509 |
bitOr: (self class commonDialogConstantAt:'OfnOverwriteprompt'))
|
8015
|
510 |
|
9598
|
511 |
"Modified: / 26-10-2010 / 18:47:19 / cg"
|
8015
|
512 |
!
|
|
513 |
|
9598
|
514 |
owner:ownerWindow
|
|
515 |
"Sets the owner of the Dialog box."
|
|
516 |
|
8015
|
517 |
|mainView handle|
|
|
518 |
|
9598
|
519 |
ownerWindow isNil ifTrue:[
|
|
520 |
^ self
|
|
521 |
].
|
8015
|
522 |
mainView := ownerWindow windowGroup mainView.
|
|
523 |
mainView notNil ifTrue:[
|
|
524 |
handle := mainView id.
|
|
525 |
handle notNil ifTrue:[
|
|
526 |
parent := handle address
|
|
527 |
].
|
|
528 |
].
|
|
529 |
|
9598
|
530 |
"/ super owner: anOwner.
|
|
531 |
"/ owner isWindow
|
|
532 |
"/ ifTrue: [ parent := owner ]
|
|
533 |
"/ ifFalse: [ parent := owner mainView.
|
|
534 |
"/ parent isWindow ifFalse: [
|
|
535 |
"/ parent := Notifier findWindow: WindowHandle queryActive ]].
|
|
536 |
|
|
537 |
"Modified: / 26-10-2010 / 18:47:22 / cg"
|
8015
|
538 |
!
|
|
539 |
|
|
540 |
pathMustExist
|
11948
|
541 |
self style:(self style bitOr: 16r800).
|
8015
|
542 |
|
9598
|
543 |
"Modified: / 26-10-2010 / 18:47:27 / cg"
|
8015
|
544 |
!
|
|
545 |
|
|
546 |
shareAware
|
9598
|
547 |
"Allows a previously opened file to be opened
|
|
548 |
(e.g. change.log)"
|
|
549 |
|
|
550 |
self
|
11948
|
551 |
style:(self style bitOr: (self class commonDialogConstantAt:'OfnShareaware'))
|
8015
|
552 |
|
9598
|
553 |
"Modified: / 26-10-2010 / 18:47:36 / cg"
|
8015
|
554 |
!
|
|
555 |
|
|
556 |
style
|
9606
|
557 |
style isNil ifTrue:[^ self class commonDialogConstantAt:'OfnNochangedir'].
|
|
558 |
^ style
|
|
559 |
|
|
560 |
"Modified: / 27-10-2010 / 11:07:41 / cg"
|
8015
|
561 |
!
|
|
562 |
|
|
563 |
style:something
|
|
564 |
style := something.
|
|
565 |
!
|
|
566 |
|
9598
|
567 |
title:aTitle
|
|
568 |
"Specifies the string to be placed in the title bar of the
|
|
569 |
File dialog."
|
|
570 |
|
|
571 |
title := aTitle
|
8015
|
572 |
|
9598
|
573 |
"Modified: / 26-10-2010 / 18:47:41 / cg"
|
8015
|
574 |
! !
|
|
575 |
|
|
576 |
!Win32FileDialog methodsFor:'dapas'!
|
|
577 |
|
|
578 |
dapasOpenFile
|
9598
|
579 |
"Brings up the default open file dialog "
|
|
580 |
|
|
581 |
self
|
|
582 |
hideReadonly;
|
|
583 |
shareAware;
|
|
584 |
addFilter:'*.*' description:'All Files (*.*)'.
|
|
585 |
self defFilter isNil ifTrue:[
|
|
586 |
self defFilter:'*.*'
|
|
587 |
].
|
|
588 |
self open.
|
8015
|
589 |
|
9598
|
590 |
"Modified: / 26-10-2010 / 18:45:46 / cg"
|
8015
|
591 |
!
|
|
592 |
|
|
593 |
dapasSaveFile
|
9598
|
594 |
"Brings up the file save dialog."
|
|
595 |
|
|
596 |
self
|
|
597 |
hideReadonly;
|
|
598 |
overwritePrompt;
|
|
599 |
addFilter:'*.*' description:'All Files (*.*)'.
|
|
600 |
self save.
|
8015
|
601 |
|
9598
|
602 |
"Modified: / 26-10-2010 / 18:45:52 / cg"
|
8015
|
603 |
!
|
|
604 |
|
|
605 |
openFileXml
|
9598
|
606 |
"Brings up the default open file dialog "
|
|
607 |
|
|
608 |
self
|
|
609 |
hideReadonly;
|
|
610 |
shareAware;
|
|
611 |
addFilter:'*.xml' description:'XML-Files'.
|
|
612 |
self defFilter isNil ifTrue:[
|
|
613 |
self defFilter:'*.*'
|
|
614 |
].
|
|
615 |
self open.
|
8015
|
616 |
|
9598
|
617 |
"Modified: / 26-10-2010 / 18:49:00 / cg"
|
8015
|
618 |
!
|
|
619 |
|
|
620 |
openFileXmlZip
|
9598
|
621 |
"Brings up the default open file dialog "
|
|
622 |
|
|
623 |
self
|
|
624 |
hideReadonly;
|
|
625 |
shareAware;
|
|
626 |
addFilter:'*.xml' description:'XML-Datei';
|
|
627 |
addFilter:'*.zip' description:'ZIP-Datei'.
|
|
628 |
self defFilter isNil ifTrue:[
|
|
629 |
self defFilter:'*.*'
|
|
630 |
].
|
|
631 |
self open.
|
8015
|
632 |
|
9598
|
633 |
"Modified: / 26-10-2010 / 18:47:14 / cg"
|
8015
|
634 |
! !
|
|
635 |
|
9668
|
636 |
!Win32FileDialog methodsFor:'initialization & release'!
|
8015
|
637 |
|
|
638 |
cleanUp
|
9598
|
639 |
"Private - Free openFileNameStruct."
|
|
640 |
|
|
641 |
self style:self flags.
|
|
642 |
lpstrFilter notNil ifTrue:[
|
|
643 |
lpstrFilter free
|
|
644 |
].
|
|
645 |
lpstrFile notNil ifTrue:[
|
|
646 |
lpstrFile free
|
|
647 |
].
|
|
648 |
lpstrInitialDir notNil ifTrue:[
|
|
649 |
lpstrInitialDir free
|
|
650 |
].
|
|
651 |
lpstrTitle notNil ifTrue:[
|
|
652 |
lpstrTitle free
|
|
653 |
].
|
|
654 |
lpstrDefExt notNil ifTrue:[
|
|
655 |
lpstrDefExt free
|
|
656 |
].
|
|
657 |
openFileNameStruct := nil
|
8015
|
658 |
|
9598
|
659 |
"Modified: / 26-10-2010 / 18:45:33 / cg"
|
8015
|
660 |
!
|
|
661 |
|
|
662 |
initialize
|
9598
|
663 |
"Private - Initialize openFileNameStruct"
|
|
664 |
|
8015
|
665 |
super initialize.
|
9598
|
666 |
openFileNameStruct := OpenFilenameStructure new.
|
|
667 |
openFileNameStruct lStructSize:openFileNameStruct sizeInBytes.
|
9606
|
668 |
|
8015
|
669 |
fileName := String new.
|
|
670 |
filters := OrderedCollection new.
|
9598
|
671 |
self style:(self class commonDialogConstantAt:'OfnNochangedir')
|
|
672 |
|
9606
|
673 |
"Modified: / 27-10-2010 / 10:56:21 / cg"
|
8015
|
674 |
! !
|
|
675 |
|
|
676 |
!Win32FileDialog methodsFor:'opening'!
|
|
677 |
|
9698
|
678 |
asynchronousOpen
|
|
679 |
|rslt sema|
|
|
680 |
|
|
681 |
sema := Semaphore new.
|
|
682 |
[
|
|
683 |
[
|
|
684 |
self basicOpen
|
|
685 |
] ensure:[
|
|
686 |
sema signal.
|
|
687 |
].
|
|
688 |
] fork.
|
|
689 |
sema wait.
|
|
690 |
^ rslt
|
|
691 |
|
|
692 |
"Created: / 23-01-2011 / 10:59:35 / cg"
|
|
693 |
!
|
|
694 |
|
|
695 |
basicOpen
|
9597
|
696 |
"Brings up the open file dialog."
|
|
697 |
|
9698
|
698 |
|rslt openFileNameStructExternalBytes|
|
8015
|
699 |
|
9606
|
700 |
[
|
|
701 |
self fillStruct.
|
|
702 |
parent notNil ifTrue:[
|
|
703 |
openFileNameStruct hwndOwner:parent.
|
|
704 |
].
|
|
705 |
style notNil ifTrue:[
|
|
706 |
openFileNameStruct flags:style
|
8015
|
707 |
].
|
9606
|
708 |
openFileNameStructExternalBytes := ExternalBytes from:openFileNameStruct asByteArray.
|
9698
|
709 |
rslt := OperatingSystem getOpenFilename:openFileNameStructExternalBytes address.
|
9606
|
710 |
rslt ifTrue:[
|
|
711 |
self getFileName
|
|
712 |
] ifFalse:[
|
|
713 |
fileName := nil.
|
|
714 |
error := OperatingSystem commDlgExtendedError.
|
|
715 |
].
|
|
716 |
] ensure:[
|
|
717 |
openFileNameStructExternalBytes free.
|
|
718 |
self cleanUp.
|
|
719 |
].
|
9698
|
720 |
|
|
721 |
"Created: / 23-01-2011 / 10:58:30 / cg"
|
|
722 |
!
|
|
723 |
|
|
724 |
open
|
|
725 |
"Brings up the open file dialog."
|
|
726 |
|
|
727 |
true "false" ifTrue:[
|
|
728 |
self synchronousOpen.
|
|
729 |
] ifFalse:[
|
|
730 |
self asynchronousOpen.
|
|
731 |
].
|
9597
|
732 |
(error notNil and:[ error ~= 0 ]) ifTrue:[
|
|
733 |
self error:error
|
8015
|
734 |
].
|
|
735 |
|
9698
|
736 |
"Modified: / 23-01-2011 / 11:05:46 / cg"
|
8015
|
737 |
!
|
|
738 |
|
|
739 |
openFile
|
9598
|
740 |
"Brings up the default open file dialog. The title is set to 'Open File'
|
|
741 |
and fileSpec is set to '*.*'."
|
|
742 |
|
|
743 |
self openFile:'*.*'.
|
8015
|
744 |
|
9598
|
745 |
"Modified: / 26-10-2010 / 18:47:00 / cg"
|
8015
|
746 |
!
|
|
747 |
|
9598
|
748 |
openFile:initialFileName
|
|
749 |
"Brings up the default open file dialog. The title is set to 'Open File'
|
|
750 |
and fileSpec is set to patternString."
|
|
751 |
|
|
752 |
self title:'Open'.
|
|
753 |
initialFileName notNil ifTrue:[
|
|
754 |
self initialFileName:initialFileName
|
|
755 |
].
|
8015
|
756 |
self
|
|
757 |
hideReadonly;
|
|
758 |
shareAware;
|
|
759 |
addAllFilesFilter;
|
9598
|
760 |
addFilter:'*.txt' description:'Text Files (*.txt)'.
|
|
761 |
Smalltalk isStandAloneApp ifFalse:[
|
|
762 |
self addSmalltalkFileFilters
|
|
763 |
].
|
|
764 |
self defFilter isNil ifTrue:[
|
|
765 |
self defFilter:'*.*'
|
|
766 |
].
|
8015
|
767 |
self open.
|
9598
|
768 |
|
|
769 |
"Modified: / 26-10-2010 / 18:47:03 / cg"
|
8015
|
770 |
!
|
|
771 |
|
9598
|
772 |
openFor:ownerWindow save:isSaveDialog title:titleOrNil inDirectory:dirPathOrNil initialAnswer:initialOrNil filter:filterArrayOrNil extension:extensionOrNil
|
|
773 |
self
|
|
774 |
owner:ownerWindow;
|
|
775 |
title:titleOrNil;
|
|
776 |
initialFileName:initialOrNil;
|
|
777 |
defFilter:extensionOrNil;
|
|
778 |
directory:dirPathOrNil.
|
9606
|
779 |
|
8015
|
780 |
filterArrayOrNil notNil ifTrue:[
|
9598
|
781 |
filterArrayOrNil do:[:each |
|
|
782 |
self addFilter:each last description:each first
|
|
783 |
].
|
8015
|
784 |
].
|
|
785 |
self addAllFilesFilter.
|
9598
|
786 |
|
8015
|
787 |
"/ self defFilter isNil ifTrue:[ self defFilter: '*.*'].
|
9598
|
788 |
|
|
789 |
isSaveDialog ifTrue:[
|
|
790 |
self
|
|
791 |
hideReadonly;
|
|
792 |
overwritePrompt;
|
|
793 |
save.
|
|
794 |
] ifFalse:[
|
|
795 |
self
|
|
796 |
hideReadonly;
|
|
797 |
shareAware;
|
|
798 |
open.
|
|
799 |
].
|
|
800 |
^ self file
|
8015
|
801 |
|
9606
|
802 |
"Modified: / 27-10-2010 / 11:10:38 / cg"
|
8015
|
803 |
!
|
|
804 |
|
|
805 |
save
|
9597
|
806 |
"Brings up the save file dialog."
|
|
807 |
|
|
808 |
|error rslt openFileNameStructExternalBytes|
|
8015
|
809 |
|
9606
|
810 |
[
|
|
811 |
self fillStruct.
|
|
812 |
parent notNil ifTrue:[
|
|
813 |
openFileNameStruct hwndOwner:parent.
|
|
814 |
].
|
|
815 |
style notNil ifTrue:[
|
|
816 |
openFileNameStruct flags:style
|
8015
|
817 |
].
|
9606
|
818 |
openFileNameStructExternalBytes := ExternalBytes
|
|
819 |
from:openFileNameStruct asByteArray.
|
|
820 |
rslt := OperatingSystem
|
|
821 |
getSaveFilename:openFileNameStructExternalBytes address.
|
|
822 |
rslt ifTrue:[
|
|
823 |
self getFileName
|
|
824 |
] ifFalse:[
|
|
825 |
fileName := nil.
|
|
826 |
error := OperatingSystem commDlgExtendedError.
|
|
827 |
].
|
|
828 |
] ensure:[
|
|
829 |
openFileNameStructExternalBytes free.
|
|
830 |
self cleanUp.
|
|
831 |
].
|
9597
|
832 |
(error notNil and:[ error ~= 0 ]) ifTrue:[
|
|
833 |
self error:error
|
8015
|
834 |
].
|
|
835 |
|
9606
|
836 |
"Modified: / 27-10-2010 / 11:28:19 / cg"
|
8015
|
837 |
!
|
|
838 |
|
9598
|
839 |
saveFile:aString
|
|
840 |
"Brings up the save file dialog with aString as the
|
|
841 |
default name. The title is set to 'Save File'."
|
|
842 |
|
|
843 |
self saveTitle:'Save File' fileName:aString
|
8015
|
844 |
|
9598
|
845 |
"Modified: / 26-10-2010 / 18:47:32 / cg"
|
8015
|
846 |
!
|
|
847 |
|
9598
|
848 |
saveTitle:aTitle fileName:initialFileName
|
|
849 |
"Brings up the file save dialog with aTitle and aString
|
|
850 |
as the default name."
|
|
851 |
|
|
852 |
self
|
|
853 |
title:aTitle;
|
|
854 |
initialFileName:initialFileName;
|
|
855 |
hideReadonly;
|
|
856 |
overwritePrompt;
|
|
857 |
addAllFilesFilter;
|
|
858 |
addFilter:'*.txt' description:'Text Files (*.txt)'.
|
|
859 |
self save.
|
8015
|
860 |
|
9598
|
861 |
"Modified: / 26-10-2010 / 18:47:35 / cg"
|
9698
|
862 |
!
|
|
863 |
|
|
864 |
synchronousOpen
|
|
865 |
"Brings up the open file dialog."
|
|
866 |
|
|
867 |
self basicOpen.
|
|
868 |
|
|
869 |
"Modified: / 23-01-2011 / 10:59:20 / cg"
|
8015
|
870 |
! !
|
|
871 |
|
|
872 |
!Win32FileDialog methodsFor:'private'!
|
|
873 |
|
|
874 |
fillStruct
|
9598
|
875 |
"Private - fills the openFileNameStruct"
|
8015
|
876 |
|
|
877 |
| temp |
|
|
878 |
|
8037
|
879 |
temp := fileName "asAsciiZ".
|
|
880 |
lpstrFile := ExternalBytes new:512 withAll:0.
|
9606
|
881 |
lpstrFile replaceBytesFrom:1 to:temp size with:temp startingAt:1.
|
8015
|
882 |
|
8037
|
883 |
lpstrFilter := ExternalBytes newNullTerminatedFromString: self filters.
|
|
884 |
lpstrInitialDir := ExternalBytes newNullTerminatedFromString: self directory pathName.
|
8015
|
885 |
|
|
886 |
openFileNameStruct
|
|
887 |
lpstrFile: lpstrFile address ;
|
|
888 |
nMaxFile: 512;
|
|
889 |
lpstrFilter: lpstrFilter address ;
|
|
890 |
nFilterIndex: defFilterIndex ; "set by filters"
|
|
891 |
lpstrInitialDir: lpstrInitialDir address.
|
|
892 |
|
|
893 |
( temp := defExtension) notNil ifTrue: [
|
8037
|
894 |
lpstrDefExt := ExternalBytes newNullTerminatedFromString: temp.
|
8015
|
895 |
openFileNameStruct lpstrDefExt: lpstrDefExt address].
|
|
896 |
|
|
897 |
( temp := title ) notNil ifTrue: [
|
8037
|
898 |
lpstrTitle := ExternalBytes newNullTerminatedFromString: temp.
|
8015
|
899 |
openFileNameStruct lpstrTitle: lpstrTitle address ].
|
9598
|
900 |
|
9606
|
901 |
"Modified: / 27-10-2010 / 10:56:01 / cg"
|
8015
|
902 |
!
|
|
903 |
|
|
904 |
getFileName
|
9598
|
905 |
"Private - get the filename"
|
|
906 |
|
|
907 |
|directory|
|
8015
|
908 |
|
9598
|
909 |
self style:self flags.
|
|
910 |
fileName := lpstrFile stringAt:1.
|
|
911 |
directory := fileName copyFrom:1 to:openFileNameStruct nFileOffset.
|
|
912 |
self directory:directory asFilename.
|
|
913 |
|
|
914 |
"Modified: / 26-10-2010 / 18:46:45 / cg"
|
8015
|
915 |
! !
|
|
916 |
|
|
917 |
!Win32FileDialog::OpenFilenameStructure class methodsFor:'accessing'!
|
|
918 |
|
|
919 |
sizeInBytes
|
|
920 |
|
|
921 |
^ 76
|
|
922 |
! !
|
|
923 |
|
|
924 |
!Win32FileDialog::OpenFilenameStructure class methodsFor:'instance creation'!
|
|
925 |
|
|
926 |
new
|
|
927 |
|
|
928 |
^ super new: self sizeInBytes
|
|
929 |
! !
|
|
930 |
|
|
931 |
!Win32FileDialog::OpenFilenameStructure methodsFor:'accessing'!
|
|
932 |
|
|
933 |
flags
|
|
934 |
"Answer the receiver's flags field as a Smalltalk object."
|
|
935 |
|
8037
|
936 |
^ self doubleWordAt: 52+1
|
8015
|
937 |
!
|
|
938 |
|
|
939 |
flags: anObject
|
|
940 |
"Set the receiver's flags field as a Smalltalk object."
|
|
941 |
|
8037
|
942 |
^ self doubleWordAt: 52+1 put: anObject
|
8015
|
943 |
!
|
|
944 |
|
|
945 |
hInstance
|
|
946 |
"Get the receiver's hInstance field."
|
|
947 |
|
8037
|
948 |
^ self doubleWordAt: 8+1
|
8015
|
949 |
!
|
|
950 |
|
|
951 |
hInstance: anObject
|
|
952 |
"Set the receiver's hInstance field to the value of anObject."
|
|
953 |
|
8037
|
954 |
self doubleWordAt: 8+1 put: anObject
|
8015
|
955 |
!
|
|
956 |
|
|
957 |
hwndOwner
|
|
958 |
"Get the receiver's hwndOwner field."
|
|
959 |
|
8037
|
960 |
^ self doubleWordAt: 4+1
|
8015
|
961 |
!
|
|
962 |
|
|
963 |
hwndOwner: anObject
|
|
964 |
"Set the receiver's hwndOwner field to the value of anObject."
|
|
965 |
|
8037
|
966 |
self doubleWordAt: 4+1 put: anObject
|
8015
|
967 |
!
|
|
968 |
|
|
969 |
lCustData
|
|
970 |
"Get the receiver's lCustData field."
|
|
971 |
|
8037
|
972 |
^ self doubleWordAt: 64+1
|
8015
|
973 |
!
|
|
974 |
|
|
975 |
lCustData: anObject
|
|
976 |
"Set the receiver's lCustData field as a Smalltalk object."
|
|
977 |
|
8037
|
978 |
^ self doubleWordAt: 64+1 put: anObject
|
8015
|
979 |
!
|
|
980 |
|
|
981 |
lStructSize
|
|
982 |
"Get the receiver's lStructSize field."
|
|
983 |
|
8037
|
984 |
^ self doubleWordAt: 0+1
|
8015
|
985 |
!
|
|
986 |
|
|
987 |
lStructSize: anObject
|
|
988 |
"Set the receiver's lStructSize field to the value of anObject."
|
|
989 |
|
8037
|
990 |
self doubleWordAt:0+1 put:anObject
|
8015
|
991 |
!
|
|
992 |
|
|
993 |
lpfnHook
|
|
994 |
"Get the receiver's lpfnHook field."
|
|
995 |
|
8037
|
996 |
^ self doubleWordAt: 68+1
|
8015
|
997 |
!
|
|
998 |
|
|
999 |
lpfnHook: anObject
|
|
1000 |
"Set the receiver's lpfnHook field to the value of anObject."
|
|
1001 |
|
8037
|
1002 |
self doubleWordAt: 68+1 put: anObject
|
8015
|
1003 |
!
|
|
1004 |
|
|
1005 |
lpstrCustomFilter
|
|
1006 |
"Get the receiver's lpstrCustomFilter field."
|
|
1007 |
|
8037
|
1008 |
^ self doubleWordAt: 16+1
|
8015
|
1009 |
!
|
|
1010 |
|
|
1011 |
lpstrCustomFilter: anObject
|
|
1012 |
"Set the receiver's lpstrCustomFilter field to the value of anObject."
|
|
1013 |
|
8037
|
1014 |
self doubleWordAt: 16+1 put: anObject
|
8015
|
1015 |
!
|
|
1016 |
|
|
1017 |
lpstrDefExt
|
|
1018 |
"Get the receiver's lpstrDefExt field."
|
|
1019 |
|
8037
|
1020 |
^ self doubleWordAt: 60+1
|
8015
|
1021 |
!
|
|
1022 |
|
|
1023 |
lpstrDefExt: anObject
|
|
1024 |
"Set the receiver's lpstrDefExt field to the value of anObject."
|
|
1025 |
|
8037
|
1026 |
self doubleWordAt: 60+1 put: anObject
|
8015
|
1027 |
!
|
|
1028 |
|
|
1029 |
lpstrFile
|
|
1030 |
"Get the receiver's lpstrFile field."
|
|
1031 |
|
8037
|
1032 |
^ self doubleWordAt: 28+1
|
8015
|
1033 |
!
|
|
1034 |
|
|
1035 |
lpstrFile: anObject
|
|
1036 |
"Set the receiver's lpstrFile field to the value of anObject."
|
|
1037 |
|
8037
|
1038 |
self doubleWordAt: 28+1 put: anObject
|
8015
|
1039 |
!
|
|
1040 |
|
|
1041 |
lpstrFileTitle
|
|
1042 |
"Get the receiver's lpstrFileTitle field."
|
|
1043 |
|
8037
|
1044 |
^ self doubleWordAt: 36+1
|
8015
|
1045 |
!
|
|
1046 |
|
|
1047 |
lpstrFileTitle: anObject
|
|
1048 |
"Set the receiver's lpstrFileTitle field to the value of anObject."
|
|
1049 |
|
8037
|
1050 |
self doubleWordAt: 36+1 put: anObject
|
8015
|
1051 |
!
|
|
1052 |
|
|
1053 |
lpstrFilter
|
|
1054 |
"Get the receiver's lpstrFilter field."
|
|
1055 |
|
8037
|
1056 |
^ self doubleWordAt: 12+1
|
8015
|
1057 |
!
|
|
1058 |
|
|
1059 |
lpstrFilter: anObject
|
|
1060 |
"Set the receiver's lpstrFilter field to the value of anObject."
|
|
1061 |
|
8037
|
1062 |
self doubleWordAt: 12+1 put: anObject
|
8015
|
1063 |
!
|
|
1064 |
|
|
1065 |
lpstrInitialDir
|
|
1066 |
"Get the receiver's lpstrInitialDir field."
|
|
1067 |
|
8037
|
1068 |
^ self doubleWordAt: 44+1
|
8015
|
1069 |
!
|
|
1070 |
|
|
1071 |
lpstrInitialDir: anObject
|
|
1072 |
"Set the receiver's lpstrInitialDir field to the value of anObject."
|
|
1073 |
|
8037
|
1074 |
self doubleWordAt: 44+1 put: anObject
|
8015
|
1075 |
!
|
|
1076 |
|
|
1077 |
lpstrTemplateName
|
|
1078 |
"Get the receiver's lpstrTemplateName field."
|
|
1079 |
|
8037
|
1080 |
^ self doubleWordAt: 72+1
|
8015
|
1081 |
!
|
|
1082 |
|
|
1083 |
lpstrTemplateName: anObject
|
|
1084 |
"Set the receiver's lpstrTemplateName field to the value of anObject."
|
|
1085 |
|
8037
|
1086 |
self doubleWordAt: 72+1 put: anObject
|
8015
|
1087 |
!
|
|
1088 |
|
|
1089 |
lpstrTitle
|
|
1090 |
"Get the receiver's lpstrTitle field."
|
|
1091 |
|
8037
|
1092 |
^ self doubleWordAt: 48+1
|
8015
|
1093 |
!
|
|
1094 |
|
|
1095 |
lpstrTitle: anObject
|
|
1096 |
"Set the receiver's lpstrTitle field to the value of anObject."
|
|
1097 |
|
8037
|
1098 |
self doubleWordAt: 48+1 put: anObject
|
8015
|
1099 |
!
|
|
1100 |
|
|
1101 |
nFileExtension
|
|
1102 |
"Get the receiver's nFileExtension field."
|
|
1103 |
|
8037
|
1104 |
^ self unsignedShortAt: 58+1
|
8015
|
1105 |
!
|
|
1106 |
|
|
1107 |
nFileExtension: anObject
|
|
1108 |
"Set the receiver's nFileExtension field to the value of anObject."
|
|
1109 |
|
8037
|
1110 |
self unsignedShortAt: 58+1 put: anObject
|
8015
|
1111 |
!
|
|
1112 |
|
|
1113 |
nFileOffset
|
|
1114 |
"Get the receiver's nFileOffset field."
|
|
1115 |
|
8037
|
1116 |
^ self unsignedShortAt: 56+1
|
8015
|
1117 |
!
|
|
1118 |
|
|
1119 |
nFileOffset: anObject
|
|
1120 |
"Set the receiver's nFileOffset field to the value of anObject."
|
|
1121 |
|
8037
|
1122 |
self unsignedShortAt: 56+1 put: anObject
|
8015
|
1123 |
!
|
|
1124 |
|
|
1125 |
nFilterIndex
|
|
1126 |
"Get the receiver's nFilterIndex field."
|
|
1127 |
|
8037
|
1128 |
^ self doubleWordAt: 24+1
|
8015
|
1129 |
!
|
|
1130 |
|
|
1131 |
nFilterIndex: anObject
|
|
1132 |
"Set the receiver's nFilterIndex field to the value of anObject."
|
|
1133 |
|
8037
|
1134 |
self doubleWordAt: 24+1 put: anObject
|
8015
|
1135 |
!
|
|
1136 |
|
|
1137 |
nMaxCustFilter
|
|
1138 |
"Get the receiver's nMaxCustFilter field."
|
|
1139 |
|
8037
|
1140 |
^ self doubleWordAt: 20+1
|
8015
|
1141 |
!
|
|
1142 |
|
|
1143 |
nMaxCustFilter: anObject
|
|
1144 |
"Set the receiver's nMaxCustFilter field to the value of anObject."
|
|
1145 |
|
8037
|
1146 |
self doubleWordAt: 20+1 put: anObject
|
8015
|
1147 |
!
|
|
1148 |
|
|
1149 |
nMaxFile
|
|
1150 |
"Get the receiver's nMaxFile field."
|
|
1151 |
|
8037
|
1152 |
^ self doubleWordAt: 32+1
|
8015
|
1153 |
!
|
|
1154 |
|
|
1155 |
nMaxFile: anObject
|
|
1156 |
"Set the receiver's nMaxFile field to the value of anObject."
|
|
1157 |
|
8037
|
1158 |
self doubleWordAt: 32+1 put: anObject
|
8015
|
1159 |
!
|
|
1160 |
|
|
1161 |
nMaxFileTitle
|
|
1162 |
"Get the receiver's nMaxFileTitle field."
|
|
1163 |
|
8037
|
1164 |
^ self doubleWordAt: 40+1
|
8015
|
1165 |
!
|
|
1166 |
|
|
1167 |
nMaxFileTitle: anObject
|
|
1168 |
"Set the receiver's nMaxFileTitle field to the value of anObject."
|
|
1169 |
|
8037
|
1170 |
self doubleWordAt: 40+1 put: anObject
|
8015
|
1171 |
!
|
|
1172 |
|
|
1173 |
sizeInBytes
|
|
1174 |
|
|
1175 |
^ self class sizeInBytes
|
|
1176 |
! !
|
|
1177 |
|
|
1178 |
!Win32FileDialog::OpenFilenameStructure methodsFor:'printing'!
|
|
1179 |
|
|
1180 |
printOn: aStream
|
|
1181 |
|
|
1182 |
super printOn: aStream.
|
|
1183 |
aStream cr.
|
|
1184 |
aStream nextPutAll:'flags: ', self flags printString; cr.
|
|
1185 |
aStream nextPutAll:'hInstance: ', self hInstance printString; cr.
|
|
1186 |
aStream nextPutAll:'hwndOwner: ', self hwndOwner printString; cr.
|
|
1187 |
aStream nextPutAll:'lCustData: ', self lCustData printString; cr.
|
|
1188 |
aStream nextPutAll:'lpfnHook: ', self lpfnHook printString; cr.
|
|
1189 |
aStream nextPutAll:'lpstrCustomFilter: ', self lpstrCustomFilter printString; cr.
|
|
1190 |
aStream nextPutAll:'lpstrDefExt: ', self lpstrDefExt printString; cr.
|
|
1191 |
aStream nextPutAll:'lpstrFile: ', self lpstrFile printString; cr.
|
|
1192 |
aStream nextPutAll:'lpstrFileTitle: ', self lpstrFileTitle printString; cr.
|
|
1193 |
aStream nextPutAll:'lpstrFilter: ', self lpstrFilter printString; cr.
|
|
1194 |
aStream nextPutAll:'lpstrInitialDir: ', self lpstrInitialDir printString; cr.
|
|
1195 |
aStream nextPutAll:'lpstrTemplateName: ', self lpstrTemplateName printString; cr.
|
|
1196 |
aStream nextPutAll:'lStructSize: ', self lStructSize printString; cr.
|
|
1197 |
aStream nextPutAll:'nFileExtension: ', self nFileExtension printString; cr.
|
|
1198 |
aStream nextPutAll:'nFileOffset: ', self nFileOffset printString; cr.
|
|
1199 |
aStream nextPutAll:'nFilterIndex: ', self nFilterIndex printString; cr.
|
|
1200 |
aStream nextPutAll:'nMaxCustFilter: ', self nMaxCustFilter printString; cr.
|
|
1201 |
aStream nextPutAll:'nMaxFile: ', self nMaxFile printString; cr.
|
|
1202 |
aStream nextPutAll:'nMaxFileTitle: ', self nMaxFileTitle printString; cr.
|
|
1203 |
! !
|
|
1204 |
|
|
1205 |
!Win32FileDialog class methodsFor:'documentation'!
|
|
1206 |
|
|
1207 |
version
|
13577
|
1208 |
^ '$Header: /cvs/stx/stx/libtool/Win32FileDialog.st,v 1.14 2013-09-24 19:56:30 cg Exp $'
|
9345
|
1209 |
!
|
|
1210 |
|
|
1211 |
version_CVS
|
13577
|
1212 |
^ '$Header: /cvs/stx/stx/libtool/Win32FileDialog.st,v 1.14 2013-09-24 19:56:30 cg Exp $'
|
8015
|
1213 |
! !
|
9597
|
1214 |
|
13577
|
1215 |
|
9597
|
1216 |
Win32FileDialog initialize!
|