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