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