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