author | Claus Gittinger <cg@exept.de> |
Sat, 12 Jul 2008 17:23:41 +0200 | |
changeset 2520 | b4cb0d37c0d4 |
parent 2499 | 8b652f5e5757 |
child 2529 | c22b95752b7b |
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 |
|
2460 | 17 |
subCanvasSpecs componentToSpecMapping' |
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 |
2499 | 266 |
"store an aspect identified by its symbol and its value. |
267 |
Returns the stored aspect !!" |
|
2005 | 268 |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
269 |
bindings isNil ifTrue:[ |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
270 |
bindings := IdentityDictionary new |
125 | 271 |
]. |
2499 | 272 |
bindings at:aSymbol put:aModel. |
273 |
^ aModel |
|
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 |
|
2460 | 350 |
componentToSpecMappingAt:aView |
351 |
componentToSpecMapping isNil ifTrue:[^ nil]. |
|
352 |
^ componentToSpecMapping at:aView ifAbsent:nil |
|
353 |
! |
|
354 |
||
355 |
componentToSpecMappingAt:aView put:aSpec |
|
2462 | 356 |
|
357 |
"/ self assert:(aSpec isKindOf:UISpecification). |
|
358 |
||
2460 | 359 |
componentToSpecMapping isNil ifTrue:[ |
360 |
componentToSpecMapping := IdentityDictionary new. |
|
361 |
]. |
|
362 |
componentToSpecMapping at:aView put:aSpec |
|
363 |
! |
|
364 |
||
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
365 |
findComponentAt:name |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
366 |
"recursively search for a component identified by its name in myself |
2005 | 367 |
and all of my subApplications." |
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
368 |
|
1992 | 369 |
^ self |
370 |
findComponentAt:name |
|
371 |
forWhichViewConformsTo:[:v | true] |
|
372 |
ignoringViews:(IdentitySet new). |
|
1563
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
373 |
! |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
374 |
|
1992 | 375 |
findComponentAt:name forWhichViewConformsTo:viewCheck ignoringViews:triedViews |
376 |
"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
|
377 |
and all of my subApplications. |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
378 |
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
|
379 |
we must be careful to avoid endless recursion if a subview refers to the topviews builder, |
2005 | 380 |
(sigh)" |
1563
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
381 |
|
1992 | 382 |
|comp "window" app b| |
383 |
||
384 |
(comp := self componentAt:name) notNil ifTrue:[ |
|
385 |
^ comp |
|
386 |
]. |
|
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
387 |
|
1992 | 388 |
window isNil ifTrue:[ |
389 |
^ self |
|
390 |
]. |
|
391 |
"/ window := self application window. |
|
1563
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
392 |
|
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
393 |
(triedViews includes:window) ifTrue:[^ nil]. |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
394 |
triedViews add:window. |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
395 |
|
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
396 |
window allSubViewsDo:[:v | |
1992 | 397 |
(triedViews includes:v) ifFalse:[ |
398 |
triedViews add:v. |
|
399 |
(viewCheck value:v) ifTrue:[ |
|
400 |
((app := v application) notNil |
|
401 |
and:[(b := app builder) notNil |
|
402 |
and:[b ~~ self]]) |
|
403 |
ifTrue:[ |
|
404 |
comp := b findComponentAt:name forWhichViewConformsTo:viewCheck ignoringViews:triedViews. |
|
405 |
comp notNil ifTrue:[ |
|
406 |
^ comp |
|
407 |
] |
|
408 |
] |
|
1563
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
409 |
] |
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
410 |
] |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
411 |
]. |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
412 |
^ nil |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
413 |
! |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
414 |
|
1992 | 415 |
findVisibleComponentAt:name |
416 |
"recursively search for a visible component identified by its name in myself |
|
417 |
and all of my subApplications. |
|
2005 | 418 |
Be careful: this also searches for components in unmapped canvases." |
1992 | 419 |
|
420 |
^ self |
|
421 |
findComponentAt:name |
|
422 |
forWhichViewConformsTo:[:v | v shown] |
|
423 |
ignoringViews:(IdentitySet new). |
|
424 |
! |
|
425 |
||
600 | 426 |
helpKeyFor:aComponent |
2005 | 427 |
"return the helpkey for a component or nil" |
428 |
||
600 | 429 |
|v key| |
430 |
||
431 |
v := aComponent. |
|
432 |
[v notNil] whileTrue:[ |
|
2077 | 433 |
(key := v helpKey) notNil ifTrue:[ |
600 | 434 |
^ key |
435 |
]. |
|
2077 | 436 |
"/ helpKeys notNil ifTrue:[ |
437 |
"/ (key := helpKeys at:v ifAbsent:nil) notNil ifTrue:[ |
|
438 |
"/ ^ key |
|
439 |
"/ ]. |
|
440 |
"/ ]. |
|
600 | 441 |
v := v superView |
442 |
]. |
|
595 | 443 |
^ nil |
600 | 444 |
! |
595 | 445 |
|
600 | 446 |
helpKeyFor:aComponent put:aKey |
848 | 447 |
"assign a key for a component which is used to access the help text |
2005 | 448 |
from the application." |
449 |
||
2077 | 450 |
aComponent helpKey:aKey. |
451 |
||
452 |
"/ aKey isNil ifTrue:[ |
|
453 |
"/ helpKeys isNil ifFalse:[ |
|
454 |
"/ helpKeys removeKey:aComponent ifAbsent:nil |
|
455 |
"/ ] |
|
456 |
"/ ] ifFalse:[ |
|
457 |
"/ helpKeys isNil ifTrue:[ |
|
458 |
"/ helpKeys := IdentityDictionary new |
|
459 |
"/ ]. |
|
460 |
"/ helpKeys at:aComponent put:aKey |
|
461 |
"/ ] |
|
595 | 462 |
! |
463 |
||
477 | 464 |
keyboardProcessor |
2005 | 465 |
"return my keyboard processor" |
466 |
||
477 | 467 |
keyboardProcessor isNil ifTrue:[ |
468 |
keyboardProcessor := KeyboardProcessor new |
|
469 |
]. |
|
470 |
^ keyboardProcessor |
|
471 |
||
472 |
"Created: 3.3.1997 / 18:31:37 / cg" |
|
473 |
"Modified: 3.3.1997 / 18:32:27 / cg" |
|
474 |
! |
|
475 |
||
970
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
476 |
keyboardProcessor:aKeyboardProcessor |
2005 | 477 |
"set my keyboard processor" |
478 |
||
970
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
479 |
keyboardProcessor := aKeyboardProcessor |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
480 |
|
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
481 |
"Created: / 18.6.1998 / 19:59:38 / cg" |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
482 |
! |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
483 |
|
855
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
484 |
labelAt:name |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
485 |
labels isNil ifTrue:[^ nil]. |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
486 |
^ labels at:name asSymbol ifAbsent:nil |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
487 |
|
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
488 |
"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
|
489 |
! |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
490 |
|
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
491 |
labelAt:name put:aLabelString |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
492 |
labels isNil ifTrue:[ |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
493 |
labels := IdentityDictionary new. |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
494 |
]. |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
495 |
labels at:name asSymbol put:aLabelString |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
496 |
|
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
497 |
"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
|
498 |
! |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
499 |
|
848 | 500 |
menuAt:aKey |
501 |
"Find a binding for the menu named aKey, either in the bindings |
|
502 |
or from the source" |
|
503 |
||
504 |
^ self menuFor:aKey |
|
505 |
||
506 |
||
507 |
! |
|
508 |
||
509 |
menuAt:aSymbol put:someMenuOrHolder |
|
510 |
"add someMenuOrHolder as the binding for the menu named aSymbol to the bindings" |
|
511 |
||
512 |
^ self aspectAt:aSymbol put:someMenuOrHolder |
|
513 |
||
514 |
! |
|
515 |
||
86 | 516 |
namedComponents |
2005 | 517 |
"return a list of named components" |
518 |
||
450 | 519 |
^ namedComponents |
86 | 520 |
! |
521 |
||
1971 | 522 |
namedComponentsDo: aBlock |
523 |
namedComponents notNil ifTrue:[ |
|
524 |
namedComponents do:[:aView| |
|
525 |
aBlock value: aView |
|
526 |
] |
|
527 |
] |
|
528 |
! |
|
529 |
||
1585 | 530 |
resources |
531 |
application notNil ifTrue:[ |
|
532 |
^ application resources |
|
533 |
]. |
|
534 |
^ Dialog classResources. |
|
535 |
! |
|
536 |
||
502 | 537 |
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
|
538 |
"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
|
539 |
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
|
540 |
which can be filled via #specificationAt:at:put: messages. |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
541 |
If not present, or none is found there, we bounce back trying |
824 | 542 |
#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
|
543 |
message to the class named as majorKey. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
544 |
Notice, that the class named majorKey is first searched in the |
2005 | 545 |
application classes namespace - allowing private classes as majorKey." |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
546 |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
547 |
|spec cls dict dkey| |
502 | 548 |
|
1351
42d9de8818bf
care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
549 |
minorKey isNil ifTrue:[^ nil]. |
42d9de8818bf
care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
550 |
|
502 | 551 |
subCanvasSpecs notNil ifTrue:[ |
586 | 552 |
dkey := majorKey ? #NoMajorKey. |
553 |
dict := subCanvasSpecs at:dkey ifAbsent:nil. |
|
554 |
||
555 |
dict notNil ifTrue:[ |
|
556 |
spec := dict at:minorKey ifAbsent:nil. |
|
502 | 557 |
spec notNil ifTrue:[^ spec]. |
558 |
]. |
|
559 |
]. |
|
586 | 560 |
|
502 | 561 |
majorKey isNil ifTrue:[ |
2389
31f716526f31
Fix fetching of subCanvasSpec from UIPainter if there is no major key
Stefan Vogel <sv@exept.de>
parents:
2369
diff
changeset
|
562 |
spec := self specificationFor:minorKey. |
31f716526f31
Fix fetching of subCanvasSpec from UIPainter if there is no major key
Stefan Vogel <sv@exept.de>
parents:
2369
diff
changeset
|
563 |
spec isNil ifTrue:[ |
31f716526f31
Fix fetching of subCanvasSpec from UIPainter if there is no major key
Stefan Vogel <sv@exept.de>
parents:
2369
diff
changeset
|
564 |
"fallback for UIPainter" |
31f716526f31
Fix fetching of subCanvasSpec from UIPainter if there is no major key
Stefan Vogel <sv@exept.de>
parents:
2369
diff
changeset
|
565 |
MessageNotUnderstood catch:[ |
31f716526f31
Fix fetching of subCanvasSpec from UIPainter if there is no major key
Stefan Vogel <sv@exept.de>
parents:
2369
diff
changeset
|
566 |
spec := applicationClass perform:minorKey. |
31f716526f31
Fix fetching of subCanvasSpec from UIPainter if there is no major key
Stefan Vogel <sv@exept.de>
parents:
2369
diff
changeset
|
567 |
]. |
31f716526f31
Fix fetching of subCanvasSpec from UIPainter if there is no major key
Stefan Vogel <sv@exept.de>
parents:
2369
diff
changeset
|
568 |
]. |
31f716526f31
Fix fetching of subCanvasSpec from UIPainter if there is no major key
Stefan Vogel <sv@exept.de>
parents:
2369
diff
changeset
|
569 |
^ spec |
848 | 570 |
]. |
571 |
||
572 |
application notNil ifTrue:[ |
|
573 |
"/ look for class in applications namespace ... |
|
574 |
cls := application resolveName:majorKey. |
|
502 | 575 |
] ifFalse:[ |
848 | 576 |
"/ fallBack - use that global, if it exists |
577 |
cls := Smalltalk at:majorKey. |
|
578 |
cls isNil ifTrue:[ |
|
579 |
Transcript showCR:('WindowBuilder[warning]: missing application when fetching majorKey:' , majorKey). |
|
735 | 580 |
]. |
502 | 581 |
]. |
586 | 582 |
|
848 | 583 |
cls notNil ifTrue:[ |
1585 | 584 |
MessageNotUnderstood catch:[ |
848 | 585 |
^ cls specificationFor:minorKey |
586 |
]. |
|
1586 | 587 |
MessageNotUnderstood catch:[ |
588 |
^ cls perform:minorKey. |
|
589 |
] |
|
848 | 590 |
]. |
591 |
^ nil |
|
502 | 592 |
! |
593 |
||
594 |
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
|
595 |
"deposit an interfaceSpecification for major and minor key |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
596 |
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
|
597 |
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
|
598 |
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
|
599 |
(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
|
600 |
See #subCanvasAt:at:." |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
601 |
|
502 | 602 |
|dict key| |
603 |
||
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
604 |
subCanvasSpecs isNil ifTrue:[ |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
605 |
"/ lazyly initialize |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
606 |
subCanvasSpecs := IdentityDictionary new |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
607 |
]. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
608 |
|
502 | 609 |
key := majorKey ? #NoMajorKey. |
610 |
dict := subCanvasSpecs at:key ifAbsent:nil. |
|
611 |
dict isNil ifTrue:[ |
|
612 |
dict := IdentityDictionary new. |
|
613 |
subCanvasSpecs at:key put:dict |
|
614 |
]. |
|
615 |
dict at:minorKey put:aSpec |
|
616 |
||
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
617 |
"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
|
618 |
"Modified: / 5.2.1998 / 12:05:32 / stefan" |
502 | 619 |
! |
620 |
||
475
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
621 |
visualAt:name |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
622 |
visuals isNil ifTrue:[^ nil]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
623 |
^ visuals at:name asSymbol ifAbsent:nil |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
624 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
625 |
"Created: 3.3.1997 / 16:24:17 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
626 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
627 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
628 |
visualAt:name put:aVisual |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
629 |
visuals isNil ifTrue:[ |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
630 |
visuals := IdentityDictionary new. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
631 |
]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
632 |
visuals at:name asSymbol put:aVisual |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
633 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
634 |
"Created: 3.3.1997 / 16:24:41 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
635 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
636 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
637 |
visuals |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
638 |
^ visuals |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
639 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
640 |
"Created: 3.3.1997 / 16:24:00 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
641 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
642 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
643 |
visuals:aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
644 |
visuals := aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
645 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
646 |
"Created: 3.3.1997 / 16:24:06 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
647 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
648 |
|
125 | 649 |
window |
1995 | 650 |
"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
|
651 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
652 |
^ window |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
653 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
654 |
"Modified: 17.1.1997 / 19:30:00 / cg" |
125 | 655 |
! |
656 |
||
657 |
window:aView |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
658 |
"set the top window (view), for which an interface |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
659 |
is (being) built" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
660 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
661 |
window := aView |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
662 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
663 |
"Modified: 17.1.1997 / 19:30:22 / cg" |
66 | 664 |
! |
665 |
||
666 |
windowGroup |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
667 |
^ window windowGroup |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
668 |
|
608 | 669 |
"Modified: 17.6.1997 / 18:04:01 / cg" |
66 | 670 |
! ! |
671 |
||
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
672 |
!WindowBuilder methodsFor:'aspect access support'! |
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
673 |
|
675 | 674 |
booleanValueAspectFor:aKey |
674 | 675 |
"helper (common code) to generate a boolean aspect if required. |
676 |
If no binding exists for aKey, a valueHolder holding false is |
|
677 |
created and added to the bindings. |
|
678 |
Otherwise, the existing binding is returned." |
|
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
679 |
|
676 | 680 |
^ self valueAspectFor:aKey initialValue:false |
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
681 |
|
676 | 682 |
"Modified: 28.7.1997 / 12:53:57 / cg" |
675 | 683 |
! |
684 |
||
1198
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
685 |
listAspectFor:aKey |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
686 |
"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
|
687 |
If no binding exists for aKey, a new List is |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
688 |
created and added to the bindings. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
689 |
Otherwise, the existing binding is returned." |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
690 |
|
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
691 |
|list| |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
692 |
|
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
693 |
(list := self bindingAt:aKey) isNil ifTrue:[ |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
694 |
self aspectAt:aKey put:(list := List new). |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
695 |
]. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
696 |
^ list |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
697 |
|
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
698 |
"Created: 28.7.1997 / 12:53:45 / cg" |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
699 |
"Modified: 28.7.1997 / 12:54:13 / cg" |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
700 |
! |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
701 |
|
675 | 702 |
nilValueAspectFor:aKey |
703 |
"helper (common code) to generate a valueHolder aspect if required. |
|
704 |
If no binding exists for aKey, a valueHolder holding nil is |
|
705 |
created and added to the bindings. |
|
706 |
Otherwise, the existing binding is returned." |
|
707 |
||
676 | 708 |
^ self valueAspectFor:aKey initialValue:nil |
709 |
||
710 |
"Modified: 28.7.1997 / 12:54:06 / cg" |
|
711 |
! |
|
712 |
||
2403
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
713 |
valueAspectFor:aKey computeInitialValueWith:initialValueBlock |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
714 |
"helper (common code) to generate a valueHolder aspect if required. |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
715 |
If no binding exists for aKey, a valueHolder holding initialValue is |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
716 |
created and added to the bindings. |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
717 |
Otherwise, the existing binding is returned. |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
718 |
The initial value is computed by evaluating initialValueBlock" |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
719 |
|
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
720 |
|holder| |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
721 |
|
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
722 |
(holder := self bindingAt:aKey) isNil ifTrue:[ |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
723 |
self aspectAt:aKey put:(holder := initialValueBlock value asValue). |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
724 |
]. |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
725 |
^ holder |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
726 |
! |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
727 |
|
676 | 728 |
valueAspectFor:aKey initialValue:initialValue |
729 |
"helper (common code) to generate a valueHolder aspect if required. |
|
730 |
If no binding exists for aKey, a valueHolder holding initialValue is |
|
731 |
created and added to the bindings. |
|
732 |
Otherwise, the existing binding is returned." |
|
733 |
||
675 | 734 |
|holder| |
735 |
||
736 |
(holder := self bindingAt:aKey) isNil ifTrue:[ |
|
2109 | 737 |
self aspectAt:aKey put:(holder := initialValue asValue). |
675 | 738 |
]. |
739 |
^ holder |
|
740 |
||
676 | 741 |
"Created: 28.7.1997 / 12:53:45 / cg" |
742 |
"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
|
743 |
! ! |
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
744 |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
745 |
!WindowBuilder methodsFor:'building'! |
66 | 746 |
|
125 | 747 |
buildFromSpec:aSpec |
176 | 748 |
^ self subclassResponsibility |
408 | 749 |
! |
750 |
||
751 |
makeTabable:aComponent |
|
735 | 752 |
"add a component to the list of tabable components" |
753 |
||
1315 | 754 |
aComponent canTab:true |
735 | 755 |
|
1123 | 756 |
! |
757 |
||
758 |
setupWindowFor:aWindow |
|
759 |
self subclassResponsibility |
|
66 | 760 |
! ! |
100 | 761 |
|
848 | 762 |
!WindowBuilder methodsFor:'error handling'! |
763 |
||
764 |
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
|
765 |
"show error message on transcript (if Verbose is true) |
1825 | 766 |
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
|
767 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
768 |
Verbose == true ifTrue:[ |
1395 | 769 |
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
|
770 |
application notNil ifTrue:[ |
1395 | 771 |
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
|
772 |
]. |
1028
4f3401b606bd
better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
773 |
]. |
848 | 774 |
|
775 |
StopOnError == true ifTrue:[ |
|
1825 | 776 |
self halt:'aspect not found' "/ set StopOnError to true to debug end-user apps |
848 | 777 |
]. |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
778 |
^ nil |
1028
4f3401b606bd
better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
779 |
|
1395 | 780 |
"Modified: / 18.8.2000 / 14:10:59 / cg" |
848 | 781 |
! ! |
782 |
||
586 | 783 |
!WindowBuilder methodsFor:'message sending'! |
784 |
||
848 | 785 |
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
|
786 |
"send the message aSelector to the application; |
586 | 787 |
the result returned from the send or nil is returned |
788 |
" |
|
2363 | 789 |
|handlerBlock| |
586 | 790 |
|
848 | 791 |
aSelector notNil ifTrue:[ |
2363 | 792 |
handlerBlock := [:ex| |badSel| |
793 |
badSel := ex selector. |
|
794 |
(badSel ~~ aSelector) ifTrue:[ |
|
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
795 |
ex reject |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
796 |
] |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
797 |
]. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
798 |
|
595 | 799 |
application notNil ifTrue:[ |
1585 | 800 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 801 |
^ application perform:aSelector |
802 |
]. |
|
1585 | 803 |
MessageNotUnderstood handle:handlerBlock do:[ |
2363 | 804 |
^ application class perform:aSelector |
595 | 805 |
] |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
806 |
]. |
1585 | 807 |
" |
808 |
WARNING: |
|
809 |
This is a private interface for the UIPainter to pass down the app-class |
|
810 |
" |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
811 |
applicationClass notNil ifTrue:[ |
1585 | 812 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 813 |
^ 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
|
814 |
] |
586 | 815 |
] |
816 |
]. |
|
2363 | 817 |
^ aBlock value |
981
6a9c975543ad
also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents:
974
diff
changeset
|
818 |
|
6a9c975543ad
also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents:
974
diff
changeset
|
819 |
"Modified: / 20.6.1998 / 11:52:19 / cg" |
586 | 820 |
! |
821 |
||
848 | 822 |
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
|
823 |
"send the one-arg-message aSelector to the application; |
2005 | 824 |
the result returned from the send or nil is returned" |
825 |
||
2363 | 826 |
^ self |
827 |
safelyPerform:aSelector |
|
828 |
withArguments:(Array with:anArgument) |
|
829 |
ifNone:aBlock |
|
830 |
! |
|
831 |
||
832 |
safelyPerform:aSelector with:arg1 with:arg2 ifNone:aBlock |
|
833 |
"send the two-arg-message aSelector to the application; |
|
834 |
the result returned from the send or nil is returned" |
|
835 |
||
836 |
^ self |
|
837 |
safelyPerform:aSelector |
|
838 |
withArguments:(Array with:arg1 with:arg2) |
|
839 |
ifNone:aBlock |
|
840 |
! |
|
841 |
||
842 |
safelyPerform:aSelector with:arg1 with:arg2 with:arg3 ifNone:aBlock |
|
843 |
"send the 3-arg-message aSelector to the application; |
|
844 |
the result returned from the send or nil is returned" |
|
845 |
||
846 |
^ self |
|
847 |
safelyPerform:aSelector |
|
848 |
withArguments:(Array with:arg1 with:arg2 with:arg3) |
|
849 |
ifNone:aBlock |
|
850 |
! |
|
851 |
||
852 |
safelyPerform:aSelector withArguments:arguments ifNone:aBlock |
|
853 |
"send the one-arg-message aSelector to the application; |
|
854 |
the result returned from the send or nil is returned" |
|
855 |
||
1587 | 856 |
|handlerBlock| |
586 | 857 |
|
848 | 858 |
aSelector notNil ifTrue:[ |
1587 | 859 |
handlerBlock := [:ex| |badSel| |
860 |
badSel := ex selector. |
|
2363 | 861 |
(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
|
862 |
ex reject |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
863 |
] |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
864 |
]. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
865 |
|
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
866 |
application notNil ifTrue:[ |
1585 | 867 |
MessageNotUnderstood handle:handlerBlock do:[ |
2363 | 868 |
^ application perform:aSelector withArguments:arguments |
848 | 869 |
]. |
1585 | 870 |
MessageNotUnderstood handle:handlerBlock do:[ |
2363 | 871 |
^ application class perform:aSelector withArguments:arguments |
595 | 872 |
] |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
873 |
]. |
1585 | 874 |
" |
875 |
WARNING: |
|
876 |
This is a private interface for the UIPainter to pass down the app-class |
|
877 |
" |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
878 |
applicationClass notNil ifTrue:[ |
1585 | 879 |
MessageNotUnderstood handle:handlerBlock do:[ |
2363 | 880 |
^ applicationClass perform:aSelector withArguments:arguments |
848 | 881 |
]. |
882 |
] |
|
883 |
]. |
|
1587 | 884 |
^ aBlock value |
961 | 885 |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
886 |
"Modified: / 4.8.1998 / 19:33:52 / cg" |
586 | 887 |
! ! |
888 |
||
2369 | 889 |
!WindowBuilder methodsFor:'queries'! |
890 |
||
891 |
isEditing |
|
892 |
"true if building from a GUI builder resource ( UIPainter, ... ), |
|
893 |
false if building for the real thing. |
|
894 |
If true, no models or actions should be set (no application is running)" |
|
895 |
||
896 |
^ false |
|
897 |
! ! |
|
898 |
||
422 | 899 |
!WindowBuilder methodsFor:'spec creation aspect fetch'! |
100 | 900 |
|
374 | 901 |
actionFor:aKey |
450 | 902 |
"return an action for aKey. This is invoked during window building |
903 |
(by the builder) to ask for an ActionButtons actionBlock. |
|
904 |
Here, first the local bindings are searched, then the application and |
|
905 |
finally the applications class is asked for a corresponding action. |
|
906 |
The returned object is typically a block." |
|
907 |
||
434 | 908 |
|b| |
909 |
||
910 |
bindings notNil ifTrue:[ |
|
911 |
b := bindings at:aKey ifAbsent:nil. |
|
912 |
b notNil ifTrue:[^ b]. |
|
913 |
]. |
|
914 |
||
848 | 915 |
^ self safelyPerform:#actionFor: |
916 |
with:aKey |
|
917 |
ifNone:[ self aspectNotFound:aKey error:'no action for:'. [] ] |
|
374 | 918 |
! |
919 |
||
716 | 920 |
actionFor:aKey withValue:aValue |
921 |
"return an action for aKey/value combonation. |
|
922 |
This is invoked during window building |
|
923 |
(by the builder) to ask for an ActionButtons actionBlock if that button |
|
924 |
specified an action with an argument value. |
|
925 |
Here, first the local bindings are searched, then the application and |
|
926 |
finally the applications class is asked for a corresponding action. |
|
927 |
The returned object is typically a block." |
|
928 |
||
929 |
|b| |
|
930 |
||
931 |
bindings notNil ifTrue:[ |
|
932 |
b := bindings at:aKey ifAbsent:nil. |
|
1198
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
933 |
b notNil ifTrue:[ |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
934 |
(b isBlock and:[b numArgs == 1]) ifTrue:[ |
2363 | 935 |
^ [b value:aValue] |
1198
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
936 |
]. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
937 |
^ b |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
938 |
]. |
716 | 939 |
]. |
940 |
||
2363 | 941 |
^ self |
942 |
safelyPerform:#actionFor:withValue: |
|
943 |
withArguments:(Array with:aKey with:aValue) |
|
944 |
ifNone:[ self aspectNotFound:aKey error:'no action for:'. |
|
945 |
[] |
|
946 |
] |
|
947 |
! |
|
948 |
||
949 |
actionFor:aKey withValue:arg1 withValue:arg2 |
|
950 |
"return an action for aKey/value combination. |
|
951 |
This is invoked during window building |
|
952 |
(by the builder) to ask for an ActionButtons actionBlock if that button |
|
953 |
specified an action with an argument value. |
|
954 |
Here, first the local bindings are searched, then the application and |
|
955 |
finally the applications class is asked for a corresponding action. |
|
956 |
The returned object is typically a block." |
|
957 |
||
958 |
|b| |
|
959 |
||
960 |
bindings notNil ifTrue:[ |
|
961 |
b := bindings at:aKey ifAbsent:nil. |
|
962 |
b notNil ifTrue:[ |
|
963 |
(b isBlock and:[b numArgs == 2]) ifTrue:[ |
|
964 |
^ [b value:arg1 value:arg2] |
|
965 |
]. |
|
966 |
^ b |
|
967 |
]. |
|
968 |
]. |
|
969 |
||
970 |
^ self |
|
971 |
safelyPerform:#actionFor:withValue:withValue: |
|
972 |
withArguments:(Array with:aKey with:arg1 with:arg2) |
|
973 |
ifNone:[ self aspectNotFound:aKey error:'no action for:'. ] |
|
716 | 974 |
! |
975 |
||
374 | 976 |
aspectFor:aKey |
450 | 977 |
"return a model for aKey. This is invoked during window building |
978 |
(by the builder) to ask for an Editfields, a Toggles etc. model. |
|
979 |
Here, first the local bindings are searched, then the application and |
|
980 |
finally the applications class is asked for a corresponding action. |
|
981 |
The returned object is typically a valueHolder." |
|
982 |
||
434 | 983 |
|b| |
984 |
||
985 |
bindings notNil ifTrue:[ |
|
986 |
b := bindings at:aKey ifAbsent:nil. |
|
987 |
b notNil ifTrue:[^ b]. |
|
988 |
]. |
|
989 |
||
2499 | 990 |
^ self |
991 |
safelyPerform:#aspectFor: |
|
992 |
with:aKey |
|
993 |
ifNone:[ self aspectAt:aKey ] |
|
374 | 994 |
! |
995 |
||
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
996 |
aspectFor:aKey ifAbsent:exceptionBlock |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
997 |
"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
|
998 |
(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
|
999 |
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
|
1000 |
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
|
1001 |
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
|
1002 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1003 |
|b| |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1004 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1005 |
bindings notNil ifTrue:[ |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1006 |
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
|
1007 |
b notNil ifTrue:[^ b]. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1008 |
]. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1009 |
|
2499 | 1010 |
^ self |
1011 |
safelyPerform:#aspectFor: |
|
1012 |
with:aKey |
|
1013 |
ifNone:[ self aspectAt:aKey ifAbsent:exceptionBlock ] |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1014 |
! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1015 |
|
423 | 1016 |
componentFor:aKey |
450 | 1017 |
"return a component for aKey. This is invoked during window building |
1018 |
(by the builder) to ask for an ArbitraryComponents view. |
|
1019 |
Here, first the local bindings are searched, then the application and |
|
1020 |
finally the applications class is asked for a corresponding action. |
|
1021 |
The returned object is typically a view." |
|
1022 |
||
848 | 1023 |
^ self safelyPerform:#componentFor: |
1024 |
with:aKey |
|
1025 |
ifNone:[ self aspectAt:aKey ] |
|
423 | 1026 |
! |
1027 |
||
422 | 1028 |
labelFor:aKey |
450 | 1029 |
"return a label for aKey. This is invoked during window building |
1030 |
(by the builder) to ask for a ???'s label. |
|
1031 |
Here, first the local bindings are searched, then the application and |
|
1032 |
finally the applications class is asked for a corresponding action. |
|
1033 |
The returned object is typically a string." |
|
1034 |
||
848 | 1035 |
^ self safelyPerform:#labelFor: |
1036 |
with:aKey |
|
1037 |
ifNone:[ self aspectAt:aKey ] |
|
422 | 1038 |
! |
1039 |
||
1040 |
listFor:aKey |
|
450 | 1041 |
"return a list for aKey. This is invoked during window building |
1042 |
(by the builder) to ask for a ???'s label. |
|
1043 |
Here, first the local bindings are searched, then the application and |
|
1044 |
finally the applications class is asked for a corresponding action. |
|
1045 |
The returned object is typically a list." |
|
1046 |
||
848 | 1047 |
^ self safelyPerform:#listFor: |
1048 |
with:aKey |
|
1049 |
ifNone:[ self aspectAt:aKey ] |
|
1050 |
! |
|
1051 |
||
1052 |
menuFor:aKey |
|
1053 |
"Find a binding for the menu named aKey, either in the bindings |
|
1054 |
or from the source" |
|
1055 |
||
1056 |
|menu| |
|
1057 |
||
961 | 1058 |
aKey isNil ifTrue:[^ nil]. |
1059 |
||
848 | 1060 |
(menu := self bindingAt:aKey) notNil ifTrue:[ |
1061 |
^ menu |
|
1062 |
]. |
|
1063 |
||
1064 |
menu := self safelyPerform:#menuFor: with:aKey ifNone:[ |
|
1065 |
self safelyPerform:aKey ifNone:[ |
|
1066 |
self aspectNotFound:aKey error:'no menu for:'. |
|
1067 |
nil |
|
1068 |
] |
|
1069 |
]. |
|
1070 |
||
862 | 1071 |
menu isBlock ifFalse:[ |
1072 |
((menu := menu value) notNil and:[application notNil]) ifTrue:[ |
|
2291 | 1073 |
menu isCollection ifTrue:[ |
1074 |
menu := Menu decodeFromLiteralArray:menu. |
|
1533
b6b2f8ab4e4a
findGuiResources... now sets the receiver, if not yet set
Claus Gittinger <cg@exept.de>
parents:
1520
diff
changeset
|
1075 |
"/ 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
|
1076 |
]. |
4680e2fe4728
must care for resource-label translation of a menu
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
1077 |
menu findGuiResourcesIn:application |
450 | 1078 |
] |
422 | 1079 |
]. |
848 | 1080 |
^ menu |
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
1081 |
|
2291 | 1082 |
"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
|
1083 |
! |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1084 |
|
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1085 |
specificationFor:aKey |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1086 |
"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
|
1087 |
(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
|
1088 |
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
|
1089 |
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
|
1090 |
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
|
1091 |
|
1585 | 1092 |
^ self |
1093 |
safelyPerform:#specificationFor: |
|
1094 |
with:aKey |
|
1095 |
ifNone:[ self aspectFor:aKey ] |
|
422 | 1096 |
! ! |
1097 |
||
1098 |
!WindowBuilder methodsFor:'spec creation callbacks'! |
|
1099 |
||
735 | 1100 |
createdComponent:aView forSpec:spec named:name |
1101 |
"callback from the UISpec after a view has been |
|
1102 |
created for a spec. |
|
1103 |
If it has a name, add it to the namedComponents dictionary; |
|
1104 |
if I have a creationHook (application callBack), evaluate it." |
|
1105 |
||
2369 | 1106 |
|createCallBackSelector app| |
1107 |
||
735 | 1108 |
name notNil ifTrue:[ |
1993 | 1109 |
"/ "/ debugging ... |
1110 |
"/ (namedComponents notNil and:[namedComponents includesKey:name asSymbol]) ifTrue:[ |
|
1111 |
"/ Transcript showCR:'WARNING multiple UI-build of: ',name asSymbol |
|
1112 |
"/ ]. |
|
1992 | 1113 |
self componentAt:name put:aView. |
735 | 1114 |
]. |
2462 | 1115 |
spec addView:aView toMappingOfBuilder:self. |
410 | 1116 |
componentCreationHook notNil ifTrue:[ |
1117 |
componentCreationHook value:aView value:spec value:self |
|
2369 | 1118 |
]. |
1119 |
||
1120 |
self isEditing ifFalse:[ |
|
1121 |
(createCallBackSelector := spec postBuildCallback) notNil ifTrue:[ |
|
1122 |
app := self application. |
|
1123 |
app |
|
1124 |
perform:createCallBackSelector |
|
1125 |
withOptionalArgument:aView |
|
1126 |
and:spec |
|
1127 |
and:self. |
|
1128 |
]. |
|
1129 |
]. |
|
100 | 1130 |
|
735 | 1131 |
"Modified: / 5.9.1995 / 21:42:54 / claus" |
1132 |
"Created: / 31.10.1997 / 18:47:01 / cg" |
|
1133 |
"Modified: / 31.10.1997 / 18:51:22 / cg" |
|
100 | 1134 |
! ! |
1135 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1136 |
!WindowBuilder methodsFor:'startup'! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1137 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1138 |
closeRequest |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1139 |
window destroy |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1140 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1141 |
"Modified: 17.1.1997 / 19:30:32 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1142 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1143 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1144 |
open |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1145 |
"open my topView, as previously created" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1146 |
|
477 | 1147 |
|type| |
1148 |
||
1149 |
application isNil ifTrue:[ |
|
1150 |
type := #normal |
|
1151 |
] ifFalse:[ |
|
1152 |
type := application defaultWindowType |
|
1153 |
]. |
|
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1154 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1155 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1156 |
withExtent:nil |
477 | 1157 |
andType:type |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1158 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1159 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1160 |
|
428 | 1161 |
openAt:aPoint |
1162 |
"open my topView at some location" |
|
1163 |
||
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1164 |
^ self |
467 | 1165 |
openAt:aPoint |
1166 |
withExtent:nil |
|
428 | 1167 |
andType:(application defaultWindowType) |
1168 |
||
1169 |
"Created: 14.2.1997 / 20:21:57 / cg" |
|
467 | 1170 |
"Modified: 28.2.1997 / 22:50:29 / cg" |
428 | 1171 |
! |
1172 |
||
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1173 |
openDialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1174 |
"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
|
1175 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1176 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1177 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1178 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1179 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1180 |
andType:#dialog |
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 |
openDialogAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1184 |
"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
|
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:aPoint |
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: 17.1.1997 / 19:59:36 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1193 |
"Created: 14.2.1997 / 20:24:19 / cg" |
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 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1196 |
openDialogAt:aPoint withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1197 |
"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
|
1198 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1199 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1200 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1201 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1202 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1203 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1204 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1205 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1206 |
"Created: 14.2.1997 / 20:24:19 / cg" |
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 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1209 |
openDialogWithExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1210 |
"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
|
1211 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1212 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1213 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1214 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1215 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1216 |
andType:#dialog |
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 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1219 |
! |
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 |
openModal |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1222 |
"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
|
1223 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1224 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1225 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1226 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1227 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1228 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1229 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1230 |
"Modified: 3.3.1997 / 19:43:57 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1231 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1232 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1233 |
openPopUpAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1234 |
"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
|
1235 |
blocking interaction to the currently active view." |
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 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1238 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1239 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1240 |
andType:#popUp |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1241 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1242 |
"Modified: 17.1.1997 / 19:59:29 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1243 |
"Created: 14.2.1997 / 20:24:38 / cg" |
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 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1246 |
openPopUpIn:aRectangle |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1247 |
"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
|
1248 |
blocking interaction to the currently active view." |
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 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1251 |
openAt:aRectangle origin |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1252 |
withExtent:aRectangle extent |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1253 |
andType:#popUp |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1254 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1255 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1256 |
openWindow |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1257 |
"open my topView" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1258 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1259 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1260 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1261 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1262 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1263 |
|
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 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1266 |
openWindowAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1267 |
"open my topView at some location" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1268 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1269 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1270 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1271 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1272 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1273 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1274 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1275 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1276 |
openWindowAt:origin withExtent:ext andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1277 |
"open my window, as previously created, optionally defining the |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1278 |
windows origin and/or extent. |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1279 |
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
|
1280 |
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
|
1281 |
active view, or as a normal view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1282 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1283 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1284 |
openAt:origin |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1285 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1286 |
andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1287 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1288 |
|
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1289 |
openWindowCenter |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1290 |
"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
|
1291 |
|
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1292 |
^ self |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1293 |
openAt:#center |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1294 |
withExtent:nil |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1295 |
andType:(application defaultWindowType) |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1296 |
|
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1297 |
! |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1298 |
|
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1299 |
openWithExtent:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1300 |
"open my topView, as previously created, but override |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1301 |
the extent." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1302 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1303 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1304 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1305 |
withExtent:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1306 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1307 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1308 |
"Modified: 17.1.1997 / 19:58:48 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1309 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1310 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1311 |
openWithExtent:ext andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1312 |
"open my window, as previously created. The type argument |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1313 |
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
|
1314 |
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
|
1315 |
active view, or as a normal view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1316 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1317 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1318 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1319 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1320 |
andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1321 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1322 |
"Modified: 14.2.1997 / 20:22:47 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1323 |
! ! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1324 |
|
1766 | 1325 |
!WindowBuilder methodsFor:'startup-basic'! |
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1326 |
|
436 | 1327 |
openAt:origin withExtent:ext andType:type |
428 | 1328 |
"open my window, as previously created, optionally defining the |
1329 |
windows origin and/or extent. |
|
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1330 |
The type argument may be #dialog, #popup or #normal, |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1331 |
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
|
1332 |
modal view (blocking interaction to the currently active view), |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1333 |
as popUp (also blocking) |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1334 |
or as a normal view." |
428 | 1335 |
|
1774
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1336 |
|appWinClass device wg mainWin| |
1359
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1337 |
|
1672 | 1338 |
device := window device. |
428 | 1339 |
origin notNil ifTrue:[ |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1340 |
"/ kludge |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1341 |
origin ~~ #center ifTrue:[ |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1342 |
window origin:origin |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1343 |
] |
428 | 1344 |
]. |
1345 |
ext notNil ifTrue:[ |
|
480 | 1346 |
window extent:ext. |
1347 |
] ifFalse:[ |
|
2015 | 1348 |
((type == #dialog) or:[type == #toolDialog]) ifTrue:[ |
480 | 1349 |
window fixSize |
1350 |
] |
|
1351 |
]. |
|
1352 |
||
2015 | 1353 |
((type == #dialog) or:[type == #toolDialog]) ifTrue:[ |
1520 | 1354 |
((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
|
1355 |
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
|
1356 |
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
|
1357 |
] ifFalse:[ |
1774
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1358 |
wg := WindowGroup activeGroup. |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1359 |
wg notNil ifTrue:[ |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1360 |
wg := wg mainGroup. |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1361 |
mainWin := wg topViews firstIfEmpty:nil. |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1362 |
]. |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1363 |
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
|
1364 |
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
|
1365 |
] ifFalse:[ |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1366 |
window fixPosition:(device pointerPosition - window positionOffset). |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1367 |
] |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1368 |
]. |
2434
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1369 |
window corner y > window device usableHeight ifTrue:[ |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1370 |
(window device usableHeight - window height) > 0 ifTrue:[ |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1371 |
window origin:(window origin x |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1372 |
@ |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1373 |
(window device usableHeight - window height)) |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1374 |
] ifFalse:[ |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1375 |
window origin:(window origin x |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1376 |
@ |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1377 |
0) |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1378 |
]. |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1379 |
]. |
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1380 |
^ window openModal. |
428 | 1381 |
]. |
1382 |
||
1634 | 1383 |
(type == #normal or:[type = #slave or:[type = #partner]]) ifTrue:[ |
480 | 1384 |
window isNil ifTrue:[ |
1359
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1385 |
application notNil ifTrue:[ |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1386 |
appWinClass := application applicationWindowClass |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1387 |
] ifFalse:[ |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1388 |
appWinClass := ApplicationWindow |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1389 |
]. |
1879
0c9ba6cc5a9a
Keep the title bar of a modal window in the visible area
Stefan Vogel <sv@exept.de>
parents:
1825
diff
changeset
|
1390 |
self setupWindowFor:appWinClass new. |
480 | 1391 |
]. |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1392 |
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
|
1393 |
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
|
1394 |
]. |
480 | 1395 |
|
1634 | 1396 |
"/ the following code creates a master-slave relationship, if |
1397 |
"/ the masterApplication is not nil. |
|
1398 |
"/ Disabled, because: the masterApplication is used to fulfill missing aspects, |
|
1399 |
"/ which has nothing to do with a window master-slave relationship. |
|
1400 |
||
1401 |
"/ application masterApplication notNil ifTrue:[ |
|
1402 |
"/ masterWindow := application masterApplication window. |
|
1403 |
"/ (masterWindow isMaster or:[masterWindow isSlave or:[masterWindow isPartner]]) |
|
1404 |
"/ ifFalse:[ |
|
1405 |
"/ "/ master is neutral - make him a master |
|
1406 |
"/ masterWindow beMaster |
|
1407 |
"/ ]. |
|
1408 |
"/ window beSlave. |
|
1409 |
"/ ]. |
|
1410 |
||
1722 | 1411 |
"/ must be done explicit, by passing an appropriate windowType |
1412 |
||
1634 | 1413 |
type = #slave ifTrue:[ |
1414 |
window beSlave. |
|
1415 |
]. |
|
1416 |
type = #partner ifTrue:[ |
|
1417 |
window bePartner. |
|
1418 |
]. |
|
1722 | 1419 |
|
1725
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1420 |
((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
|
1421 |
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
|
1422 |
ifTrue:[ |
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1423 |
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
|
1424 |
] ifFalse:[ |
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1425 |
window open. |
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1426 |
]. |
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1427 |
|
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1428 |
"/ the following automatism is probably too cryptic and has too much of a side effect. |
1722 | 1429 |
"/ I prefer to leave things as they are: i.e. enforce the programmer to |
1430 |
"/ do thinks explicit. |
|
1431 |
||
1432 |
"/ type = #slave ifTrue:[ |
|
1433 |
"/ window windowGroup topViews first beMaster |
|
1434 |
"/ ]. |
|
428 | 1435 |
^ self |
1436 |
]. |
|
1437 |
||
1438 |
type == #popUp ifTrue:[ |
|
1672 | 1439 |
window fixPosition:(device pointerPosition). |
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1440 |
^ window openAsPopUp. |
428 | 1441 |
]. |
1442 |
||
1443 |
" |
|
1444 |
if ST-80 supports more types - these may be added later |
|
1445 |
" |
|
1825 | 1446 |
self shouldImplement |
428 | 1447 |
|
735 | 1448 |
"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
|
1449 |
"Modified: / 18.6.1998 / 19:10:07 / cg" |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1450 |
! ! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1451 |
|
132 | 1452 |
!WindowBuilder class methodsFor:'documentation'! |
1453 |
||
1454 |
version |
|
2499 | 1455 |
^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.133 2008-06-20 09:34:53 cg Exp $' |
132 | 1456 |
! ! |