author | sr |
Fri, 01 Apr 2016 11:33:43 +0200 | |
changeset 16227 | be844d752234 |
parent 16171 | c0c009178dd2 |
child 16228 | b65ce693d0e6 |
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) |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
265 |
at:'*.txt' put:'Text files (*.txt)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
266 |
at:'*.st' put:'Smalltalk files (*.st)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
267 |
at:'*.java' put:'Java files (*.java)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
268 |
at:'*.csv' put:'CSV files (*.csv)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
269 |
at:'*.xml' put:'XML files (*.xml)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
270 |
at:'*.zip' put:'ZIP files (*.zip)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
271 |
at:'*.xls' put:'Excel files (*.xls)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
272 |
at:'*.ent' put:'SGML Entity files (*.ent)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
273 |
at:'*.ccs' put:'CCS files (*.ccs)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
274 |
at:'*.dll' put:'Shared Library files (*.dll)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
275 |
at:'*.ini' put:'Configuration files (*.ini)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
276 |
at:'*.prn' put:'Printer Text files (*.prn)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
277 |
at:'*.dir' put:'DapasX Database files (*.dir)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
278 |
at:'*.dat' put:'DapasX Database files (*.dat)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
279 |
at:'*.prg' put:'DapasX Program files (*.prg)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
280 |
at:'*.dcf' put:'DapasX Options files (*.dcf)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
281 |
at:'*.ext' put:'DapasX Backup files (*.ext)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
282 |
at:'*.mpl' put:'DapasX Project files (*.mpl)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
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 |
|
8015 | 293 |
|
294 |
"start a native open-file dialog. |
|
295 |
If not cancelled, the selected fileName is returned; nil otherwise. |
|
296 |
Of course, this one looks like the |
|
297 |
Windows file dialog - no matter which viewStyle settings are active. |
|
298 |
Notice: if no ownerWindow is given, the dialog pops up at 0@0. |
|
299 |
||
300 |
EXPERIMENTAL & non-portable: use with caution" |
|
301 |
||
302 |
|filePath filterArrayOrNil| |
|
303 |
||
304 |
filterArrayOrNil := self filtersFor: pattern. |
|
305 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
306 |
filePath := |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
307 |
self new |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
308 |
openFor:ownerWindow |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
309 |
save:isSaveDialog |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
310 |
title:titleOrNil |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
311 |
inDirectory:dirPathOrNil |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
312 |
initialAnswer:initialOrNil |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
313 |
filter:filterArrayOrNil |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
314 |
extension:extensionOrNil. |
8015 | 315 |
|
316 |
^ filePath |
|
317 |
! ! |
|
318 |
||
319 |
!Win32FileDialog methodsFor:'accessing'! |
|
320 |
||
321 |
addAllFilesFilter |
|
322 |
||
323 |
self addFilter: '*.*' description: 'All Files (*.*)'. |
|
324 |
! |
|
325 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
326 |
addFilter:aFilter description:aDescription |
9598 | 327 |
"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
|
328 |
|
9598 | 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 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
340 |
defExtension:aDefExtension |
9598 | 341 |
"Specifies the default extension of File dialog." |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
342 |
|
9598 | 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." |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
350 |
|
9598 | 351 |
^ defFilter |
8015 | 352 |
|
9598 | 353 |
"Modified: / 26-10-2010 / 18:45:56 / cg" |
8015 | 354 |
! |
355 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
356 |
defFilter:aDefFilterString |
9598 | 357 |
"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
|
358 |
|
9598 | 359 |
defFilter := aDefFilterString |
8015 | 360 |
|
9598 | 361 |
"Modified: / 26-10-2010 / 18:45:58 / cg" |
8015 | 362 |
! |
363 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
364 |
defFilterIndex:defaultFilterIndex |
9598 | 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." |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
372 |
|
8037 | 373 |
InitialDirectory isNil ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
374 |
^ Filename currentDirectory pathName asFilename |
8037 | 375 |
]. |
376 |
^ InitialDirectory "? OperatingSystem getCurrentDirectory asFilename" |
|
9598 | 377 |
|
378 |
"Modified: / 26-10-2010 / 18:46:03 / cg" |
|
8015 | 379 |
! |
380 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
381 |
directory:directory |
9598 | 382 |
"Sets the initial directory." |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
383 |
|
9598 | 384 |
|aFilename| |
8015 | 385 |
|
9598 | 386 |
directory isNil ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
387 |
^ self. |
9598 | 388 |
]. |
389 |
aFilename := directory asFilename. |
|
390 |
aFilename exists ifTrue:[ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
391 |
InitialDirectory := aFilename |
9598 | 392 |
]. |
8015 | 393 |
|
9598 | 394 |
"Modified: / 26-10-2010 / 18:46:06 / cg" |
8015 | 395 |
! |
396 |
||
397 |
file |
|
9598 | 398 |
"Answer the selected file." |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
399 |
|
9598 | 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 . |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
415 |
"/ dir := |
8015 | 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: [ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
433 |
self |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
434 |
addFilter: '*.cls' description: 'Class Files (*.CLS)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
435 |
addFilter: '*.mth' description: 'Method Files (*.MTH)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
436 |
addFilter: '*.st' description: 'Smalltalk Files (*.ST)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
437 |
addFilter: '*.bnd' description: 'Library Bind Files (*.BND)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
438 |
addFilter: '*.map' description: 'Library Map Files (*.MAP)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
439 |
addFilter: '*.ini' description: 'Initialization Files (*.INI)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
440 |
addFilter: '*.obj' description: 'Object Files (*.OBJ)'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
441 |
addFilter: '*.log' description: 'Log Files (*.LOG)' |
8015 | 442 |
]. |
443 |
||
444 |
defaultFilter := self defFilter. |
|
445 |
(fileName notEmptyOrNil and:[defaultFilter isNil]) ifTrue:[ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
446 |
|initialFilenameSuffix| |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
447 |
initialFilenameSuffix := fileName asFilename suffix. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
448 |
initialFilenameSuffix notEmptyOrNil ifTrue:[ |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
449 |
defaultFilter := '*.', initialFilenameSuffix. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
450 |
]. |
8015 | 451 |
]. |
452 |
||
453 |
filterString := String new. |
|
454 |
count := 0. |
|
455 |
defaultFilterIndex := 0. |
|
456 |
filters do: [:assoc | |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
457 |
count := count + 1. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
458 |
assoc key = defaultFilter ifTrue: [ defaultFilterIndex := count ]. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
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" |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
471 |
|
9598 | 472 |
^ openFileNameStruct flags |
8015 | 473 |
|
9598 | 474 |
"Modified: / 26-10-2010 / 18:46:38 / cg" |
8015 | 475 |
! |
476 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
477 |
flags:flags |
9598 | 478 |
"Private - Specifies the dialog box creation flags. |
479 |
Kept for compatibility reasons. Use style: instead" |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
480 |
|
9598 | 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. " |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
488 |
|
16171 | 489 |
self style:(self style bitOr:OFN_HIDEREADONLY) |
8015 | 490 |
|
9598 | 491 |
"Modified: / 26-10-2010 / 18:46:48 / cg" |
8015 | 492 |
! |
493 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
494 |
initialFileName:filename |
9598 | 495 |
"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
|
496 |
|
9598 | 497 |
|aString| |
8015 | 498 |
|
9598 | 499 |
filename isNil ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
500 |
^ self. |
9598 | 501 |
]. |
8015 | 502 |
aString := filename. |
9598 | 503 |
filename isFilename ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
504 |
aString := filename baseName |
9598 | 505 |
]. |
8015 | 506 |
fileName := aString. |
9598 | 507 |
|
508 |
"Modified: / 26-10-2010 / 18:46:50 / cg" |
|
8015 | 509 |
! |
510 |
||
511 |
overwritePrompt |
|
9598 | 512 |
"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
|
513 |
|
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
514 |
self style:(self style |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
515 |
bitOr: (self class commonDialogConstantAt:'OfnOverwriteprompt')) |
8015 | 516 |
|
9598 | 517 |
"Modified: / 26-10-2010 / 18:47:19 / cg" |
8015 | 518 |
! |
519 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
520 |
owner:ownerWindow |
9598 | 521 |
"Sets the owner of the Dialog box." |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
522 |
|
8015 | 523 |
|mainView handle| |
524 |
||
9598 | 525 |
ownerWindow isNil ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
526 |
^ self |
9598 | 527 |
]. |
8015 | 528 |
mainView := ownerWindow windowGroup mainView. |
529 |
mainView notNil ifTrue:[ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
530 |
handle := mainView id. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
531 |
handle notNil ifTrue:[ |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
532 |
parent := handle address |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
533 |
]. |
8015 | 534 |
]. |
535 |
||
9598 | 536 |
"/ super owner: anOwner. |
537 |
"/ owner isWindow |
|
538 |
"/ ifTrue: [ parent := owner ] |
|
539 |
"/ ifFalse: [ parent := owner mainView. |
|
540 |
"/ parent isWindow ifFalse: [ |
|
541 |
"/ parent := Notifier findWindow: WindowHandle queryActive ]]. |
|
542 |
||
543 |
"Modified: / 26-10-2010 / 18:47:22 / cg" |
|
8015 | 544 |
! |
545 |
||
546 |
pathMustExist |
|
11948 | 547 |
self style:(self style bitOr: 16r800). |
8015 | 548 |
|
9598 | 549 |
"Modified: / 26-10-2010 / 18:47:27 / cg" |
8015 | 550 |
! |
551 |
||
552 |
shareAware |
|
9598 | 553 |
"Allows a previously opened file to be opened |
554 |
(e.g. change.log)" |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
555 |
|
16171 | 556 |
self style:(self style bitOr:OFN_SHAREAWARE) |
8015 | 557 |
|
9598 | 558 |
"Modified: / 26-10-2010 / 18:47:36 / cg" |
8015 | 559 |
! |
560 |
||
561 |
style |
|
9606 | 562 |
style isNil ifTrue:[^ self class commonDialogConstantAt:'OfnNochangedir']. |
563 |
^ style |
|
564 |
||
565 |
"Modified: / 27-10-2010 / 11:07:41 / cg" |
|
8015 | 566 |
! |
567 |
||
568 |
style:something |
|
569 |
style := something. |
|
570 |
! |
|
571 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
572 |
title:aTitle |
9598 | 573 |
"Specifies the string to be placed in the title bar of the |
574 |
File dialog." |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
575 |
|
9598 | 576 |
title := aTitle |
8015 | 577 |
|
9598 | 578 |
"Modified: / 26-10-2010 / 18:47:41 / cg" |
8015 | 579 |
! ! |
580 |
||
581 |
!Win32FileDialog methodsFor:'dapas'! |
|
582 |
||
583 |
dapasOpenFile |
|
9598 | 584 |
"Brings up the default open file dialog " |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
585 |
|
9598 | 586 |
self |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
587 |
hideReadonly; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
588 |
shareAware; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
589 |
addFilter:'*.*' description:'All Files (*.*)'. |
9598 | 590 |
self defFilter isNil ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
591 |
self defFilter:'*.*' |
9598 | 592 |
]. |
593 |
self open. |
|
8015 | 594 |
|
9598 | 595 |
"Modified: / 26-10-2010 / 18:45:46 / cg" |
8015 | 596 |
! |
597 |
||
598 |
dapasSaveFile |
|
9598 | 599 |
"Brings up the file save dialog." |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
600 |
|
9598 | 601 |
self |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
602 |
hideReadonly; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
603 |
overwritePrompt; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
604 |
addFilter:'*.*' description:'All Files (*.*)'. |
9598 | 605 |
self save. |
8015 | 606 |
|
9598 | 607 |
"Modified: / 26-10-2010 / 18:45:52 / cg" |
8015 | 608 |
! |
609 |
||
610 |
openFileXml |
|
9598 | 611 |
"Brings up the default open file dialog " |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
612 |
|
9598 | 613 |
self |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
614 |
hideReadonly; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
615 |
shareAware; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
616 |
addFilter:'*.xml' description:'XML-Files'. |
9598 | 617 |
self defFilter isNil ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
618 |
self defFilter:'*.*' |
9598 | 619 |
]. |
620 |
self open. |
|
8015 | 621 |
|
9598 | 622 |
"Modified: / 26-10-2010 / 18:49:00 / cg" |
8015 | 623 |
! |
624 |
||
625 |
openFileXmlZip |
|
9598 | 626 |
"Brings up the default open file dialog " |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
627 |
|
9598 | 628 |
self |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
629 |
hideReadonly; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
630 |
shareAware; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
631 |
addFilter:'*.xml' description:'XML-Datei'; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
632 |
addFilter:'*.zip' description:'ZIP-Datei'. |
9598 | 633 |
self defFilter isNil ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
634 |
self defFilter:'*.*' |
9598 | 635 |
]. |
636 |
self open. |
|
8015 | 637 |
|
9598 | 638 |
"Modified: / 26-10-2010 / 18:47:14 / cg" |
8015 | 639 |
! ! |
640 |
||
9668 | 641 |
!Win32FileDialog methodsFor:'initialization & release'! |
8015 | 642 |
|
643 |
cleanUp |
|
9598 | 644 |
"Private - Free openFileNameStruct." |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
645 |
|
9598 | 646 |
self style:self flags. |
647 |
lpstrFilter notNil ifTrue:[ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
648 |
lpstrFilter free |
9598 | 649 |
]. |
650 |
lpstrFile notNil ifTrue:[ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
651 |
lpstrFile free |
9598 | 652 |
]. |
653 |
lpstrInitialDir notNil ifTrue:[ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
654 |
lpstrInitialDir free |
9598 | 655 |
]. |
656 |
lpstrTitle notNil ifTrue:[ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
657 |
lpstrTitle free |
9598 | 658 |
]. |
659 |
lpstrDefExt notNil ifTrue:[ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
660 |
lpstrDefExt free |
9598 | 661 |
]. |
662 |
openFileNameStruct := nil |
|
8015 | 663 |
|
9598 | 664 |
"Modified: / 26-10-2010 / 18:45:33 / cg" |
8015 | 665 |
! |
666 |
||
667 |
initialize |
|
9598 | 668 |
"Private - Initialize openFileNameStruct" |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
669 |
|
8015 | 670 |
super initialize. |
9598 | 671 |
openFileNameStruct := OpenFilenameStructure new. |
672 |
openFileNameStruct lStructSize:openFileNameStruct sizeInBytes. |
|
9606 | 673 |
|
8015 | 674 |
fileName := String new. |
675 |
filters := OrderedCollection new. |
|
9598 | 676 |
self style:(self class commonDialogConstantAt:'OfnNochangedir') |
677 |
||
9606 | 678 |
"Modified: / 27-10-2010 / 10:56:21 / cg" |
8015 | 679 |
! ! |
680 |
||
681 |
!Win32FileDialog methodsFor:'opening'! |
|
682 |
||
9698 | 683 |
asynchronousOpen |
684 |
|rslt sema| |
|
685 |
||
686 |
sema := Semaphore new. |
|
687 |
[ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
688 |
[ |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
689 |
self basicOpen |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
690 |
] ensure:[ |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
691 |
sema signal. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
692 |
]. |
9698 | 693 |
] fork. |
694 |
sema wait. |
|
695 |
^ rslt |
|
696 |
||
697 |
"Created: / 23-01-2011 / 10:59:35 / cg" |
|
698 |
! |
|
699 |
||
700 |
basicOpen |
|
9597 | 701 |
"Brings up the open file dialog." |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
702 |
|
9698 | 703 |
|rslt openFileNameStructExternalBytes| |
8015 | 704 |
|
9606 | 705 |
[ |
16171 | 706 |
self fillStruct. |
707 |
parent notNil ifTrue:[ |
|
708 |
openFileNameStruct hwndOwner:parent. |
|
709 |
]. |
|
710 |
style notNil ifTrue:[ |
|
711 |
openFileNameStruct flags:style |
|
712 |
]. |
|
713 |
openFileNameStructExternalBytes := ExternalBytes from:openFileNameStruct asByteArray. |
|
714 |
rslt := OperatingSystem getOpenFilename:openFileNameStructExternalBytes. |
|
715 |
rslt ifTrue:[ |
|
716 |
self getFileName |
|
717 |
] ifFalse:[ |
|
718 |
fileName := nil. |
|
719 |
error := OperatingSystem commDlgExtendedError. |
|
720 |
self error:('GetOpenFile failed with error: %1' bindWith:error). |
|
721 |
]. |
|
9606 | 722 |
] ensure:[ |
16171 | 723 |
openFileNameStructExternalBytes notNil ifTrue:[openFileNameStructExternalBytes free]. |
724 |
self cleanUp. |
|
9606 | 725 |
]. |
9698 | 726 |
|
727 |
"Created: / 23-01-2011 / 10:58:30 / cg" |
|
13923 | 728 |
"Modified: / 11-02-2014 / 11:24:23 / cg" |
9698 | 729 |
! |
730 |
||
731 |
open |
|
732 |
"Brings up the open file dialog." |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
733 |
|
9698 | 734 |
true "false" ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
735 |
self synchronousOpen. |
9698 | 736 |
] ifFalse:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
737 |
self asynchronousOpen. |
9698 | 738 |
]. |
9597 | 739 |
(error notNil and:[ error ~= 0 ]) ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
740 |
self error:error |
8015 | 741 |
]. |
742 |
||
9698 | 743 |
"Modified: / 23-01-2011 / 11:05:46 / cg" |
8015 | 744 |
! |
745 |
||
746 |
openFile |
|
9598 | 747 |
"Brings up the default open file dialog. The title is set to 'Open File' |
748 |
and fileSpec is set to '*.*'." |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
749 |
|
9598 | 750 |
self openFile:'*.*'. |
8015 | 751 |
|
9598 | 752 |
"Modified: / 26-10-2010 / 18:47:00 / cg" |
8015 | 753 |
! |
754 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
755 |
openFile:initialFileName |
9598 | 756 |
"Brings up the default open file dialog. The title is set to 'Open File' |
757 |
and fileSpec is set to patternString." |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
758 |
|
9598 | 759 |
self title:'Open'. |
760 |
initialFileName notNil ifTrue:[ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
761 |
self initialFileName:initialFileName |
9598 | 762 |
]. |
8015 | 763 |
self |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
764 |
hideReadonly; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
765 |
shareAware; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
766 |
addAllFilesFilter; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
767 |
addFilter:'*.txt' description:'Text Files (*.txt)'. |
9598 | 768 |
Smalltalk isStandAloneApp ifFalse:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
769 |
self addSmalltalkFileFilters |
9598 | 770 |
]. |
771 |
self defFilter isNil ifTrue:[ |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
772 |
self defFilter:'*.*' |
9598 | 773 |
]. |
8015 | 774 |
self open. |
9598 | 775 |
|
776 |
"Modified: / 26-10-2010 / 18:47:03 / cg" |
|
8015 | 777 |
! |
778 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
779 |
openFor:ownerWindow save:isSaveDialog title:titleOrNil inDirectory:dirPathOrNil initialAnswer:initialOrNil filter:filterArrayOrNil extension:extensionOrNil |
9598 | 780 |
self |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
781 |
owner:ownerWindow; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
782 |
title:titleOrNil; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
783 |
initialFileName:initialOrNil; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
784 |
defFilter:extensionOrNil; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
785 |
directory:dirPathOrNil. |
9606 | 786 |
|
8015 | 787 |
filterArrayOrNil notNil ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
788 |
filterArrayOrNil do:[:each | |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
789 |
self addFilter:each last description:each first |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
790 |
]. |
8015 | 791 |
]. |
792 |
self addAllFilesFilter. |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
793 |
|
8015 | 794 |
"/ self defFilter isNil ifTrue:[ self defFilter: '*.*']. |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
795 |
|
9598 | 796 |
isSaveDialog ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
797 |
self |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
798 |
hideReadonly; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
799 |
overwritePrompt; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
800 |
save. |
9598 | 801 |
] ifFalse:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
802 |
self |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
803 |
hideReadonly; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
804 |
shareAware; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
805 |
open. |
9598 | 806 |
]. |
807 |
^ self file |
|
8015 | 808 |
|
9606 | 809 |
"Modified: / 27-10-2010 / 11:10:38 / cg" |
8015 | 810 |
! |
811 |
||
812 |
save |
|
9597 | 813 |
"Brings up the save file dialog." |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
814 |
|
9597 | 815 |
|error rslt openFileNameStructExternalBytes| |
8015 | 816 |
|
9606 | 817 |
[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
818 |
self fillStruct. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
819 |
parent notNil ifTrue:[ |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
820 |
openFileNameStruct hwndOwner:parent. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
821 |
]. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
822 |
style notNil ifTrue:[ |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
823 |
openFileNameStruct flags:style |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
824 |
]. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
825 |
openFileNameStructExternalBytes := ExternalBytes |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
826 |
from:openFileNameStruct asByteArray. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
827 |
rslt := OperatingSystem getSaveFilename:openFileNameStructExternalBytes. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
828 |
rslt ifTrue:[ |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
829 |
self getFileName |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
830 |
] ifFalse:[ |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
831 |
fileName := nil. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
832 |
error := OperatingSystem commDlgExtendedError. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
833 |
]. |
9606 | 834 |
] ensure:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
835 |
openFileNameStructExternalBytes free. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
836 |
self cleanUp. |
9606 | 837 |
]. |
9597 | 838 |
(error notNil and:[ error ~= 0 ]) ifTrue:[ |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
839 |
self error:error |
8015 | 840 |
]. |
841 |
||
13924 | 842 |
"Modified: / 11-02-2014 / 21:13:43 / cg" |
8015 | 843 |
! |
844 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
845 |
saveFile:aString |
9598 | 846 |
"Brings up the save file dialog with aString as the |
847 |
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
|
848 |
|
9598 | 849 |
self saveTitle:'Save File' fileName:aString |
8015 | 850 |
|
9598 | 851 |
"Modified: / 26-10-2010 / 18:47:32 / cg" |
8015 | 852 |
! |
853 |
||
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
854 |
saveTitle:aTitle fileName:initialFileName |
9598 | 855 |
"Brings up the file save dialog with aTitle and aString |
856 |
as the default name." |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
857 |
|
9598 | 858 |
self |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
859 |
title:aTitle; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
860 |
initialFileName:initialFileName; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
861 |
hideReadonly; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
862 |
overwritePrompt; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
863 |
addAllFilesFilter; |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
864 |
addFilter:'*.txt' description:'Text Files (*.txt)'. |
9598 | 865 |
self save. |
8015 | 866 |
|
9598 | 867 |
"Modified: / 26-10-2010 / 18:47:35 / cg" |
9698 | 868 |
! |
869 |
||
870 |
synchronousOpen |
|
871 |
"Brings up the open file dialog." |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
872 |
|
9698 | 873 |
self basicOpen. |
874 |
||
875 |
"Modified: / 23-01-2011 / 10:59:20 / cg" |
|
8015 | 876 |
! ! |
877 |
||
878 |
!Win32FileDialog methodsFor:'private'! |
|
879 |
||
880 |
fillStruct |
|
9598 | 881 |
"Private - fills the openFileNameStruct" |
8015 | 882 |
|
16171 | 883 |
|maxPath lpstrFileInOut| |
8015 | 884 |
|
16171 | 885 |
maxPath := 1024. |
886 |
lpstrFileInOut := ExternalBytes new:maxPath. |
|
887 |
lpstrFileInOut replaceFrom:1 to:fileName size with:fileName startingAt:1. |
|
8015 | 888 |
|
8037 | 889 |
lpstrFilter := ExternalBytes newNullTerminatedFromString: self filters. |
890 |
lpstrInitialDir := ExternalBytes newNullTerminatedFromString: self directory pathName. |
|
8015 | 891 |
|
892 |
openFileNameStruct |
|
16171 | 893 |
lpstrFile: lpstrFileInOut address ; |
894 |
nMaxFile: maxPath; |
|
895 |
lpstrFilter: lpstrFilter address ; |
|
896 |
nFilterIndex: defFilterIndex ; "set by filters" |
|
897 |
lpstrInitialDir: lpstrInitialDir address. |
|
8015 | 898 |
|
16171 | 899 |
defExtension notNil ifTrue: [ |
900 |
lpstrDefExt := ExternalBytes newNullTerminatedFromString: defExtension. |
|
901 |
openFileNameStruct lpstrDefExt: lpstrDefExt address]. |
|
8015 | 902 |
|
16171 | 903 |
title notNil ifTrue: [ |
904 |
lpstrTitle := ExternalBytes newNullTerminatedFromString: title. |
|
905 |
openFileNameStruct lpstrTitle: lpstrTitle address ]. |
|
9598 | 906 |
|
9606 | 907 |
"Modified: / 27-10-2010 / 10:56:01 / cg" |
8015 | 908 |
! |
909 |
||
910 |
getFileName |
|
9598 | 911 |
"Private - get the filename" |
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
912 |
|
9598 | 913 |
|directory| |
8015 | 914 |
|
9598 | 915 |
self style:self flags. |
916 |
fileName := lpstrFile stringAt:1. |
|
917 |
directory := fileName copyFrom:1 to:openFileNameStruct nFileOffset. |
|
918 |
self directory:directory asFilename. |
|
919 |
||
920 |
"Modified: / 26-10-2010 / 18:46:45 / cg" |
|
8015 | 921 |
! ! |
922 |
||
923 |
!Win32FileDialog::OpenFilenameStructure class methodsFor:'accessing'! |
|
924 |
||
16227 | 925 |
fieldNames |
926 |
^ #(lStructSize hwndOwner hInstance Flags lpstrFilter lpstrCustomFilter) |
|
927 |
||
928 |
" |
|
929 |
OLEStructure getFieldInfoFor:self |
|
930 |
" |
|
931 |
! |
|
932 |
||
8015 | 933 |
sizeInBytes |
16169 | 934 |
ExternalAddress pointerSize == 8 ifTrue:[ |
935 |
^ 124 |
|
936 |
] ifFalse:[ |
|
937 |
^ 76 |
|
938 |
] |
|
16227 | 939 |
! |
940 |
||
941 |
structureName |
|
942 |
^ 'OPENFILENAME' |
|
943 |
||
944 |
" |
|
945 |
OLEStructure getFieldInfoFor:self |
|
946 |
" |
|
16169 | 947 |
! ! |
8015 | 948 |
|
16169 | 949 |
!Win32FileDialog::OpenFilenameStructure class methodsFor:'documentation'! |
950 |
||
951 |
documentation |
|
952 |
" |
|
953 |
definitely needs a rewrite to use inline C code. |
|
954 |
This is unmaintanable... |
|
955 |
||
956 |
32bit 64bit |
|
957 |
typedef struct tagOFNA { |
|
958 |
DWORD lStructSize; 4 0 4 0 |
|
959 |
HWND hwndOwner; 4 4 8 4 |
|
960 |
HINSTANCE hInstance; 4 8 8 12 |
|
961 |
LPCSTR lpstrFilter; 4 12 8 20 |
|
962 |
LPSTR lpstrCustomFilter; 4 16 8 28 |
|
963 |
DWORD nMaxCustFilter; 4 20 4 36 |
|
964 |
DWORD nFilterIndex; 4 24 4 40 |
|
965 |
LPSTR lpstrFile; 4 28 8 44 |
|
966 |
DWORD nMaxFile; 4 32 4 52 |
|
967 |
LPSTR lpstrFileTitle; 4 36 8 56 |
|
968 |
DWORD nMaxFileTitle; 4 40 4 64 |
|
969 |
LPCSTR lpstrInitialDir; 4 44 8 68 |
|
970 |
LPCSTR lpstrTitle; 4 48 8 76 |
|
971 |
DWORD Flags; 4 52 4 84 |
|
972 |
WORD nFileOffset; 2 56 2 88 |
|
973 |
WORD nFileExtension; 2 58 2 90 |
|
974 |
LPCSTR lpstrDefExt; 4 60 8 92 |
|
975 |
LPARAM lCustData; 4 64 8 100 |
|
976 |
LPOFNHOOKPROC lpfnHook; 4 68 8 108 |
|
977 |
LPCSTR lpTemplateName; 4 72 8 116 |
|
978 |
void *pvReserved; 4 76 8 124 |
|
979 |
DWORD dwReserved; 4 80 4 132 |
|
980 |
DWORD FlagsEx; 4 84 4 136 |
|
981 |
} OPENFILENAMEA,*LPOPENFILENAMEA; 88 140 |
|
982 |
||
983 |
" |
|
8015 | 984 |
! ! |
985 |
||
986 |
!Win32FileDialog::OpenFilenameStructure class methodsFor:'instance creation'! |
|
987 |
||
988 |
new |
|
989 |
||
990 |
^ super new: self sizeInBytes |
|
991 |
! ! |
|
992 |
||
993 |
!Win32FileDialog::OpenFilenameStructure methodsFor:'accessing'! |
|
994 |
||
995 |
flags |
|
996 |
"Answer the receiver's flags field as a Smalltalk object." |
|
997 |
||
16169 | 998 |
ExternalAddress pointerSize == 8 ifTrue:[ |
16227 | 999 |
^ self unsignedInt32At: 96+1 |
16169 | 1000 |
] ifFalse:[ |
1001 |
^ self unsignedInt32At: 52+1 |
|
1002 |
] |
|
8015 | 1003 |
! |
1004 |
||
1005 |
flags: anObject |
|
1006 |
"Set the receiver's flags field as a Smalltalk object." |
|
1007 |
||
16169 | 1008 |
ExternalAddress pointerSize == 8 ifTrue:[ |
16227 | 1009 |
self unsignedInt32At: 96+1 put: anObject |
16169 | 1010 |
] ifFalse:[ |
1011 |
self unsignedInt32At: 52+1 put: anObject |
|
1012 |
] |
|
8015 | 1013 |
! |
1014 |
||
1015 |
hInstance |
|
1016 |
"Get the receiver's hInstance field." |
|
1017 |
||
16169 | 1018 |
ExternalAddress pointerSize == 8 ifTrue:[ |
16227 | 1019 |
^ self unsignedInt64At: 16+1 |
16169 | 1020 |
] ifFalse:[ |
1021 |
^ self unsignedInt32At: 8+1 |
|
1022 |
] |
|
8015 | 1023 |
! |
1024 |
||
16169 | 1025 |
hInstance: anInteger |
1026 |
"Set the receiver's hInstance field to the value of anInteger." |
|
8015 | 1027 |
|
16169 | 1028 |
ExternalAddress pointerSize == 8 ifTrue:[ |
16227 | 1029 |
self unsignedInt64At: 16+1 put: anInteger |
16169 | 1030 |
] ifFalse:[ |
1031 |
self unsignedInt32At: 8+1 put: anInteger |
|
1032 |
] |
|
8015 | 1033 |
! |
1034 |
||
1035 |
hwndOwner |
|
1036 |
"Get the receiver's hwndOwner field." |
|
1037 |
||
16169 | 1038 |
ExternalAddress pointerSize == 8 ifTrue:[ |
16227 | 1039 |
^ self unsignedInt64At: 8+1 |
16169 | 1040 |
] ifFalse:[ |
1041 |
^ self unsignedInt32At: 4+1 |
|
1042 |
] |
|
8015 | 1043 |
! |
1044 |
||
16169 | 1045 |
hwndOwner: anInteger |
1046 |
"Set the receiver's hwndOwner field to the value of anInteger." |
|
8015 | 1047 |
|
16169 | 1048 |
ExternalAddress pointerSize == 8 ifTrue:[ |
16227 | 1049 |
self unsignedInt64At: 8+1 put: anInteger |
16169 | 1050 |
] ifFalse:[ |
1051 |
self unsignedInt32At: 4+1 put: anInteger |
|
1052 |
] |
|
8015 | 1053 |
! |
1054 |
||
1055 |
lCustData |
|
1056 |
"Get the receiver's lCustData field." |
|
1057 |
||
16169 | 1058 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1059 |
^ self unsignedInt64At: 100+1 |
|
1060 |
] ifFalse:[ |
|
1061 |
^ self unsignedInt32At: 64+1 |
|
1062 |
] |
|
8015 | 1063 |
! |
1064 |
||
1065 |
lCustData: anObject |
|
1066 |
"Set the receiver's lCustData field as a Smalltalk object." |
|
1067 |
||
16169 | 1068 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1069 |
self unsignedInt64At: 100+1 put: anObject |
|
1070 |
] ifFalse:[ |
|
1071 |
self unsignedInt32At: 64+1 put: anObject |
|
1072 |
] |
|
8015 | 1073 |
! |
1074 |
||
1075 |
lStructSize |
|
1076 |
"Get the receiver's lStructSize field." |
|
1077 |
||
16169 | 1078 |
^ self unsignedInt32At: 0+1 |
8015 | 1079 |
! |
1080 |
||
1081 |
lStructSize: anObject |
|
1082 |
"Set the receiver's lStructSize field to the value of anObject." |
|
1083 |
||
16169 | 1084 |
self unsignedInt32At:0+1 put:anObject |
8015 | 1085 |
! |
1086 |
||
1087 |
lpfnHook |
|
1088 |
"Get the receiver's lpfnHook field." |
|
1089 |
||
16169 | 1090 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1091 |
^ self unsignedInt64At: 108+1 |
|
1092 |
] ifFalse:[ |
|
1093 |
^ self unsignedInt32At: 68+1 |
|
1094 |
] |
|
8015 | 1095 |
! |
1096 |
||
1097 |
lpfnHook: anObject |
|
1098 |
"Set the receiver's lpfnHook field to the value of anObject." |
|
1099 |
||
16169 | 1100 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1101 |
^ self unsignedInt64At: 108+1 put: anObject |
|
1102 |
] ifFalse:[ |
|
1103 |
^ self unsignedInt32At: 68+1 put: anObject |
|
1104 |
] |
|
8015 | 1105 |
! |
1106 |
||
1107 |
lpstrCustomFilter |
|
1108 |
"Get the receiver's lpstrCustomFilter field." |
|
1109 |
||
16169 | 1110 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1111 |
^ self unsignedInt64At: 28+1 |
|
1112 |
] ifFalse:[ |
|
1113 |
^ self unsignedInt32At: 16+1 |
|
1114 |
] |
|
8015 | 1115 |
! |
1116 |
||
1117 |
lpstrCustomFilter: anObject |
|
1118 |
"Set the receiver's lpstrCustomFilter field to the value of anObject." |
|
1119 |
||
16169 | 1120 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1121 |
^ self unsignedInt64At: 28+1 put: anObject |
|
1122 |
] ifFalse:[ |
|
1123 |
^ self unsignedInt32At: 16+1 put: anObject |
|
1124 |
] |
|
8015 | 1125 |
! |
1126 |
||
1127 |
lpstrDefExt |
|
1128 |
"Get the receiver's lpstrDefExt field." |
|
1129 |
||
16169 | 1130 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1131 |
^ self unsignedInt64At: 92+1 |
|
1132 |
] ifFalse:[ |
|
1133 |
^ self unsignedInt32At: 60+1 |
|
1134 |
] |
|
8015 | 1135 |
! |
1136 |
||
1137 |
lpstrDefExt: anObject |
|
1138 |
"Set the receiver's lpstrDefExt field to the value of anObject." |
|
1139 |
||
16169 | 1140 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1141 |
^ self unsignedInt64At: 92+1 put: anObject |
|
1142 |
] ifFalse:[ |
|
1143 |
^ self unsignedInt32At: 60+1 put: anObject |
|
1144 |
] |
|
8015 | 1145 |
! |
1146 |
||
1147 |
lpstrFile |
|
1148 |
"Get the receiver's lpstrFile field." |
|
1149 |
||
16169 | 1150 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1151 |
^ self unsignedInt64At: 44+1 |
|
1152 |
] ifFalse:[ |
|
1153 |
^ self unsignedInt32At: 28+1 |
|
1154 |
] |
|
8015 | 1155 |
! |
1156 |
||
1157 |
lpstrFile: anObject |
|
1158 |
"Set the receiver's lpstrFile field to the value of anObject." |
|
1159 |
||
16169 | 1160 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1161 |
^ self unsignedInt64At: 44+1 put: anObject |
|
1162 |
] ifFalse:[ |
|
1163 |
^ self unsignedInt32At: 28+1 put: anObject |
|
1164 |
] |
|
8015 | 1165 |
! |
1166 |
||
1167 |
lpstrFileTitle |
|
1168 |
"Get the receiver's lpstrFileTitle field." |
|
1169 |
||
16169 | 1170 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1171 |
^ self unsignedInt64At: 56+1 |
|
1172 |
] ifFalse:[ |
|
1173 |
^ self unsignedInt32At: 36+1 |
|
1174 |
] |
|
8015 | 1175 |
! |
1176 |
||
1177 |
lpstrFileTitle: anObject |
|
1178 |
"Set the receiver's lpstrFileTitle field to the value of anObject." |
|
1179 |
||
16169 | 1180 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1181 |
^ self unsignedInt64At: 56+1 put: anObject |
|
1182 |
] ifFalse:[ |
|
1183 |
^ self unsignedInt32At: 36+1 put: anObject |
|
1184 |
] |
|
8015 | 1185 |
! |
1186 |
||
1187 |
lpstrFilter |
|
1188 |
"Get the receiver's lpstrFilter field." |
|
1189 |
||
16169 | 1190 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1191 |
^ self unsignedInt64At: 20+1 |
|
1192 |
] ifFalse:[ |
|
1193 |
^ self unsignedInt32At: 12+1 |
|
1194 |
] |
|
8015 | 1195 |
! |
1196 |
||
1197 |
lpstrFilter: anObject |
|
1198 |
"Set the receiver's lpstrFilter field to the value of anObject." |
|
1199 |
||
16169 | 1200 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1201 |
^ self unsignedInt64At: 20+1 put: anObject |
|
1202 |
] ifFalse:[ |
|
1203 |
^ self unsignedInt32At: 12+1 put: anObject |
|
1204 |
] |
|
8015 | 1205 |
! |
1206 |
||
1207 |
lpstrInitialDir |
|
1208 |
"Get the receiver's lpstrInitialDir field." |
|
1209 |
||
16169 | 1210 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1211 |
^ self unsignedInt64At: 68+1 |
|
1212 |
] ifFalse:[ |
|
1213 |
^ self unsignedInt32At: 44+1 |
|
1214 |
] |
|
8015 | 1215 |
! |
1216 |
||
1217 |
lpstrInitialDir: anObject |
|
1218 |
"Set the receiver's lpstrInitialDir field to the value of anObject." |
|
1219 |
||
16169 | 1220 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1221 |
^ self unsignedInt64At: 68+1 put: anObject |
|
1222 |
] ifFalse:[ |
|
1223 |
^ self unsignedInt32At: 44+1 put: anObject |
|
1224 |
] |
|
8015 | 1225 |
! |
1226 |
||
1227 |
lpstrTemplateName |
|
1228 |
"Get the receiver's lpstrTemplateName field." |
|
1229 |
||
16169 | 1230 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1231 |
^ self unsignedInt64At: 116+1 |
|
1232 |
] ifFalse:[ |
|
1233 |
^ self unsignedInt32At: 72+1 |
|
1234 |
] |
|
8015 | 1235 |
! |
1236 |
||
1237 |
lpstrTemplateName: anObject |
|
1238 |
"Set the receiver's lpstrTemplateName field to the value of anObject." |
|
1239 |
||
16169 | 1240 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1241 |
^ self unsignedInt64At: 116+1 put: anObject |
|
1242 |
] ifFalse:[ |
|
1243 |
^ self unsignedInt32At: 72+1 put: anObject |
|
1244 |
] |
|
8015 | 1245 |
! |
1246 |
||
1247 |
lpstrTitle |
|
1248 |
"Get the receiver's lpstrTitle field." |
|
1249 |
||
16169 | 1250 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1251 |
^ self unsignedInt64At: 76+1 |
|
1252 |
] ifFalse:[ |
|
1253 |
^ self unsignedInt32At: 48+1 |
|
1254 |
] |
|
8015 | 1255 |
! |
1256 |
||
1257 |
lpstrTitle: anObject |
|
1258 |
"Set the receiver's lpstrTitle field to the value of anObject." |
|
1259 |
||
16169 | 1260 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1261 |
^ self unsignedInt64At: 76+1 put: anObject |
|
1262 |
] ifFalse:[ |
|
1263 |
^ self unsignedInt32At: 48+1 put: anObject |
|
1264 |
] |
|
8015 | 1265 |
! |
1266 |
||
1267 |
nFileExtension |
|
1268 |
"Get the receiver's nFileExtension field." |
|
1269 |
||
16169 | 1270 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1271 |
^ self unsignedInt16At: 90+1 |
|
1272 |
] ifFalse:[ |
|
1273 |
^ self unsignedInt16At: 58+1 |
|
1274 |
] |
|
8015 | 1275 |
! |
1276 |
||
1277 |
nFileExtension: anObject |
|
1278 |
"Set the receiver's nFileExtension field to the value of anObject." |
|
1279 |
||
16169 | 1280 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1281 |
^ self unsignedInt16At: 90+1 put: anObject |
|
1282 |
] ifFalse:[ |
|
1283 |
^ self unsignedInt16At: 58+1 put: anObject |
|
1284 |
] |
|
8015 | 1285 |
! |
1286 |
||
1287 |
nFileOffset |
|
1288 |
"Get the receiver's nFileOffset field." |
|
1289 |
||
16169 | 1290 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1291 |
^ self unsignedInt16At: 88+1 |
|
1292 |
] ifFalse:[ |
|
1293 |
^ self unsignedInt16At: 56+1 |
|
1294 |
] |
|
8015 | 1295 |
! |
1296 |
||
1297 |
nFileOffset: anObject |
|
1298 |
"Set the receiver's nFileOffset field to the value of anObject." |
|
1299 |
||
16169 | 1300 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1301 |
^ self unsignedInt16At: 88+1 put: anObject |
|
1302 |
] ifFalse:[ |
|
1303 |
^ self unsignedInt16At: 56+1 put: anObject |
|
1304 |
] |
|
8015 | 1305 |
! |
1306 |
||
1307 |
nFilterIndex |
|
1308 |
"Get the receiver's nFilterIndex field." |
|
1309 |
||
16169 | 1310 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1311 |
^ self unsignedInt32At: 40+1 |
|
1312 |
] ifFalse:[ |
|
1313 |
^ self unsignedInt32At: 24+1 |
|
1314 |
] |
|
8015 | 1315 |
! |
1316 |
||
1317 |
nFilterIndex: anObject |
|
1318 |
"Set the receiver's nFilterIndex field to the value of anObject." |
|
1319 |
||
16169 | 1320 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1321 |
^ self unsignedInt32At: 40+1 put: anObject |
|
1322 |
] ifFalse:[ |
|
1323 |
^ self unsignedInt32At: 24+1 put: anObject |
|
1324 |
] |
|
8015 | 1325 |
! |
1326 |
||
1327 |
nMaxCustFilter |
|
1328 |
"Get the receiver's nMaxCustFilter field." |
|
1329 |
||
16169 | 1330 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1331 |
^ self unsignedInt32At: 36+1 |
|
1332 |
] ifFalse:[ |
|
1333 |
^ self unsignedInt32At: 20+1 |
|
1334 |
] |
|
8015 | 1335 |
! |
1336 |
||
1337 |
nMaxCustFilter: anObject |
|
1338 |
"Set the receiver's nMaxCustFilter field to the value of anObject." |
|
1339 |
||
16169 | 1340 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1341 |
^ self unsignedInt32At: 36+1 put: anObject |
|
1342 |
] ifFalse:[ |
|
1343 |
^ self unsignedInt32At: 20+1 put: anObject |
|
1344 |
] |
|
8015 | 1345 |
! |
1346 |
||
1347 |
nMaxFile |
|
1348 |
"Get the receiver's nMaxFile field." |
|
1349 |
||
16169 | 1350 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1351 |
^ self unsignedInt32At: 52+1 |
|
1352 |
] ifFalse:[ |
|
1353 |
^ self unsignedInt32At: 32+1 |
|
1354 |
] |
|
8015 | 1355 |
! |
1356 |
||
1357 |
nMaxFile: anObject |
|
1358 |
"Set the receiver's nMaxFile field to the value of anObject." |
|
1359 |
||
16169 | 1360 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1361 |
^ self unsignedInt32At: 52+1 put: anObject |
|
1362 |
] ifFalse:[ |
|
1363 |
^ self unsignedInt32At: 32+1 put: anObject |
|
1364 |
] |
|
8015 | 1365 |
! |
1366 |
||
1367 |
nMaxFileTitle |
|
1368 |
"Get the receiver's nMaxFileTitle field." |
|
1369 |
||
16169 | 1370 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1371 |
^ self unsignedInt32At: 64+1 |
|
1372 |
] ifFalse:[ |
|
1373 |
^ self unsignedInt32At: 40+1 |
|
1374 |
] |
|
8015 | 1375 |
! |
1376 |
||
1377 |
nMaxFileTitle: anObject |
|
1378 |
"Set the receiver's nMaxFileTitle field to the value of anObject." |
|
1379 |
||
16169 | 1380 |
ExternalAddress pointerSize == 8 ifTrue:[ |
1381 |
^ self unsignedInt32At: 64+1 put: anObject |
|
1382 |
] ifFalse:[ |
|
1383 |
^ self unsignedInt32At: 40+1 put: anObject |
|
1384 |
] |
|
8015 | 1385 |
! |
1386 |
||
1387 |
sizeInBytes |
|
1388 |
||
1389 |
^ self class sizeInBytes |
|
1390 |
! ! |
|
1391 |
||
1392 |
!Win32FileDialog::OpenFilenameStructure methodsFor:'printing'! |
|
1393 |
||
1394 |
printOn: aStream |
|
1395 |
||
1396 |
super printOn: aStream. |
|
1397 |
aStream cr. |
|
1398 |
aStream nextPutAll:'flags: ', self flags printString; cr. |
|
1399 |
aStream nextPutAll:'hInstance: ', self hInstance printString; cr. |
|
1400 |
aStream nextPutAll:'hwndOwner: ', self hwndOwner printString; cr. |
|
1401 |
aStream nextPutAll:'lCustData: ', self lCustData printString; cr. |
|
1402 |
aStream nextPutAll:'lpfnHook: ', self lpfnHook printString; cr. |
|
1403 |
aStream nextPutAll:'lpstrCustomFilter: ', self lpstrCustomFilter printString; cr. |
|
1404 |
aStream nextPutAll:'lpstrDefExt: ', self lpstrDefExt printString; cr. |
|
1405 |
aStream nextPutAll:'lpstrFile: ', self lpstrFile printString; cr. |
|
1406 |
aStream nextPutAll:'lpstrFileTitle: ', self lpstrFileTitle printString; cr. |
|
1407 |
aStream nextPutAll:'lpstrFilter: ', self lpstrFilter printString; cr. |
|
1408 |
aStream nextPutAll:'lpstrInitialDir: ', self lpstrInitialDir printString; cr. |
|
1409 |
aStream nextPutAll:'lpstrTemplateName: ', self lpstrTemplateName printString; cr. |
|
1410 |
aStream nextPutAll:'lStructSize: ', self lStructSize printString; cr. |
|
14829
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
1411 |
aStream nextPutAll:'nFileExtension: ', self nFileExtension printString; cr. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
1412 |
aStream nextPutAll:'nFileOffset: ', self nFileOffset printString; cr. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
1413 |
aStream nextPutAll:'nFilterIndex: ', self nFilterIndex printString; cr. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
1414 |
aStream nextPutAll:'nMaxCustFilter: ', self nMaxCustFilter printString; cr. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
1415 |
aStream nextPutAll:'nMaxFile: ', self nMaxFile printString; cr. |
82b109435616
do not hardcode program files
Claus Gittinger <cg@exept.de>
parents:
13924
diff
changeset
|
1416 |
aStream nextPutAll:'nMaxFileTitle: ', self nMaxFileTitle printString; cr. |
8015 | 1417 |
! ! |
1418 |
||
1419 |
!Win32FileDialog class methodsFor:'documentation'! |
|
1420 |
||
1421 |
version |
|
16169 | 1422 |
^ '$Header$' |
9345 | 1423 |
! |
1424 |
||
1425 |
version_CVS |
|
16169 | 1426 |
^ '$Header$' |
8015 | 1427 |
! ! |
9597 | 1428 |
|
13577 | 1429 |
|
9597 | 1430 |
Win32FileDialog initialize! |