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