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