author | Claus Gittinger <cg@exept.de> |
Mon, 19 Nov 2001 16:29:07 +0100 | |
changeset 1533 | b6b2f8ab4e4a |
parent 1520 | 6ee198fcb0e0 |
child 1563 | 166f840701bf |
permissions | -rw-r--r-- |
89 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
434 | 3 |
All Rights Reserved |
89 | 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 |
" |
|
12 |
||
1395 | 13 |
"{ Package: 'stx:libview2' }" |
14 |
||
100 | 15 |
Object subclass:#WindowBuilder |
855
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
16 |
instanceVariableNames:'window application bindings visuals labels focusSequence |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
17 |
namedComponents helpKeys componentCreationHook applicationClass |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
18 |
keyboardProcessor subCanvasSpecs' |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
19 |
classVariableNames:'StopOnError Verbose' |
436 | 20 |
poolDictionaries:'' |
21 |
category:'Interface-Support-UI' |
|
66 | 22 |
! |
23 |
||
24 |
!WindowBuilder class methodsFor:'documentation'! |
|
25 |
||
89 | 26 |
copyright |
27 |
" |
|
28 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
434 | 29 |
All Rights Reserved |
89 | 30 |
|
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! |
|
39 |
||
66 | 40 |
documentation |
41 |
" |
|
69 | 42 |
a no-op class, for systems which do not use the UIBuilder. |
66 | 43 |
Concrete subclasses know how to create a view (with components) from |
848 | 44 |
some interface spec. |
45 |
||
46 |
The order of the lookup sequence to access an aspect is defined: |
|
47 |
application |
|
48 |
application class |
|
49 |
additional class (applicationClass). |
|
50 |
||
51 |
Methods to access any aspect are located in the category |
|
52 |
'spec creation aspect fetch'. |
|
53 |
||
735 | 54 |
Currently, an experimantal version of UIBuilder exists, |
66 | 55 |
and more may be added in the future (for example, to parse different UI |
735 | 56 |
specs - thinking of motifs UIL specs, Windows DialogSpecs etc.). |
223 | 57 |
|
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
58 |
[instance variables:] |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
59 |
window <View> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
60 |
the topView into which the components |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
61 |
are (have been) created from the specification |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
62 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
63 |
application <ApplicationModel> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
64 |
the application object (typically an instance |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
65 |
of a subclass of ApplicationModel). |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
66 |
That one is usually supposed to provide |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
67 |
valueHolders for aspects, action methods |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
68 |
menuSpecs and possibly more windowSpecs. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
69 |
Usually means, that most of those can also be |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
70 |
provided to the builder via a set of bindings, |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
71 |
which overrides those. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
72 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
73 |
bindings <Dictionary> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
74 |
can be set (or filled) with bindings for |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
75 |
aspects to be used when setting up the models |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
76 |
for components. Useful either to overwrite |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
77 |
corresponding appModel aspects or if the appModel |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
78 |
does not want to procide those. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
79 |
(for example, to open a dialog and provide the |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
80 |
bindings in a dictionary - as opposed to |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
81 |
providing them via aspect methods) |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
82 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
83 |
visuals not yet used - for compatibility |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
84 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
85 |
focusSequence <Collection> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
86 |
maintained during the build process; |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
87 |
contains tabable components. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
88 |
This will be replaced by a more intelligent |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
89 |
mechanism in the near future. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
90 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
91 |
namedComponents <Dictionary> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
92 |
contains name->component associations for |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
93 |
all components which have a non-nil component |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
94 |
name. Created during the build process. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
95 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
96 |
helpKeys not yet used - for compatibility |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
97 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
98 |
componentCreationHook <BlockOrNil> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
99 |
can be set before the components are built |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
100 |
from the spec, to provide an arbitrary |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
101 |
callBacks-hook which will be invoked after |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
102 |
a component has been created from a spec. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
103 |
The UIPainter uses this to maintain its |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
104 |
component<->spec assiciations. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
105 |
Can be set by the app, to catch creation of |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
106 |
components and fiddle around during the |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
107 |
creation process (change extents, colors or whatever) |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
108 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
109 |
applicationClass <ClassOrNil> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
110 |
can be set to provide an additional class which |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
111 |
is asked for aspects during the build process. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
112 |
If not set, the app is asked, which itself asks |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
113 |
its class. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
114 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
115 |
keyboardProcessor not yet used - for compatibility |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
116 |
Will eventually takeover the functionality |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
117 |
of the focusSequence, shortcuts & provide a hook |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
118 |
for the app. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
119 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
120 |
subCanvasSpecs <Dictionary> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
121 |
can be set by the app to provide subcanvas |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
122 |
specs (much like the bindings dictionary) |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
123 |
|
223 | 124 |
[author:] |
125 |
Claus Gittinger |
|
66 | 126 |
" |
127 |
! ! |
|
128 |
||
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
129 |
!WindowBuilder class methodsFor:'debugging'! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
130 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
131 |
stopOnError:aBoolean |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
132 |
"enable/disable debug halt when aspects are missing. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
133 |
Useful during development, to detect missing aspects. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
134 |
The default is off." |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
135 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
136 |
StopOnError := aBoolean |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
137 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
138 |
"Modified: / 4.8.1998 / 19:40:09 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
139 |
! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
140 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
141 |
verbose:aBoolean |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
142 |
"enable/disable debug messages on the Transcript. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
143 |
Useful during development, to detect missing aspects. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
144 |
The default is off." |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
145 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
146 |
Verbose := aBoolean |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
147 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
148 |
"Created: / 4.8.1998 / 19:39:37 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
149 |
"Modified: / 4.8.1998 / 19:40:14 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
150 |
! ! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
151 |
|
1498 | 152 |
!WindowBuilder methodsFor:'Compatibility - VW'! |
974 | 153 |
|
154 |
source |
|
155 |
"same as #application, for ST-80 compatibility" |
|
156 |
||
157 |
^ application |
|
158 |
||
159 |
"Created: 17.1.1997 / 19:03:51 / cg" |
|
160 |
! |
|
161 |
||
162 |
source:anApplicationModel |
|
163 |
"same as #application:, for ST-80 compatibility" |
|
164 |
||
165 |
application := anApplicationModel |
|
166 |
||
167 |
"Modified: 17.1.1997 / 19:03:57 / cg" |
|
168 |
! ! |
|
169 |
||
66 | 170 |
!WindowBuilder methodsFor:'accessing'! |
171 |
||
463 | 172 |
addBindings:moreBindings |
173 |
"used with subDialogs, which provide local bindings. |
|
174 |
All bindings from moreBindings overwrite any local bindings." |
|
175 |
||
176 |
moreBindings notNil ifTrue:[ |
|
177 |
moreBindings keysAndValuesDo:[:aKey :aValue | |
|
178 |
bindings at:aKey put:aValue |
|
179 |
] |
|
180 |
] |
|
181 |
||
182 |
"Created: 28.2.1997 / 14:14:33 / cg" |
|
183 |
! |
|
184 |
||
100 | 185 |
application |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
186 |
"return the application (an ApplicationModel), |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
187 |
for which the view is built. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
188 |
This one is supposed to provide the aspects, menus etc." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
189 |
|
100 | 190 |
^ application |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
191 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
192 |
"Modified: 17.1.1997 / 19:04:40 / cg" |
66 | 193 |
! |
194 |
||
125 | 195 |
application:anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
196 |
"set the application (an ApplicationModel), |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
197 |
for which the view is built. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
198 |
This one is supposed to provide the aspects, menus etc." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
199 |
|
125 | 200 |
application := anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
201 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
202 |
"Modified: 17.1.1997 / 19:04:47 / cg" |
66 | 203 |
! |
204 |
||
1155 | 205 |
applicationClass |
206 |
"return the value of the instance variable 'applicationClass' (automatically generated). |
|
207 |
This is a private interface for the UIPainter to pass down the app-class |
|
208 |
to the specs when editing." |
|
209 |
||
210 |
^ applicationClass |
|
211 |
! |
|
212 |
||
422 | 213 |
applicationClass:something |
1155 | 214 |
"set the value of the instance variable 'applicationClass' (automatically generated). |
215 |
This is a private interface for the UIPainter to pass down the app-class |
|
216 |
to the specs when editing." |
|
422 | 217 |
|
1155 | 218 |
applicationClass := something. |
219 |
! |
|
422 | 220 |
|
66 | 221 |
aspectAt:aSymbol |
848 | 222 |
"return the aspect for a symbol or nil. |
223 |
" |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
224 |
^ self |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
225 |
aspectAt:aSymbol |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
226 |
ifAbsent:[self aspectNotFound:aSymbol error:'no aspect for:'] |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
227 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
228 |
"Modified: / 4.8.1998 / 19:29:36 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
229 |
! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
230 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
231 |
aspectAt:aSymbol ifAbsent:exceptionBlock |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
232 |
"return the aspect for a symbol or the value from exceptionBlock. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
233 |
" |
433 | 234 |
|b| |
235 |
||
473 | 236 |
aSymbol notNil ifTrue:[ |
237 |
bindings notNil ifTrue:[ |
|
238 |
b := bindings at:aSymbol ifAbsent:nil. |
|
239 |
b notNil ifTrue:[^ b]. |
|
240 |
]. |
|
434 | 241 |
|
473 | 242 |
application notNil ifTrue:[ |
577 | 243 |
Object messageNotUnderstoodSignal handle:[:ex | |
727 | 244 |
ex parameter selector == aSymbol ifFalse:[ |
245 |
ex reject |
|
246 |
] |
|
577 | 247 |
] do:[ |
473 | 248 |
^ application aspectFor:aSymbol |
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
249 |
]. |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
250 |
Object messageNotUnderstoodSignal handle:[:ex | |
727 | 251 |
ex parameter selector == aSymbol ifFalse:[ |
252 |
ex reject |
|
253 |
] |
|
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
254 |
] do:[ |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
255 |
^ application class aspectFor:aSymbol |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
256 |
]. |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
257 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
258 |
^ exceptionBlock value. |
848 | 259 |
] |
433 | 260 |
]. |
261 |
^ nil |
|
970
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
262 |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
263 |
"Created: / 4.8.1998 / 19:28:30 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
264 |
"Modified: / 4.8.1998 / 19:37:02 / cg" |
66 | 265 |
! |
266 |
||
125 | 267 |
aspectAt:aSymbol put:aModel |
848 | 268 |
"store an aspect identified by its symbol and its value |
269 |
" |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
270 |
bindings isNil ifTrue:[ |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
271 |
bindings := IdentityDictionary new |
125 | 272 |
]. |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
273 |
^ bindings at:aSymbol put:aModel |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
274 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
275 |
"Modified: 17.1.1997 / 19:28:37 / cg" |
100 | 276 |
! |
277 |
||
450 | 278 |
bindingAt:aSymbol |
1344 | 279 |
"return the binding for a symbol or nil if there is none |
848 | 280 |
" |
450 | 281 |
bindings notNil ifTrue:[ |
282 |
^ bindings at:aSymbol ifAbsent:nil. |
|
283 |
]. |
|
284 |
^ nil |
|
285 |
! |
|
286 |
||
100 | 287 |
bindings |
848 | 288 |
"return my bindings |
289 |
" |
|
100 | 290 |
^ bindings |
291 |
! |
|
292 |
||
293 |
bindings:aDictionary |
|
848 | 294 |
"set bindings to a dictionary |
295 |
" |
|
100 | 296 |
bindings := aDictionary |
297 |
! |
|
298 |
||
125 | 299 |
componentAt:name |
848 | 300 |
"return a component identified by its name. |
301 |
" |
|
1208 | 302 |
|
303 |
|widget appBuilder masterApplication masterBuilder| |
|
304 |
||
305 |
namedComponents notNil ifTrue:[ |
|
306 |
widget := namedComponents at:name asSymbol ifAbsent:nil. |
|
307 |
widget notNil ifTrue:[^ widget]. |
|
308 |
]. |
|
309 |
||
310 |
"/ cg the following code looks in any application- |
|
311 |
"/ or master applications builder for the component. |
|
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
312 |
"/ This has an effect, if a subcanvases builder is asked for |
1208 | 313 |
"/ a component, which is actually held by the real-apps builder |
314 |
"/ (in case they have different builders). |
|
315 |
"/ For now, this code is disabled, since I dont know what effect this |
|
316 |
"/ has to existing code ... |
|
317 |
||
318 |
"/ application notNil ifTrue:[ |
|
319 |
"/ (appBuilder := application builder) notNil ifTrue:[ |
|
320 |
"/ appBuilder ~~ self ifTrue:[ |
|
321 |
"/ ^ appBuilder componentAt:name |
|
322 |
"/ ] |
|
323 |
"/ ]. |
|
324 |
"/ |
|
325 |
"/ (masterApplication := application masterApplication) notNil ifTrue:[ |
|
326 |
"/ (masterBuilder := masterApplication builder) notNil ifTrue:[ |
|
327 |
"/ masterBuilder ~~ self ifTrue:[ |
|
328 |
"/ ^ masterBuilder componentAt:name |
|
329 |
"/ ] |
|
330 |
"/ ] |
|
331 |
"/ ] |
|
332 |
"/ ]. |
|
333 |
^ nil |
|
125 | 334 |
! |
335 |
||
100 | 336 |
componentAt:name put:aComponent |
848 | 337 |
"store a component identified by its name. |
338 |
" |
|
450 | 339 |
namedComponents isNil ifTrue:[ |
340 |
namedComponents := IdentityDictionary new. |
|
100 | 341 |
]. |
450 | 342 |
namedComponents at:name asSymbol put:aComponent |
100 | 343 |
! |
344 |
||
410 | 345 |
componentCreationHook:something |
346 |
"set the value of the instance variable 'componentCreationHook' (automatically generated)" |
|
347 |
||
1447 | 348 |
componentCreationHook := something. |
349 |
! |
|
410 | 350 |
|
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
351 |
findComponentAt:name |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
352 |
"recursively search for a component identified by its name in myself |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
353 |
and all of my subApplications. |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
354 |
" |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
355 |
|
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
356 |
|comp app b| |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
357 |
|
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
358 |
(comp := self componentAt:name) notNil ifTrue:[^ comp]. |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
359 |
self window allSubViewsDo:[:v | |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
360 |
((app := v application) notNil |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
361 |
and:[(b := app builder) notNil |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
362 |
and:[b ~~ self |
1505
c7cd2082381b
fixed #findComponentAt: (to recurse)
Claus Gittinger <cg@exept.de>
parents:
1498
diff
changeset
|
363 |
and:[(comp := b findComponentAt:name) notNil]]]) ifTrue:[ |
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
364 |
^ comp |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
365 |
] |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
366 |
]. |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
367 |
^ nil |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
368 |
! |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
369 |
|
125 | 370 |
focusSequence |
848 | 371 |
"return my focus sequence |
372 |
" |
|
1139 | 373 |
|
374 |
focusSequence isNil ifTrue:[ |
|
375 |
focusSequence := OrderedCollection new |
|
376 |
]. |
|
125 | 377 |
^ focusSequence |
1139 | 378 |
|
379 |
"Modified: / 12.3.1999 / 00:02:04 / cg" |
|
66 | 380 |
! |
381 |
||
600 | 382 |
helpKeyFor:aComponent |
848 | 383 |
"return the helpkey for a component or nil |
384 |
" |
|
600 | 385 |
|v key| |
386 |
||
387 |
helpKeys isNil ifTrue:[^ nil]. |
|
388 |
v := aComponent. |
|
389 |
[v notNil] whileTrue:[ |
|
390 |
(key := helpKeys at:v ifAbsent:nil) notNil ifTrue:[ |
|
391 |
^ key |
|
392 |
]. |
|
393 |
v := v superView |
|
394 |
]. |
|
595 | 395 |
^ nil |
600 | 396 |
! |
595 | 397 |
|
600 | 398 |
helpKeyFor:aComponent put:aKey |
848 | 399 |
"assign a key for a component which is used to access the help text |
400 |
from the application. |
|
401 |
" |
|
600 | 402 |
aKey isNil ifTrue:[ |
403 |
helpKeys isNil ifFalse:[ |
|
404 |
helpKeys removeKey:aComponent ifAbsent:nil |
|
405 |
] |
|
406 |
] ifFalse:[ |
|
407 |
helpKeys isNil ifTrue:[ |
|
408 |
helpKeys := IdentityDictionary new |
|
409 |
]. |
|
410 |
helpKeys at:aComponent put:aKey |
|
411 |
] |
|
595 | 412 |
|
413 |
! |
|
414 |
||
477 | 415 |
keyboardProcessor |
848 | 416 |
"return my keyboard processor |
417 |
" |
|
477 | 418 |
keyboardProcessor isNil ifTrue:[ |
419 |
keyboardProcessor := KeyboardProcessor new |
|
420 |
]. |
|
421 |
^ keyboardProcessor |
|
422 |
||
423 |
"Created: 3.3.1997 / 18:31:37 / cg" |
|
424 |
"Modified: 3.3.1997 / 18:32:27 / cg" |
|
425 |
! |
|
426 |
||
970
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
427 |
keyboardProcessor:aKeyboardProcessor |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
428 |
"set my keyboard processor |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
429 |
" |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
430 |
keyboardProcessor := aKeyboardProcessor |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
431 |
|
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
432 |
"Created: / 18.6.1998 / 19:59:38 / cg" |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
433 |
! |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
434 |
|
855
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
435 |
labelAt:name |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
436 |
labels isNil ifTrue:[^ nil]. |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
437 |
^ labels at:name asSymbol ifAbsent:nil |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
438 |
|
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
439 |
"Created: / 27.2.1998 / 13:52:28 / cg" |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
440 |
! |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
441 |
|
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
442 |
labelAt:name put:aLabelString |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
443 |
labels isNil ifTrue:[ |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
444 |
labels := IdentityDictionary new. |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
445 |
]. |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
446 |
labels at:name asSymbol put:aLabelString |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
447 |
|
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
448 |
"Created: / 27.2.1998 / 02:30:54 / cg" |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
449 |
! |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
450 |
|
848 | 451 |
menuAt:aKey |
452 |
"Find a binding for the menu named aKey, either in the bindings |
|
453 |
or from the source" |
|
454 |
||
455 |
^ self menuFor:aKey |
|
456 |
||
457 |
||
458 |
! |
|
459 |
||
460 |
menuAt:aSymbol put:someMenuOrHolder |
|
461 |
"add someMenuOrHolder as the binding for the menu named aSymbol to the bindings" |
|
462 |
||
463 |
^ self aspectAt:aSymbol put:someMenuOrHolder |
|
464 |
||
465 |
! |
|
466 |
||
86 | 467 |
namedComponents |
848 | 468 |
"return list of named components |
469 |
" |
|
450 | 470 |
^ namedComponents |
86 | 471 |
! |
472 |
||
502 | 473 |
subCanvasAt:majorKey at:minorKey |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
474 |
"get the subCanvas or subSpec specification from major and minor key. |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
475 |
Here, we first look for a spec in the private subCanvasSpecs dictionary, |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
476 |
which can be filled via #specificationAt:at:put: messages. |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
477 |
If not present, or none is found there, we bounce back trying |
824 | 478 |
#specificationFor: (if majorKey is nil) or by sending the minorKey |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
479 |
message to the class named as majorKey. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
480 |
Notice, that the class named majorKey is first searched in the |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
481 |
application classes namespace - allowing private classes as majorKey. |
586 | 482 |
" |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
483 |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
484 |
|spec cls dict dkey| |
502 | 485 |
|
1351
42d9de8818bf
care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
486 |
minorKey isNil ifTrue:[^ nil]. |
42d9de8818bf
care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
487 |
|
502 | 488 |
subCanvasSpecs notNil ifTrue:[ |
586 | 489 |
dkey := majorKey ? #NoMajorKey. |
490 |
dict := subCanvasSpecs at:dkey ifAbsent:nil. |
|
491 |
||
492 |
dict notNil ifTrue:[ |
|
493 |
spec := dict at:minorKey ifAbsent:nil. |
|
502 | 494 |
spec notNil ifTrue:[^ spec]. |
495 |
]. |
|
496 |
]. |
|
586 | 497 |
|
502 | 498 |
majorKey isNil ifTrue:[ |
848 | 499 |
^ self specificationFor:minorKey |
500 |
]. |
|
501 |
||
502 |
application notNil ifTrue:[ |
|
503 |
"/ look for class in applications namespace ... |
|
504 |
cls := application resolveName:majorKey. |
|
502 | 505 |
] ifFalse:[ |
848 | 506 |
"/ fallBack - use that global, if it exists |
507 |
cls := Smalltalk at:majorKey. |
|
508 |
cls isNil ifTrue:[ |
|
509 |
Transcript showCR:('WindowBuilder[warning]: missing application when fetching majorKey:' , majorKey). |
|
735 | 510 |
]. |
502 | 511 |
]. |
586 | 512 |
|
848 | 513 |
cls notNil ifTrue:[ |
514 |
Object messageNotUnderstoodSignal handle:[:ex|] do:[ |
|
515 |
^ cls specificationFor:minorKey |
|
516 |
]. |
|
517 |
Object messageNotUnderstoodSignal handle:[:ex|] do:[ |
|
518 |
^ cls perform:minorKey. |
|
519 |
] |
|
520 |
]. |
|
521 |
^ nil |
|
502 | 522 |
! |
523 |
||
524 |
subCanvasAt:majorKey at:minorKey put:aSpec |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
525 |
"deposit an interfaceSpecification for major and minor key |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
526 |
in my private subCanvasSpecs dictionary. |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
527 |
This will be used later, when building, |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
528 |
to provide an interfaceSpec for a subcanvas or subSpecification |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
529 |
(or possibly override an application provided interfaceSpec). |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
530 |
See #subCanvasAt:at:." |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
531 |
|
502 | 532 |
|dict key| |
533 |
||
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
534 |
subCanvasSpecs isNil ifTrue:[ |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
535 |
"/ lazyly initialize |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
536 |
subCanvasSpecs := IdentityDictionary new |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
537 |
]. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
538 |
|
502 | 539 |
key := majorKey ? #NoMajorKey. |
540 |
dict := subCanvasSpecs at:key ifAbsent:nil. |
|
541 |
dict isNil ifTrue:[ |
|
542 |
dict := IdentityDictionary new. |
|
543 |
subCanvasSpecs at:key put:dict |
|
544 |
]. |
|
545 |
dict at:minorKey put:aSpec |
|
546 |
||
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
547 |
"Modified: / 27.1.1998 / 12:21:27 / cg" |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
548 |
"Modified: / 5.2.1998 / 12:05:32 / stefan" |
502 | 549 |
! |
550 |
||
475
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
551 |
visualAt:name |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
552 |
visuals isNil ifTrue:[^ nil]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
553 |
^ visuals at:name asSymbol ifAbsent:nil |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
554 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
555 |
"Created: 3.3.1997 / 16:24:17 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
556 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
557 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
558 |
visualAt:name put:aVisual |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
559 |
visuals isNil ifTrue:[ |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
560 |
visuals := IdentityDictionary new. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
561 |
]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
562 |
visuals at:name asSymbol put:aVisual |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
563 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
564 |
"Created: 3.3.1997 / 16:24:41 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
565 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
566 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
567 |
visuals |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
568 |
^ visuals |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
569 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
570 |
"Created: 3.3.1997 / 16:24:00 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
571 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
572 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
573 |
visuals:aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
574 |
visuals := aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
575 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
576 |
"Created: 3.3.1997 / 16:24:06 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
577 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
578 |
|
125 | 579 |
window |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
580 |
"return the top window (view), for which an interface |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
581 |
is (being) built" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
582 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
583 |
^ window |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
584 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
585 |
"Modified: 17.1.1997 / 19:30:00 / cg" |
125 | 586 |
! |
587 |
||
588 |
window:aView |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
589 |
"set the top window (view), for which an interface |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
590 |
is (being) built" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
591 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
592 |
window := aView |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
593 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
594 |
"Modified: 17.1.1997 / 19:30:22 / cg" |
66 | 595 |
! |
596 |
||
597 |
windowGroup |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
598 |
^ window windowGroup |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
599 |
|
608 | 600 |
"Modified: 17.6.1997 / 18:04:01 / cg" |
66 | 601 |
! ! |
602 |
||
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
603 |
!WindowBuilder methodsFor:'aspect access support'! |
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
604 |
|
675 | 605 |
booleanValueAspectFor:aKey |
674 | 606 |
"helper (common code) to generate a boolean aspect if required. |
607 |
If no binding exists for aKey, a valueHolder holding false is |
|
608 |
created and added to the bindings. |
|
609 |
Otherwise, the existing binding is returned." |
|
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
610 |
|
676 | 611 |
^ self valueAspectFor:aKey initialValue:false |
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
612 |
|
676 | 613 |
"Modified: 28.7.1997 / 12:53:57 / cg" |
675 | 614 |
! |
615 |
||
1198
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
616 |
listAspectFor:aKey |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
617 |
"helper (common code) to generate a list model aspect if required. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
618 |
If no binding exists for aKey, a new List is |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
619 |
created and added to the bindings. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
620 |
Otherwise, the existing binding is returned." |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
621 |
|
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
622 |
|list| |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
623 |
|
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
624 |
(list := self bindingAt:aKey) isNil ifTrue:[ |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
625 |
self aspectAt:aKey put:(list := List new). |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
626 |
]. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
627 |
^ list |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
628 |
|
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
629 |
"Created: 28.7.1997 / 12:53:45 / cg" |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
630 |
"Modified: 28.7.1997 / 12:54:13 / cg" |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
631 |
! |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
632 |
|
675 | 633 |
nilValueAspectFor:aKey |
634 |
"helper (common code) to generate a valueHolder aspect if required. |
|
635 |
If no binding exists for aKey, a valueHolder holding nil is |
|
636 |
created and added to the bindings. |
|
637 |
Otherwise, the existing binding is returned." |
|
638 |
||
676 | 639 |
^ self valueAspectFor:aKey initialValue:nil |
640 |
||
641 |
"Modified: 28.7.1997 / 12:54:06 / cg" |
|
642 |
! |
|
643 |
||
644 |
valueAspectFor:aKey initialValue:initialValue |
|
645 |
"helper (common code) to generate a valueHolder aspect if required. |
|
646 |
If no binding exists for aKey, a valueHolder holding initialValue is |
|
647 |
created and added to the bindings. |
|
648 |
Otherwise, the existing binding is returned." |
|
649 |
||
675 | 650 |
|holder| |
651 |
||
652 |
(holder := self bindingAt:aKey) isNil ifTrue:[ |
|
676 | 653 |
self aspectAt:aKey put:(holder := initialValue asValue). |
675 | 654 |
]. |
655 |
^ holder |
|
656 |
||
676 | 657 |
"Created: 28.7.1997 / 12:53:45 / cg" |
658 |
"Modified: 28.7.1997 / 12:54:13 / cg" |
|
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
659 |
! ! |
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
660 |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
661 |
!WindowBuilder methodsFor:'building'! |
66 | 662 |
|
125 | 663 |
buildFromSpec:aSpec |
176 | 664 |
^ self subclassResponsibility |
408 | 665 |
! |
666 |
||
667 |
makeTabable:aComponent |
|
735 | 668 |
"add a component to the list of tabable components" |
669 |
||
1315 | 670 |
aComponent canTab:true |
735 | 671 |
|
1123 | 672 |
! |
673 |
||
674 |
setupWindowFor:aWindow |
|
675 |
self subclassResponsibility |
|
66 | 676 |
! ! |
100 | 677 |
|
848 | 678 |
!WindowBuilder methodsFor:'error handling'! |
679 |
||
680 |
aspectNotFound:anAspect error:aString |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
681 |
"show error message on transcript (if Verbose is true) |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
682 |
and/or stop (if StopOnError) is true. |
848 | 683 |
" |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
684 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
685 |
Verbose == true ifTrue:[ |
1395 | 686 |
Transcript showCR:('WindowBuilder: %1 aspect: <%2>' bindWith:aString with:anAspect storeString). |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
687 |
application notNil ifTrue:[ |
1395 | 688 |
Transcript showCR:('WindowBuilder: (while building for %1)' bindWith:application class name). |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
689 |
]. |
1028
4f3401b606bd
better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
690 |
]. |
848 | 691 |
|
692 |
StopOnError == true ifTrue:[ |
|
1395 | 693 |
self halt:'aspect not found' "/ avoids debugger in end-user apps |
848 | 694 |
]. |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
695 |
^ nil |
1028
4f3401b606bd
better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
696 |
|
1395 | 697 |
"Modified: / 18.8.2000 / 14:10:59 / cg" |
848 | 698 |
! ! |
699 |
||
586 | 700 |
!WindowBuilder methodsFor:'message sending'! |
701 |
||
848 | 702 |
safelyPerform:aSelector ifNone:aBlock |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
703 |
"send the message aSelector to the application; |
586 | 704 |
the result returned from the send or nil is returned |
705 |
" |
|
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
706 |
|cls handlerBlock| |
586 | 707 |
|
848 | 708 |
aSelector notNil ifTrue:[ |
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
709 |
handlerBlock := [:ex| |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
710 |
(ex parameter selector ~~ aSelector) ifTrue:[ |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
711 |
ex reject |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
712 |
] |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
713 |
]. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
714 |
|
595 | 715 |
application notNil ifTrue:[ |
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
716 |
application messageNotUnderstoodSignal handle:handlerBlock do:[ |
848 | 717 |
^ application perform:aSelector |
718 |
]. |
|
719 |
cls := application class. |
|
720 |
||
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
721 |
cls messageNotUnderstoodSignal handle:handlerBlock do:[ |
848 | 722 |
^ cls perform:aSelector |
595 | 723 |
] |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
724 |
]. |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
725 |
applicationClass notNil ifTrue:[ |
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
726 |
applicationClass messageNotUnderstoodSignal handle:handlerBlock do:[ |
848 | 727 |
^ applicationClass perform:aSelector |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
728 |
] |
586 | 729 |
] |
730 |
]. |
|
848 | 731 |
^ aBlock value |
981
6a9c975543ad
also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents:
974
diff
changeset
|
732 |
|
6a9c975543ad
also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents:
974
diff
changeset
|
733 |
"Modified: / 20.6.1998 / 11:52:19 / cg" |
586 | 734 |
! |
735 |
||
848 | 736 |
safelyPerform:aSelector with:anArgument ifNone:aBlock |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
737 |
"send the one-arg-message aSelector to the application; |
586 | 738 |
the result returned from the send or nil is returned |
739 |
" |
|
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
740 |
|cls handlerBlock| |
586 | 741 |
|
848 | 742 |
aSelector notNil ifTrue:[ |
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
743 |
handlerBlock := [:ex| |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
744 |
|badSel| |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
745 |
|
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
746 |
badSel := ex parameter selector. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
747 |
(badSel ~~ aSelector and:[badSel ~~ anArgument]) ifTrue:[ |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
748 |
ex reject |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
749 |
] |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
750 |
]. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
751 |
|
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
752 |
application notNil ifTrue:[ |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
753 |
application messageNotUnderstoodSignal handle:handlerBlock do:[ |
848 | 754 |
^ application perform:aSelector with:anArgument |
755 |
]. |
|
756 |
cls := application class. |
|
757 |
||
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
758 |
cls messageNotUnderstoodSignal handle:handlerBlock do:[ |
848 | 759 |
^ cls perform:aSelector with:anArgument |
595 | 760 |
] |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
761 |
]. |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
762 |
applicationClass notNil ifTrue:[ |
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
763 |
applicationClass messageNotUnderstoodSignal handle:handlerBlock do:[ |
848 | 764 |
^ applicationClass perform:aSelector with:anArgument |
765 |
]. |
|
766 |
] |
|
767 |
]. |
|
768 |
^ aBlock value |
|
961 | 769 |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
770 |
"Modified: / 4.8.1998 / 19:33:52 / cg" |
848 | 771 |
! |
772 |
||
773 |
safelyPerform:aSelector with:arg1 with:arg2 ifNone:aBlock |
|
774 |
"send the two-arg-message aSelector to the application; |
|
775 |
the result returned from the send or nil is returned |
|
776 |
" |
|
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
777 |
|cls handlerBlock| |
848 | 778 |
|
779 |
aSelector notNil ifTrue:[ |
|
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
780 |
handlerBlock := [:ex| |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
781 |
|badSel| |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
782 |
|
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
783 |
badSel := ex parameter selector. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
784 |
(badSel ~~ aSelector and:[badSel ~~ arg1]) ifTrue:[ |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
785 |
ex reject |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
786 |
] |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
787 |
]. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
788 |
|
848 | 789 |
application notNil ifTrue:[ |
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
790 |
application messageNotUnderstoodSignal handle:handlerBlock do:[ |
848 | 791 |
^ application perform:aSelector with:arg1 with:arg2 |
792 |
]. |
|
793 |
cls := application class. |
|
794 |
||
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
795 |
cls messageNotUnderstoodSignal handle:handlerBlock do:[ |
848 | 796 |
^ cls perform:aSelector with:arg1 with:arg2 |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
797 |
] |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
798 |
]. |
848 | 799 |
applicationClass notNil ifTrue:[ |
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
800 |
applicationClass messageNotUnderstoodSignal handle:handlerBlock do:[ |
848 | 801 |
^ applicationClass perform:aSelector with:arg1 with:arg2 |
802 |
]. |
|
803 |
] |
|
586 | 804 |
]. |
848 | 805 |
^ aBlock value |
970
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
806 |
|
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
807 |
"Modified: / 18.6.1998 / 21:40:13 / cg" |
586 | 808 |
! ! |
809 |
||
422 | 810 |
!WindowBuilder methodsFor:'spec creation aspect fetch'! |
100 | 811 |
|
374 | 812 |
actionFor:aKey |
450 | 813 |
"return an action for aKey. This is invoked during window building |
814 |
(by the builder) to ask for an ActionButtons actionBlock. |
|
815 |
Here, first the local bindings are searched, then the application and |
|
816 |
finally the applications class is asked for a corresponding action. |
|
817 |
The returned object is typically a block." |
|
818 |
||
434 | 819 |
|b| |
820 |
||
821 |
bindings notNil ifTrue:[ |
|
822 |
b := bindings at:aKey ifAbsent:nil. |
|
823 |
b notNil ifTrue:[^ b]. |
|
824 |
]. |
|
825 |
||
848 | 826 |
^ self safelyPerform:#actionFor: |
827 |
with:aKey |
|
828 |
ifNone:[ self aspectNotFound:aKey error:'no action for:'. [] ] |
|
374 | 829 |
! |
830 |
||
716 | 831 |
actionFor:aKey withValue:aValue |
832 |
"return an action for aKey/value combonation. |
|
833 |
This is invoked during window building |
|
834 |
(by the builder) to ask for an ActionButtons actionBlock if that button |
|
835 |
specified an action with an argument value. |
|
836 |
Here, first the local bindings are searched, then the application and |
|
837 |
finally the applications class is asked for a corresponding action. |
|
838 |
The returned object is typically a block." |
|
839 |
||
840 |
|b| |
|
841 |
||
842 |
bindings notNil ifTrue:[ |
|
843 |
b := bindings at:aKey ifAbsent:nil. |
|
1198
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
844 |
b notNil ifTrue:[ |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
845 |
(b isBlock and:[b numArgs == 1]) ifTrue:[ |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
846 |
^ [:arg | b value:arg] |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
847 |
]. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
848 |
^ b |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
849 |
]. |
716 | 850 |
]. |
851 |
||
848 | 852 |
^ self safelyPerform:#actionFor:withValue: |
853 |
with:aKey |
|
854 |
with:aValue |
|
855 |
ifNone:[ self aspectNotFound:aKey error:'no action for:'. [:dummy |] ] |
|
716 | 856 |
! |
857 |
||
374 | 858 |
aspectFor:aKey |
450 | 859 |
"return a model for aKey. This is invoked during window building |
860 |
(by the builder) to ask for an Editfields, a Toggles etc. model. |
|
861 |
Here, first the local bindings are searched, then the application and |
|
862 |
finally the applications class is asked for a corresponding action. |
|
863 |
The returned object is typically a valueHolder." |
|
864 |
||
434 | 865 |
|b| |
866 |
||
867 |
bindings notNil ifTrue:[ |
|
868 |
b := bindings at:aKey ifAbsent:nil. |
|
869 |
b notNil ifTrue:[^ b]. |
|
870 |
]. |
|
871 |
||
848 | 872 |
^ self safelyPerform:#aspectFor: |
873 |
with:aKey |
|
874 |
ifNone:[ self aspectAt:aKey ] |
|
374 | 875 |
! |
876 |
||
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
877 |
aspectFor:aKey ifAbsent:exceptionBlock |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
878 |
"return a model for aKey. This is invoked during window building |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
879 |
(by the builder) to ask for an Editfields, a Toggles etc. model. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
880 |
Here, first the local bindings are searched, then the application and |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
881 |
finally the applications class is asked for a corresponding action. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
882 |
The returned object is typically a valueHolder." |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
883 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
884 |
|b| |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
885 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
886 |
bindings notNil ifTrue:[ |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
887 |
b := bindings at:aKey ifAbsent:nil. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
888 |
b notNil ifTrue:[^ b]. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
889 |
]. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
890 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
891 |
^ self safelyPerform:#aspectFor: |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
892 |
with:aKey |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
893 |
ifNone:[self aspectAt:aKey ifAbsent:exceptionBlock] |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
894 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
895 |
"Created: / 4.8.1998 / 19:36:39 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
896 |
! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
897 |
|
423 | 898 |
componentFor:aKey |
450 | 899 |
"return a component for aKey. This is invoked during window building |
900 |
(by the builder) to ask for an ArbitraryComponents view. |
|
901 |
Here, first the local bindings are searched, then the application and |
|
902 |
finally the applications class is asked for a corresponding action. |
|
903 |
The returned object is typically a view." |
|
904 |
||
848 | 905 |
^ self safelyPerform:#componentFor: |
906 |
with:aKey |
|
907 |
ifNone:[ self aspectAt:aKey ] |
|
423 | 908 |
! |
909 |
||
422 | 910 |
labelFor:aKey |
450 | 911 |
"return a label for aKey. This is invoked during window building |
912 |
(by the builder) to ask for a ???'s label. |
|
913 |
Here, first the local bindings are searched, then the application and |
|
914 |
finally the applications class is asked for a corresponding action. |
|
915 |
The returned object is typically a string." |
|
916 |
||
848 | 917 |
^ self safelyPerform:#labelFor: |
918 |
with:aKey |
|
919 |
ifNone:[ self aspectAt:aKey ] |
|
422 | 920 |
! |
921 |
||
922 |
listFor:aKey |
|
450 | 923 |
"return a list for aKey. This is invoked during window building |
924 |
(by the builder) to ask for a ???'s label. |
|
925 |
Here, first the local bindings are searched, then the application and |
|
926 |
finally the applications class is asked for a corresponding action. |
|
927 |
The returned object is typically a list." |
|
928 |
||
848 | 929 |
^ self safelyPerform:#listFor: |
930 |
with:aKey |
|
931 |
ifNone:[ self aspectAt:aKey ] |
|
932 |
! |
|
933 |
||
934 |
menuFor:aKey |
|
935 |
"Find a binding for the menu named aKey, either in the bindings |
|
936 |
or from the source" |
|
937 |
||
938 |
|menu| |
|
939 |
||
961 | 940 |
aKey isNil ifTrue:[^ nil]. |
941 |
||
848 | 942 |
(menu := self bindingAt:aKey) notNil ifTrue:[ |
943 |
^ menu |
|
944 |
]. |
|
945 |
||
946 |
menu := self safelyPerform:#menuFor: with:aKey ifNone:[ |
|
947 |
self safelyPerform:aKey ifNone:[ |
|
948 |
self aspectNotFound:aKey error:'no menu for:'. |
|
949 |
nil |
|
950 |
] |
|
951 |
]. |
|
952 |
||
862 | 953 |
menu isBlock ifFalse:[ |
954 |
((menu := menu value) notNil and:[application notNil]) ifTrue:[ |
|
955 |
menu isArray ifTrue:[ |
|
956 |
menu := Menu new fromLiteralArrayEncoding:menu. |
|
1533
b6b2f8ab4e4a
findGuiResources... now sets the receiver, if not yet set
Claus Gittinger <cg@exept.de>
parents:
1520
diff
changeset
|
957 |
"/ menu receiver:application. -- now done in findGuiResources ... |
924
4680e2fe4728
must care for resource-label translation of a menu
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
958 |
]. |
4680e2fe4728
must care for resource-label translation of a menu
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
959 |
menu findGuiResourcesIn:application |
450 | 960 |
] |
422 | 961 |
]. |
848 | 962 |
^ menu |
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
963 |
|
961 | 964 |
"Modified: / 18.6.1998 / 16:30:31 / cg" |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
965 |
! |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
966 |
|
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
967 |
specificationFor:aKey |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
968 |
"return a specification for aKey. This is invoked during window building |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
969 |
(by the builder) to ask for the interfaceSpec for a subCanvas or subSpecification. |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
970 |
Here, first the local bindings are searched, then the application and |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
971 |
finally the applications class is asked for a corresponding interfaceSPec. |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
972 |
The returned object is typically an interfaceSpec array." |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
973 |
|
848 | 974 |
^ self safelyPerform:#specificationFor: |
975 |
with:aKey |
|
976 |
ifNone:[ self aspectFor:aKey ] |
|
422 | 977 |
! ! |
978 |
||
979 |
!WindowBuilder methodsFor:'spec creation callbacks'! |
|
980 |
||
735 | 981 |
createdComponent:aView forSpec:spec named:name |
982 |
"callback from the UISpec after a view has been |
|
983 |
created for a spec. |
|
984 |
If it has a name, add it to the namedComponents dictionary; |
|
985 |
if I have a creationHook (application callBack), evaluate it." |
|
986 |
||
1222 | 987 |
|nameKey| |
988 |
||
735 | 989 |
name notNil ifTrue:[ |
990 |
"/ self componentAt:name put:aView. |
|
991 |
namedComponents isNil ifTrue:[ |
|
992 |
namedComponents := IdentityDictionary new. |
|
993 |
]. |
|
1222 | 994 |
nameKey := name asSymbol. |
995 |
"/ debugging ... |
|
1225 | 996 |
"/ (namedComponents includesKey:nameKey) ifTrue:[ |
997 |
"/ Transcript showCR:'WARNING multiple UI-build of: ',nameKey |
|
998 |
"/ ]. |
|
1222 | 999 |
namedComponents at:nameKey put:aView |
735 | 1000 |
]. |
410 | 1001 |
componentCreationHook notNil ifTrue:[ |
1002 |
componentCreationHook value:aView value:spec value:self |
|
1003 |
] |
|
100 | 1004 |
|
735 | 1005 |
"Modified: / 5.9.1995 / 21:42:54 / claus" |
1006 |
"Created: / 31.10.1997 / 18:47:01 / cg" |
|
1007 |
"Modified: / 31.10.1997 / 18:51:22 / cg" |
|
100 | 1008 |
! ! |
1009 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1010 |
!WindowBuilder methodsFor:'startup'! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1011 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1012 |
closeRequest |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1013 |
window destroy |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1014 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1015 |
"Modified: 17.1.1997 / 19:30:32 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1016 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1017 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1018 |
open |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1019 |
"open my topView, as previously created" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1020 |
|
477 | 1021 |
|type| |
1022 |
||
1023 |
application isNil ifTrue:[ |
|
1024 |
type := #normal |
|
1025 |
] ifFalse:[ |
|
1026 |
type := application defaultWindowType |
|
1027 |
]. |
|
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1028 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1029 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1030 |
withExtent:nil |
477 | 1031 |
andType:type |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1032 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1033 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1034 |
|
428 | 1035 |
openAt:aPoint |
1036 |
"open my topView at some location" |
|
1037 |
||
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1038 |
^ self |
467 | 1039 |
openAt:aPoint |
1040 |
withExtent:nil |
|
428 | 1041 |
andType:(application defaultWindowType) |
1042 |
||
1043 |
"Created: 14.2.1997 / 20:21:57 / cg" |
|
467 | 1044 |
"Modified: 28.2.1997 / 22:50:29 / cg" |
428 | 1045 |
! |
1046 |
||
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1047 |
openDialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1048 |
"open my topView, as previously created as a modal view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1049 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1050 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1051 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1052 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1053 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1054 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1055 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1056 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1057 |
openDialogAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1058 |
"open my topView, as previously created as a modal view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1059 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1060 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1061 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1062 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1063 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1064 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1065 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1066 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1067 |
"Created: 14.2.1997 / 20:24:19 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1068 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1069 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1070 |
openDialogAt:aPoint withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1071 |
"open my topView, as previously created as a modal view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1072 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1073 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1074 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1075 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1076 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1077 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1078 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1079 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1080 |
"Created: 14.2.1997 / 20:24:19 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1081 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1082 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1083 |
openDialogWithExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1084 |
"open my topView, as previously created as a modal view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1085 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1086 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1087 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1088 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1089 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1090 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1091 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1092 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1093 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1094 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1095 |
openModal |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1096 |
"open my topView as a modal dialog, as previously created, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1097 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1098 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1099 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1100 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1101 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1102 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1103 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1104 |
"Modified: 3.3.1997 / 19:43:57 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1105 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1106 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1107 |
openPopUpAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1108 |
"open my topView, as previously created as a popUp view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1109 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1110 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1111 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1112 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1113 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1114 |
andType:#popUp |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1115 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1116 |
"Modified: 17.1.1997 / 19:59:29 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1117 |
"Created: 14.2.1997 / 20:24:38 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1118 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1119 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1120 |
openPopUpIn:aRectangle |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1121 |
"open my topView, as previously created as a popUp view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1122 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1123 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1124 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1125 |
openAt:aRectangle origin |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1126 |
withExtent:aRectangle extent |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1127 |
andType:#popUp |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1128 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1129 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1130 |
openWindow |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1131 |
"open my topView" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1132 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1133 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1134 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1135 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1136 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1137 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1138 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1139 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1140 |
openWindowAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1141 |
"open my topView at some location" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1142 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1143 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1144 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1145 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1146 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1147 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1148 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1149 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1150 |
openWindowAt:origin withExtent:ext andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1151 |
"open my window, as previously created, optionally defining the |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1152 |
windows origin and/or extent. |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1153 |
The type argument may be #dialog or #normal, and specifies if the view |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1154 |
should be opened as a modal view, blocking interaction to the currently |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1155 |
active view, or as a normal view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1156 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1157 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1158 |
openAt:origin |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1159 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1160 |
andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1161 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1162 |
|
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1163 |
openWindowCenter |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1164 |
"open my topView centered on the screen (dialog & normal only)" |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1165 |
|
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1166 |
^ self |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1167 |
openAt:#center |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1168 |
withExtent:nil |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1169 |
andType:(application defaultWindowType) |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1170 |
|
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1171 |
! |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1172 |
|
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1173 |
openWithExtent:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1174 |
"open my topView, as previously created, but override |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1175 |
the extent." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1176 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1177 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1178 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1179 |
withExtent:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1180 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1181 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1182 |
"Modified: 17.1.1997 / 19:58:48 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1183 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1184 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1185 |
openWithExtent:ext andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1186 |
"open my window, as previously created. The type argument |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1187 |
may be #dialog or #normal, and specifies if the view should |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1188 |
be opened as a modal view, blocking interaction to the currently |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1189 |
active view, or as a normal view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1190 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1191 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1192 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1193 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1194 |
andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1195 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1196 |
"Modified: 14.2.1997 / 20:22:47 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1197 |
! ! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1198 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1199 |
!WindowBuilder methodsFor:'startup - basic'! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1200 |
|
436 | 1201 |
openAt:origin withExtent:ext andType:type |
428 | 1202 |
"open my window, as previously created, optionally defining the |
1203 |
windows origin and/or extent. |
|
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1204 |
The type argument may be #dialog, #popup or #normal, |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1205 |
and specifies if the view should be opened as a |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1206 |
modal view (blocking interaction to the currently active view), |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1207 |
as popUp (also blocking) |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1208 |
or as a normal view." |
428 | 1209 |
|
1359
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1210 |
|appWinClass| |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1211 |
|
428 | 1212 |
origin notNil ifTrue:[ |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1213 |
"/ kludge |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1214 |
origin ~~ #center ifTrue:[ |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1215 |
window origin:origin |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1216 |
] |
428 | 1217 |
]. |
1218 |
ext notNil ifTrue:[ |
|
480 | 1219 |
window extent:ext. |
1220 |
] ifFalse:[ |
|
1221 |
type == #dialog ifTrue:[ |
|
1222 |
window fixSize |
|
1223 |
] |
|
1224 |
]. |
|
1225 |
||
428 | 1226 |
type == #dialog ifTrue:[ |
1520 | 1227 |
((origin isNil and:[window class forceModalBoxesToOpenAtCenter]) |
1228 |
or:[origin == #center]) ifTrue:[ |
|
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1229 |
window origin:(window device center - (window extent // 2)) |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1230 |
] ifFalse:[ |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1231 |
window fixPosition:(window device pointerPosition - window positionOffset). |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1232 |
]. |
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1233 |
^ window openModal. |
428 | 1234 |
]. |
1235 |
||
1236 |
type == #normal ifTrue:[ |
|
480 | 1237 |
window isNil ifTrue:[ |
1359
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1238 |
application notNil ifTrue:[ |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1239 |
appWinClass := application applicationWindowClass |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1240 |
] ifFalse:[ |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1241 |
appWinClass := ApplicationWindow |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1242 |
]. |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1243 |
self setupWindowFor:(appWinClass new). |
480 | 1244 |
]. |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1245 |
origin == #center ifTrue:[ |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1246 |
window origin:(window device center - window extent // 2) |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1247 |
]. |
480 | 1248 |
|
428 | 1249 |
window open. |
1250 |
^ self |
|
1251 |
]. |
|
1252 |
||
1253 |
type == #popUp ifTrue:[ |
|
467 | 1254 |
window fixPosition:(window device pointerPosition). |
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1255 |
^ window openAsPopUp. |
428 | 1256 |
]. |
1257 |
||
1258 |
" |
|
1259 |
if ST-80 supports more types - these may be added later |
|
1260 |
" |
|
1261 |
self halt:'unimplemented' |
|
1262 |
||
735 | 1263 |
"Created: / 14.2.1997 / 20:22:24 / cg" |
965
04cadbd21aac
use new ApplicationWindow (instead of StandardSystemView)
Claus Gittinger <cg@exept.de>
parents:
961
diff
changeset
|
1264 |
"Modified: / 18.6.1998 / 19:10:07 / cg" |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1265 |
! ! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1266 |
|
132 | 1267 |
!WindowBuilder class methodsFor:'documentation'! |
1268 |
||
1269 |
version |
|
1533
b6b2f8ab4e4a
findGuiResources... now sets the receiver, if not yet set
Claus Gittinger <cg@exept.de>
parents:
1520
diff
changeset
|
1270 |
^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.95 2001-11-19 15:29:07 cg Exp $' |
132 | 1271 |
! ! |