author | Claus Gittinger <cg@exept.de> |
Mon, 11 May 2009 08:35:25 +0200 | |
changeset 2672 | 5d7fd9552774 |
parent 2610 | 4315c3f2ab4a |
child 2690 | b42670756688 |
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 |
2610 | 531 |
"return the applications resources - |
532 |
that's a ResourcePack containing national language strings" |
|
533 |
||
1585 | 534 |
application notNil ifTrue:[ |
535 |
^ application resources |
|
536 |
]. |
|
537 |
^ Dialog classResources. |
|
538 |
! |
|
539 |
||
502 | 540 |
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
|
541 |
"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
|
542 |
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
|
543 |
which can be filled via #specificationAt:at:put: messages. |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
544 |
If not present, or none is found there, we bounce back trying |
824 | 545 |
#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
|
546 |
message to the class named as majorKey. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
547 |
Notice, that the class named majorKey is first searched in the |
2005 | 548 |
application classes namespace - allowing private classes as majorKey." |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
549 |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
550 |
|spec cls dict dkey| |
502 | 551 |
|
1351
42d9de8818bf
care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
552 |
minorKey isNil ifTrue:[^ nil]. |
42d9de8818bf
care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
553 |
|
502 | 554 |
subCanvasSpecs notNil ifTrue:[ |
586 | 555 |
dkey := majorKey ? #NoMajorKey. |
556 |
dict := subCanvasSpecs at:dkey ifAbsent:nil. |
|
557 |
||
558 |
dict notNil ifTrue:[ |
|
559 |
spec := dict at:minorKey ifAbsent:nil. |
|
502 | 560 |
spec notNil ifTrue:[^ spec]. |
561 |
]. |
|
562 |
]. |
|
586 | 563 |
|
502 | 564 |
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
|
565 |
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
|
566 |
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
|
567 |
"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
|
568 |
MessageNotUnderstood catch:[ |
31f716526f31
Fix fetching of subCanvasSpec from UIPainter if there is no major key
Stefan Vogel <sv@exept.de>
parents:
2369
diff
changeset
|
569 |
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
|
570 |
]. |
31f716526f31
Fix fetching of subCanvasSpec from UIPainter if there is no major key
Stefan Vogel <sv@exept.de>
parents:
2369
diff
changeset
|
571 |
]. |
31f716526f31
Fix fetching of subCanvasSpec from UIPainter if there is no major key
Stefan Vogel <sv@exept.de>
parents:
2369
diff
changeset
|
572 |
^ spec |
848 | 573 |
]. |
574 |
||
575 |
application notNil ifTrue:[ |
|
576 |
"/ look for class in applications namespace ... |
|
577 |
cls := application resolveName:majorKey. |
|
502 | 578 |
] ifFalse:[ |
848 | 579 |
"/ fallBack - use that global, if it exists |
580 |
cls := Smalltalk at:majorKey. |
|
581 |
cls isNil ifTrue:[ |
|
582 |
Transcript showCR:('WindowBuilder[warning]: missing application when fetching majorKey:' , majorKey). |
|
735 | 583 |
]. |
502 | 584 |
]. |
586 | 585 |
|
848 | 586 |
cls notNil ifTrue:[ |
1585 | 587 |
MessageNotUnderstood catch:[ |
848 | 588 |
^ cls specificationFor:minorKey |
589 |
]. |
|
1586 | 590 |
MessageNotUnderstood catch:[ |
591 |
^ cls perform:minorKey. |
|
592 |
] |
|
848 | 593 |
]. |
594 |
^ nil |
|
502 | 595 |
! |
596 |
||
597 |
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
|
598 |
"deposit an interfaceSpecification for major and minor key |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
599 |
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
|
600 |
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
|
601 |
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
|
602 |
(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
|
603 |
See #subCanvasAt:at:." |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
604 |
|
502 | 605 |
|dict key| |
606 |
||
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
607 |
subCanvasSpecs isNil ifTrue:[ |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
608 |
"/ lazyly initialize |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
609 |
subCanvasSpecs := IdentityDictionary new |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
610 |
]. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
611 |
|
502 | 612 |
key := majorKey ? #NoMajorKey. |
613 |
dict := subCanvasSpecs at:key ifAbsent:nil. |
|
614 |
dict isNil ifTrue:[ |
|
615 |
dict := IdentityDictionary new. |
|
616 |
subCanvasSpecs at:key put:dict |
|
617 |
]. |
|
618 |
dict at:minorKey put:aSpec |
|
619 |
||
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
620 |
"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
|
621 |
"Modified: / 5.2.1998 / 12:05:32 / stefan" |
502 | 622 |
! |
623 |
||
475
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
624 |
visualAt:name |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
625 |
visuals isNil ifTrue:[^ nil]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
626 |
^ visuals at:name asSymbol ifAbsent:nil |
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 |
"Created: 3.3.1997 / 16:24:17 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
629 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
630 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
631 |
visualAt:name put:aVisual |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
632 |
visuals isNil ifTrue:[ |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
633 |
visuals := IdentityDictionary new. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
634 |
]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
635 |
visuals at:name asSymbol put:aVisual |
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 |
"Created: 3.3.1997 / 16:24:41 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
638 |
! |
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 |
visuals |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
641 |
^ visuals |
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 |
"Created: 3.3.1997 / 16:24:00 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
644 |
! |
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 |
visuals:aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
647 |
visuals := aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
648 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
649 |
"Created: 3.3.1997 / 16:24:06 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
650 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
651 |
|
125 | 652 |
window |
1995 | 653 |
"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
|
654 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
655 |
^ window |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
656 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
657 |
"Modified: 17.1.1997 / 19:30:00 / cg" |
125 | 658 |
! |
659 |
||
660 |
window:aView |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
661 |
"set the top window (view), for which an interface |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
662 |
is (being) built" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
663 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
664 |
window := aView |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
665 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
666 |
"Modified: 17.1.1997 / 19:30:22 / cg" |
66 | 667 |
! |
668 |
||
669 |
windowGroup |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
670 |
^ window windowGroup |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
671 |
|
608 | 672 |
"Modified: 17.6.1997 / 18:04:01 / cg" |
66 | 673 |
! ! |
674 |
||
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
675 |
!WindowBuilder methodsFor:'aspect access support'! |
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
676 |
|
675 | 677 |
booleanValueAspectFor:aKey |
674 | 678 |
"helper (common code) to generate a boolean aspect if required. |
679 |
If no binding exists for aKey, a valueHolder holding false is |
|
680 |
created and added to the bindings. |
|
681 |
Otherwise, the existing binding is returned." |
|
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
682 |
|
676 | 683 |
^ self valueAspectFor:aKey initialValue:false |
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
684 |
|
676 | 685 |
"Modified: 28.7.1997 / 12:53:57 / cg" |
675 | 686 |
! |
687 |
||
1198
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
688 |
listAspectFor:aKey |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
689 |
"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
|
690 |
If no binding exists for aKey, a new List is |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
691 |
created and added to the bindings. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
692 |
Otherwise, the existing binding is returned." |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
693 |
|
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
694 |
|list| |
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 := self bindingAt:aKey) isNil ifTrue:[ |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
697 |
self aspectAt:aKey put:(list := List new). |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
698 |
]. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
699 |
^ list |
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 |
"Created: 28.7.1997 / 12:53:45 / cg" |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
702 |
"Modified: 28.7.1997 / 12:54:13 / cg" |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
703 |
! |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
704 |
|
675 | 705 |
nilValueAspectFor:aKey |
706 |
"helper (common code) to generate a valueHolder aspect if required. |
|
707 |
If no binding exists for aKey, a valueHolder holding nil is |
|
708 |
created and added to the bindings. |
|
709 |
Otherwise, the existing binding is returned." |
|
710 |
||
676 | 711 |
^ self valueAspectFor:aKey initialValue:nil |
712 |
||
713 |
"Modified: 28.7.1997 / 12:54:06 / cg" |
|
714 |
! |
|
715 |
||
2403
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
716 |
valueAspectFor:aKey computeInitialValueWith:initialValueBlock |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
717 |
"helper (common code) to generate a valueHolder aspect if required. |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
718 |
If no binding exists for aKey, a valueHolder holding initialValue is |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
719 |
created and added to the bindings. |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
720 |
Otherwise, the existing binding is returned. |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
721 |
The initial value is computed by evaluating initialValueBlock" |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
722 |
|
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
723 |
|holder| |
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 := self bindingAt:aKey) isNil ifTrue:[ |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
726 |
self aspectAt:aKey put:(holder := initialValueBlock value asValue). |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
727 |
]. |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
728 |
^ holder |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
729 |
! |
e9733679fa92
changed #valueAspectFor:computeInitialValueWith:
Claus Gittinger <cg@exept.de>
parents:
2389
diff
changeset
|
730 |
|
676 | 731 |
valueAspectFor:aKey initialValue:initialValue |
732 |
"helper (common code) to generate a valueHolder aspect if required. |
|
733 |
If no binding exists for aKey, a valueHolder holding initialValue is |
|
734 |
created and added to the bindings. |
|
735 |
Otherwise, the existing binding is returned." |
|
736 |
||
675 | 737 |
|holder| |
738 |
||
739 |
(holder := self bindingAt:aKey) isNil ifTrue:[ |
|
2109 | 740 |
self aspectAt:aKey put:(holder := initialValue asValue). |
675 | 741 |
]. |
742 |
^ holder |
|
743 |
||
676 | 744 |
"Created: 28.7.1997 / 12:53:45 / cg" |
745 |
"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
|
746 |
! ! |
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
747 |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
748 |
!WindowBuilder methodsFor:'building'! |
66 | 749 |
|
125 | 750 |
buildFromSpec:aSpec |
176 | 751 |
^ self subclassResponsibility |
408 | 752 |
! |
753 |
||
754 |
makeTabable:aComponent |
|
735 | 755 |
"add a component to the list of tabable components" |
756 |
||
1315 | 757 |
aComponent canTab:true |
735 | 758 |
|
1123 | 759 |
! |
760 |
||
761 |
setupWindowFor:aWindow |
|
762 |
self subclassResponsibility |
|
66 | 763 |
! ! |
100 | 764 |
|
848 | 765 |
!WindowBuilder methodsFor:'error handling'! |
766 |
||
767 |
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
|
768 |
"show error message on transcript (if Verbose is true) |
1825 | 769 |
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
|
770 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
771 |
Verbose == true ifTrue:[ |
1395 | 772 |
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
|
773 |
application notNil ifTrue:[ |
1395 | 774 |
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
|
775 |
]. |
1028
4f3401b606bd
better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
776 |
]. |
848 | 777 |
|
778 |
StopOnError == true ifTrue:[ |
|
1825 | 779 |
self halt:'aspect not found' "/ set StopOnError to true to debug end-user apps |
848 | 780 |
]. |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
781 |
^ nil |
1028
4f3401b606bd
better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
782 |
|
1395 | 783 |
"Modified: / 18.8.2000 / 14:10:59 / cg" |
848 | 784 |
! ! |
785 |
||
586 | 786 |
!WindowBuilder methodsFor:'message sending'! |
787 |
||
848 | 788 |
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
|
789 |
"send the message aSelector to the application; |
2558 | 790 |
the result returned from the send or nil is returned" |
791 |
||
2363 | 792 |
|handlerBlock| |
586 | 793 |
|
848 | 794 |
aSelector notNil ifTrue:[ |
2558 | 795 |
handlerBlock := [:ex| |
796 |
(ex selector ~~ aSelector) ifTrue:[ |
|
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
797 |
ex reject |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
798 |
] |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
799 |
]. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
800 |
|
595 | 801 |
application notNil ifTrue:[ |
1585 | 802 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 803 |
^ application perform:aSelector |
804 |
]. |
|
1585 | 805 |
MessageNotUnderstood handle:handlerBlock do:[ |
2363 | 806 |
^ application class perform:aSelector |
595 | 807 |
] |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
808 |
]. |
1585 | 809 |
" |
810 |
WARNING: |
|
811 |
This is a private interface for the UIPainter to pass down the app-class |
|
812 |
" |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
813 |
applicationClass notNil ifTrue:[ |
1585 | 814 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 815 |
^ 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
|
816 |
] |
586 | 817 |
] |
818 |
]. |
|
2363 | 819 |
^ aBlock value |
981
6a9c975543ad
also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents:
974
diff
changeset
|
820 |
|
6a9c975543ad
also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents:
974
diff
changeset
|
821 |
"Modified: / 20.6.1998 / 11:52:19 / cg" |
586 | 822 |
! |
823 |
||
848 | 824 |
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
|
825 |
"send the one-arg-message aSelector to the application; |
2005 | 826 |
the result returned from the send or nil is returned" |
827 |
||
2363 | 828 |
^ self |
829 |
safelyPerform:aSelector |
|
830 |
withArguments:(Array with:anArgument) |
|
831 |
ifNone:aBlock |
|
832 |
! |
|
833 |
||
834 |
safelyPerform:aSelector with:arg1 with:arg2 ifNone:aBlock |
|
835 |
"send the two-arg-message aSelector to the application; |
|
836 |
the result returned from the send or nil is returned" |
|
837 |
||
838 |
^ self |
|
839 |
safelyPerform:aSelector |
|
840 |
withArguments:(Array with:arg1 with:arg2) |
|
841 |
ifNone:aBlock |
|
842 |
! |
|
843 |
||
844 |
safelyPerform:aSelector with:arg1 with:arg2 with:arg3 ifNone:aBlock |
|
845 |
"send the 3-arg-message aSelector to the application; |
|
846 |
the result returned from the send or nil is returned" |
|
847 |
||
848 |
^ self |
|
849 |
safelyPerform:aSelector |
|
850 |
withArguments:(Array with:arg1 with:arg2 with:arg3) |
|
851 |
ifNone:aBlock |
|
852 |
! |
|
853 |
||
854 |
safelyPerform:aSelector withArguments:arguments ifNone:aBlock |
|
855 |
"send the one-arg-message aSelector to the application; |
|
856 |
the result returned from the send or nil is returned" |
|
857 |
||
1587 | 858 |
|handlerBlock| |
586 | 859 |
|
848 | 860 |
aSelector notNil ifTrue:[ |
1587 | 861 |
handlerBlock := [:ex| |badSel| |
862 |
badSel := ex selector. |
|
2363 | 863 |
(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
|
864 |
ex reject |
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 |
]. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
867 |
|
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
868 |
application notNil ifTrue:[ |
1585 | 869 |
MessageNotUnderstood handle:handlerBlock do:[ |
2363 | 870 |
^ application perform:aSelector withArguments:arguments |
848 | 871 |
]. |
1585 | 872 |
MessageNotUnderstood handle:handlerBlock do:[ |
2363 | 873 |
^ application class perform:aSelector withArguments:arguments |
595 | 874 |
] |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
875 |
]. |
1585 | 876 |
" |
877 |
WARNING: |
|
878 |
This is a private interface for the UIPainter to pass down the app-class |
|
879 |
" |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
880 |
applicationClass notNil ifTrue:[ |
1585 | 881 |
MessageNotUnderstood handle:handlerBlock do:[ |
2363 | 882 |
^ applicationClass perform:aSelector withArguments:arguments |
848 | 883 |
]. |
884 |
] |
|
885 |
]. |
|
1587 | 886 |
^ aBlock value |
961 | 887 |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
888 |
"Modified: / 4.8.1998 / 19:33:52 / cg" |
586 | 889 |
! ! |
890 |
||
2369 | 891 |
!WindowBuilder methodsFor:'queries'! |
892 |
||
893 |
isEditing |
|
894 |
"true if building from a GUI builder resource ( UIPainter, ... ), |
|
895 |
false if building for the real thing. |
|
896 |
If true, no models or actions should be set (no application is running)" |
|
897 |
||
898 |
^ false |
|
899 |
! ! |
|
900 |
||
2546
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
901 |
!WindowBuilder methodsFor:'resolving fonts'! |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
902 |
|
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
903 |
resolveFont:fontOrSymbolOrStyle |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
904 |
"resolve fontOrSymbol to a real font" |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
905 |
|
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
906 |
|font txtAttribs charAttribs| |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
907 |
|
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
908 |
fontOrSymbolOrStyle isSymbol ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
909 |
self isEditing ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
910 |
"special for UIPainter setup: check class for color" |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
911 |
applicationClass notNil ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
912 |
font := applicationClass fontFor:fontOrSymbolOrStyle. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
913 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
914 |
] ifFalse:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
915 |
font := application fontFor:fontOrSymbolOrStyle. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
916 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
917 |
font notNil ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
918 |
^ font. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
919 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
920 |
|
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
921 |
"/ ST80 style textAttributes |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
922 |
(TextAttributes notNil and:[TextAttributes isLoaded]) ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
923 |
txtAttribs := TextAttributes styleNamed:fontOrSymbolOrStyle ifAbsent:nil. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
924 |
txtAttribs notNil ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
925 |
charAttribs := txtAttribs characterAttributes. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
926 |
charAttribs notNil ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
927 |
font := charAttribs defaultFont. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
928 |
] |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
929 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
930 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
931 |
|
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
932 |
font isNil ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
933 |
fontOrSymbolOrStyle == #labelFont ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
934 |
^ Label defaultFont |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
935 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
936 |
fontOrSymbolOrStyle == #buttonFont ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
937 |
^ Button defaultFont |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
938 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
939 |
fontOrSymbolOrStyle == #listFont ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
940 |
^ SelectionInListView defaultFont |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
941 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
942 |
fontOrSymbolOrStyle == #menuFont ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
943 |
^ MenuView defaultFont |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
944 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
945 |
fontOrSymbolOrStyle == #textFont ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
946 |
^ TextView defaultFont |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
947 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
948 |
fontOrSymbolOrStyle == #inputFont ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
949 |
^ EditField defaultFont |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
950 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
951 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
952 |
|
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
953 |
font isNil ifTrue:[ |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
954 |
('Missing font <1p> in <2p>' expandMacrosWith:fontOrSymbolOrStyle with:application class) errorPrintCR. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
955 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
956 |
^ font. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
957 |
]. |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
958 |
|
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
959 |
^ Font |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
960 |
family:(fontOrSymbolOrStyle family) |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
961 |
face:(fontOrSymbolOrStyle face) |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
962 |
style:(fontOrSymbolOrStyle style) |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
963 |
size:(fontOrSymbolOrStyle size) |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
964 |
encoding:(fontOrSymbolOrStyle encoding) |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
965 |
! ! |
eba039ef14ba
Resolve symbolic fonts - now in WindowBuilder
Stefan Vogel <sv@exept.de>
parents:
2529
diff
changeset
|
966 |
|
422 | 967 |
!WindowBuilder methodsFor:'spec creation aspect fetch'! |
100 | 968 |
|
374 | 969 |
actionFor:aKey |
450 | 970 |
"return an action for aKey. This is invoked during window building |
971 |
(by the builder) to ask for an ActionButtons actionBlock. |
|
972 |
Here, first the local bindings are searched, then the application and |
|
973 |
finally the applications class is asked for a corresponding action. |
|
974 |
The returned object is typically a block." |
|
975 |
||
434 | 976 |
|b| |
977 |
||
978 |
bindings notNil ifTrue:[ |
|
979 |
b := bindings at:aKey ifAbsent:nil. |
|
980 |
b notNil ifTrue:[^ b]. |
|
981 |
]. |
|
982 |
||
848 | 983 |
^ self safelyPerform:#actionFor: |
984 |
with:aKey |
|
985 |
ifNone:[ self aspectNotFound:aKey error:'no action for:'. [] ] |
|
374 | 986 |
! |
987 |
||
716 | 988 |
actionFor:aKey withValue:aValue |
989 |
"return an action for aKey/value combonation. |
|
990 |
This is invoked during window building |
|
991 |
(by the builder) to ask for an ActionButtons actionBlock if that button |
|
992 |
specified an action with an argument value. |
|
993 |
Here, first the local bindings are searched, then the application and |
|
994 |
finally the applications class is asked for a corresponding action. |
|
995 |
The returned object is typically a block." |
|
996 |
||
997 |
|b| |
|
998 |
||
999 |
bindings notNil ifTrue:[ |
|
1000 |
b := bindings at:aKey ifAbsent:nil. |
|
1198
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
1001 |
b notNil ifTrue:[ |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
1002 |
(b isBlock and:[b numArgs == 1]) ifTrue:[ |
2363 | 1003 |
^ [b value:aValue] |
1198
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
1004 |
]. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
1005 |
^ b |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
1006 |
]. |
716 | 1007 |
]. |
1008 |
||
2363 | 1009 |
^ self |
1010 |
safelyPerform:#actionFor:withValue: |
|
1011 |
withArguments:(Array with:aKey with:aValue) |
|
1012 |
ifNone:[ self aspectNotFound:aKey error:'no action for:'. |
|
1013 |
[] |
|
1014 |
] |
|
1015 |
! |
|
1016 |
||
1017 |
actionFor:aKey withValue:arg1 withValue:arg2 |
|
1018 |
"return an action for aKey/value combination. |
|
1019 |
This is invoked during window building |
|
1020 |
(by the builder) to ask for an ActionButtons actionBlock if that button |
|
1021 |
specified an action with an argument value. |
|
1022 |
Here, first the local bindings are searched, then the application and |
|
1023 |
finally the applications class is asked for a corresponding action. |
|
1024 |
The returned object is typically a block." |
|
1025 |
||
1026 |
|b| |
|
1027 |
||
1028 |
bindings notNil ifTrue:[ |
|
1029 |
b := bindings at:aKey ifAbsent:nil. |
|
1030 |
b notNil ifTrue:[ |
|
1031 |
(b isBlock and:[b numArgs == 2]) ifTrue:[ |
|
1032 |
^ [b value:arg1 value:arg2] |
|
1033 |
]. |
|
1034 |
^ b |
|
1035 |
]. |
|
1036 |
]. |
|
1037 |
||
1038 |
^ self |
|
1039 |
safelyPerform:#actionFor:withValue:withValue: |
|
1040 |
withArguments:(Array with:aKey with:arg1 with:arg2) |
|
1041 |
ifNone:[ self aspectNotFound:aKey error:'no action for:'. ] |
|
716 | 1042 |
! |
1043 |
||
374 | 1044 |
aspectFor:aKey |
450 | 1045 |
"return a model for aKey. This is invoked during window building |
1046 |
(by the builder) to ask for an Editfields, a Toggles etc. model. |
|
1047 |
Here, first the local bindings are searched, then the application and |
|
1048 |
finally the applications class is asked for a corresponding action. |
|
1049 |
The returned object is typically a valueHolder." |
|
1050 |
||
434 | 1051 |
|b| |
1052 |
||
1053 |
bindings notNil ifTrue:[ |
|
1054 |
b := bindings at:aKey ifAbsent:nil. |
|
1055 |
b notNil ifTrue:[^ b]. |
|
1056 |
]. |
|
1057 |
||
2499 | 1058 |
^ self |
1059 |
safelyPerform:#aspectFor: |
|
1060 |
with:aKey |
|
1061 |
ifNone:[ self aspectAt:aKey ] |
|
374 | 1062 |
! |
1063 |
||
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1064 |
aspectFor:aKey ifAbsent:exceptionBlock |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1065 |
"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
|
1066 |
(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
|
1067 |
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
|
1068 |
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
|
1069 |
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
|
1070 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1071 |
|b| |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1072 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1073 |
bindings notNil ifTrue:[ |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1074 |
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
|
1075 |
b notNil ifTrue:[^ b]. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1076 |
]. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1077 |
|
2499 | 1078 |
^ self |
1079 |
safelyPerform:#aspectFor: |
|
1080 |
with:aKey |
|
1081 |
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
|
1082 |
! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
1083 |
|
423 | 1084 |
componentFor:aKey |
450 | 1085 |
"return a component for aKey. This is invoked during window building |
1086 |
(by the builder) to ask for an ArbitraryComponents view. |
|
1087 |
Here, first the local bindings are searched, then the application and |
|
1088 |
finally the applications class is asked for a corresponding action. |
|
1089 |
The returned object is typically a view." |
|
1090 |
||
848 | 1091 |
^ self safelyPerform:#componentFor: |
1092 |
with:aKey |
|
1093 |
ifNone:[ self aspectAt:aKey ] |
|
423 | 1094 |
! |
1095 |
||
422 | 1096 |
labelFor:aKey |
450 | 1097 |
"return a label for aKey. This is invoked during window building |
1098 |
(by the builder) to ask for a ???'s label. |
|
1099 |
Here, first the local bindings are searched, then the application and |
|
1100 |
finally the applications class is asked for a corresponding action. |
|
1101 |
The returned object is typically a string." |
|
1102 |
||
848 | 1103 |
^ self safelyPerform:#labelFor: |
1104 |
with:aKey |
|
1105 |
ifNone:[ self aspectAt:aKey ] |
|
422 | 1106 |
! |
1107 |
||
1108 |
listFor:aKey |
|
450 | 1109 |
"return a list for aKey. This is invoked during window building |
1110 |
(by the builder) to ask for a ???'s label. |
|
1111 |
Here, first the local bindings are searched, then the application and |
|
1112 |
finally the applications class is asked for a corresponding action. |
|
1113 |
The returned object is typically a list." |
|
1114 |
||
848 | 1115 |
^ self safelyPerform:#listFor: |
1116 |
with:aKey |
|
1117 |
ifNone:[ self aspectAt:aKey ] |
|
1118 |
! |
|
1119 |
||
1120 |
menuFor:aKey |
|
1121 |
"Find a binding for the menu named aKey, either in the bindings |
|
1122 |
or from the source" |
|
1123 |
||
1124 |
|menu| |
|
1125 |
||
961 | 1126 |
aKey isNil ifTrue:[^ nil]. |
1127 |
||
848 | 1128 |
(menu := self bindingAt:aKey) notNil ifTrue:[ |
1129 |
^ menu |
|
1130 |
]. |
|
1131 |
||
1132 |
menu := self safelyPerform:#menuFor: with:aKey ifNone:[ |
|
1133 |
self safelyPerform:aKey ifNone:[ |
|
1134 |
self aspectNotFound:aKey error:'no menu for:'. |
|
1135 |
nil |
|
1136 |
] |
|
1137 |
]. |
|
1138 |
||
862 | 1139 |
menu isBlock ifFalse:[ |
1140 |
((menu := menu value) notNil and:[application notNil]) ifTrue:[ |
|
2291 | 1141 |
menu isCollection ifTrue:[ |
1142 |
menu := Menu decodeFromLiteralArray:menu. |
|
1533
b6b2f8ab4e4a
findGuiResources... now sets the receiver, if not yet set
Claus Gittinger <cg@exept.de>
parents:
1520
diff
changeset
|
1143 |
"/ 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
|
1144 |
]. |
4680e2fe4728
must care for resource-label translation of a menu
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
1145 |
menu findGuiResourcesIn:application |
450 | 1146 |
] |
422 | 1147 |
]. |
848 | 1148 |
^ menu |
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
1149 |
|
2291 | 1150 |
"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
|
1151 |
! |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1152 |
|
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1153 |
specificationFor:aKey |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1154 |
"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
|
1155 |
(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
|
1156 |
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
|
1157 |
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
|
1158 |
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
|
1159 |
|
1585 | 1160 |
^ self |
1161 |
safelyPerform:#specificationFor: |
|
1162 |
with:aKey |
|
1163 |
ifNone:[ self aspectFor:aKey ] |
|
422 | 1164 |
! ! |
1165 |
||
1166 |
!WindowBuilder methodsFor:'spec creation callbacks'! |
|
1167 |
||
735 | 1168 |
createdComponent:aView forSpec:spec named:name |
1169 |
"callback from the UISpec after a view has been |
|
1170 |
created for a spec. |
|
1171 |
If it has a name, add it to the namedComponents dictionary; |
|
1172 |
if I have a creationHook (application callBack), evaluate it." |
|
1173 |
||
2369 | 1174 |
|createCallBackSelector app| |
1175 |
||
735 | 1176 |
name notNil ifTrue:[ |
1993 | 1177 |
"/ "/ debugging ... |
1178 |
"/ (namedComponents notNil and:[namedComponents includesKey:name asSymbol]) ifTrue:[ |
|
1179 |
"/ Transcript showCR:'WARNING multiple UI-build of: ',name asSymbol |
|
1180 |
"/ ]. |
|
1992 | 1181 |
self componentAt:name put:aView. |
735 | 1182 |
]. |
2462 | 1183 |
spec addView:aView toMappingOfBuilder:self. |
410 | 1184 |
componentCreationHook notNil ifTrue:[ |
1185 |
componentCreationHook value:aView value:spec value:self |
|
2369 | 1186 |
]. |
1187 |
||
1188 |
self isEditing ifFalse:[ |
|
1189 |
(createCallBackSelector := spec postBuildCallback) notNil ifTrue:[ |
|
1190 |
app := self application. |
|
1191 |
app |
|
1192 |
perform:createCallBackSelector |
|
1193 |
withOptionalArgument:aView |
|
1194 |
and:spec |
|
1195 |
and:self. |
|
1196 |
]. |
|
1197 |
]. |
|
100 | 1198 |
|
735 | 1199 |
"Modified: / 5.9.1995 / 21:42:54 / claus" |
1200 |
"Created: / 31.10.1997 / 18:47:01 / cg" |
|
1201 |
"Modified: / 31.10.1997 / 18:51:22 / cg" |
|
100 | 1202 |
! ! |
1203 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1204 |
!WindowBuilder methodsFor:'startup'! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1205 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1206 |
closeRequest |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1207 |
window destroy |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1208 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1209 |
"Modified: 17.1.1997 / 19:30:32 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1210 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1211 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1212 |
open |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1213 |
"open my topView, as previously created" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1214 |
|
477 | 1215 |
|type| |
1216 |
||
1217 |
application isNil ifTrue:[ |
|
1218 |
type := #normal |
|
1219 |
] ifFalse:[ |
|
1220 |
type := application defaultWindowType |
|
1221 |
]. |
|
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1222 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1223 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1224 |
withExtent:nil |
477 | 1225 |
andType:type |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1226 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1227 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1228 |
|
428 | 1229 |
openAt:aPoint |
1230 |
"open my topView at some location" |
|
1231 |
||
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1232 |
^ self |
467 | 1233 |
openAt:aPoint |
1234 |
withExtent:nil |
|
428 | 1235 |
andType:(application defaultWindowType) |
1236 |
||
1237 |
"Created: 14.2.1997 / 20:21:57 / cg" |
|
467 | 1238 |
"Modified: 28.2.1997 / 22:50:29 / cg" |
428 | 1239 |
! |
1240 |
||
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1241 |
openDialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1242 |
"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
|
1243 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1244 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1245 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1246 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1247 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1248 |
andType:#dialog |
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 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1251 |
openDialogAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1252 |
"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
|
1253 |
blocking interaction to the currently active view." |
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 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1256 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1257 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1258 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1259 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1260 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1261 |
"Created: 14.2.1997 / 20:24:19 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1262 |
! |
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 |
openDialogAt:aPoint withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1265 |
"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
|
1266 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1267 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1268 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1269 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1270 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1271 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1272 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1273 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1274 |
"Created: 14.2.1997 / 20:24:19 / cg" |
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 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1277 |
openDialogWithExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1278 |
"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
|
1279 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1280 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1281 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1282 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1283 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1284 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1285 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1286 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
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 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1289 |
openModal |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1290 |
"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
|
1291 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1292 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1293 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1294 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1295 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1296 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1297 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1298 |
"Modified: 3.3.1997 / 19:43:57 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1299 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1300 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1301 |
openPopUpAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1302 |
"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
|
1303 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1304 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1305 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1306 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1307 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1308 |
andType:#popUp |
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 |
"Modified: 17.1.1997 / 19:59:29 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1311 |
"Created: 14.2.1997 / 20:24:38 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1312 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1313 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1314 |
openPopUpIn:aRectangle |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1315 |
"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
|
1316 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1317 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1318 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1319 |
openAt:aRectangle origin |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1320 |
withExtent:aRectangle extent |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1321 |
andType:#popUp |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1322 |
! |
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 |
openWindow |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1325 |
"open my topView" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1326 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1327 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1328 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1329 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1330 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1331 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1332 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1333 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1334 |
openWindowAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1335 |
"open my topView at some location" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1336 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1337 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1338 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1339 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1340 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1341 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1342 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1343 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1344 |
openWindowAt:origin withExtent:ext andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1345 |
"open my window, as previously created, optionally defining the |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1346 |
windows origin and/or extent. |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1347 |
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
|
1348 |
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
|
1349 |
active view, or as a normal view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1350 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1351 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1352 |
openAt:origin |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1353 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1354 |
andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1355 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1356 |
|
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1357 |
openWindowCenter |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1358 |
"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
|
1359 |
|
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1360 |
^ self |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1361 |
openAt:#center |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1362 |
withExtent:nil |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1363 |
andType:(application defaultWindowType) |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1364 |
|
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1365 |
! |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1366 |
|
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1367 |
openWithExtent:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1368 |
"open my topView, as previously created, but override |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1369 |
the extent." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1370 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1371 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1372 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1373 |
withExtent:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1374 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1375 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1376 |
"Modified: 17.1.1997 / 19:58:48 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1377 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1378 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1379 |
openWithExtent:ext andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1380 |
"open my window, as previously created. The type argument |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1381 |
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
|
1382 |
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
|
1383 |
active view, or as a normal view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1384 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1385 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1386 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1387 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1388 |
andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1389 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1390 |
"Modified: 14.2.1997 / 20:22:47 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1391 |
! ! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1392 |
|
1766 | 1393 |
!WindowBuilder methodsFor:'startup-basic'! |
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1394 |
|
436 | 1395 |
openAt:origin withExtent:ext andType:type |
428 | 1396 |
"open my window, as previously created, optionally defining the |
1397 |
windows origin and/or extent. |
|
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1398 |
The type argument may be #dialog, #popup or #normal, |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1399 |
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
|
1400 |
modal view (blocking interaction to the currently active view), |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1401 |
as popUp (also blocking) |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1402 |
or as a normal view." |
428 | 1403 |
|
1774
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1404 |
|appWinClass device wg mainWin| |
1359
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1405 |
|
1672 | 1406 |
device := window device. |
428 | 1407 |
origin notNil ifTrue:[ |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1408 |
"/ kludge |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1409 |
origin ~~ #center ifTrue:[ |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1410 |
window origin:origin |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1411 |
] |
428 | 1412 |
]. |
1413 |
ext notNil ifTrue:[ |
|
480 | 1414 |
window extent:ext. |
1415 |
] ifFalse:[ |
|
2015 | 1416 |
((type == #dialog) or:[type == #toolDialog]) ifTrue:[ |
480 | 1417 |
window fixSize |
1418 |
] |
|
1419 |
]. |
|
1420 |
||
2015 | 1421 |
((type == #dialog) or:[type == #toolDialog]) ifTrue:[ |
1520 | 1422 |
((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
|
1423 |
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
|
1424 |
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
|
1425 |
] ifFalse:[ |
1774
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1426 |
wg := WindowGroup activeGroup. |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1427 |
wg notNil ifTrue:[ |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1428 |
wg := wg mainGroup. |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1429 |
mainWin := wg topViews firstIfEmpty:nil. |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1430 |
]. |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1431 |
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
|
1432 |
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
|
1433 |
] ifFalse:[ |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1434 |
window fixPosition:(device pointerPosition - window positionOffset). |
28b516fbd3e9
open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents:
1766
diff
changeset
|
1435 |
] |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1436 |
]. |
2434
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1437 |
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
|
1438 |
(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
|
1439 |
window origin:(window origin x |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1440 |
@ |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1441 |
(window device usableHeight - window height)) |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1442 |
] ifFalse:[ |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1443 |
window origin:(window origin x |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1444 |
@ |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1445 |
0) |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1446 |
]. |
0c0eda5cf24b
usableheight vs. height of screen for multiscreen systems
Claus Gittinger <cg@exept.de>
parents:
2403
diff
changeset
|
1447 |
]. |
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1448 |
^ window openModal. |
428 | 1449 |
]. |
1450 |
||
1634 | 1451 |
(type == #normal or:[type = #slave or:[type = #partner]]) ifTrue:[ |
480 | 1452 |
window isNil ifTrue:[ |
1359
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1453 |
application notNil ifTrue:[ |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1454 |
appWinClass := application applicationWindowClass |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1455 |
] ifFalse:[ |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1456 |
appWinClass := ApplicationWindow |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1457 |
]. |
1879
0c9ba6cc5a9a
Keep the title bar of a modal window in the visible area
Stefan Vogel <sv@exept.de>
parents:
1825
diff
changeset
|
1458 |
self setupWindowFor:appWinClass new. |
480 | 1459 |
]. |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1460 |
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
|
1461 |
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
|
1462 |
]. |
480 | 1463 |
|
1634 | 1464 |
"/ the following code creates a master-slave relationship, if |
1465 |
"/ the masterApplication is not nil. |
|
1466 |
"/ Disabled, because: the masterApplication is used to fulfill missing aspects, |
|
1467 |
"/ which has nothing to do with a window master-slave relationship. |
|
1468 |
||
1469 |
"/ application masterApplication notNil ifTrue:[ |
|
1470 |
"/ masterWindow := application masterApplication window. |
|
1471 |
"/ (masterWindow isMaster or:[masterWindow isSlave or:[masterWindow isPartner]]) |
|
1472 |
"/ ifFalse:[ |
|
1473 |
"/ "/ master is neutral - make him a master |
|
1474 |
"/ masterWindow beMaster |
|
1475 |
"/ ]. |
|
1476 |
"/ window beSlave. |
|
1477 |
"/ ]. |
|
1478 |
||
1722 | 1479 |
"/ must be done explicit, by passing an appropriate windowType |
1480 |
||
1634 | 1481 |
type = #slave ifTrue:[ |
1482 |
window beSlave. |
|
1483 |
]. |
|
1484 |
type = #partner ifTrue:[ |
|
1485 |
window bePartner. |
|
1486 |
]. |
|
1722 | 1487 |
|
1725
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1488 |
((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
|
1489 |
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
|
1490 |
ifTrue:[ |
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1491 |
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
|
1492 |
] ifFalse:[ |
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1493 |
window open. |
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1494 |
]. |
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1495 |
|
a9945722dab2
openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents:
1723
diff
changeset
|
1496 |
"/ the following automatism is probably too cryptic and has too much of a side effect. |
1722 | 1497 |
"/ I prefer to leave things as they are: i.e. enforce the programmer to |
1498 |
"/ do thinks explicit. |
|
1499 |
||
1500 |
"/ type = #slave ifTrue:[ |
|
1501 |
"/ window windowGroup topViews first beMaster |
|
1502 |
"/ ]. |
|
428 | 1503 |
^ self |
1504 |
]. |
|
1505 |
||
1506 |
type == #popUp ifTrue:[ |
|
1672 | 1507 |
window fixPosition:(device pointerPosition). |
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1508 |
^ window openAsPopUp. |
428 | 1509 |
]. |
1510 |
||
1511 |
" |
|
1512 |
if ST-80 supports more types - these may be added later |
|
1513 |
" |
|
1825 | 1514 |
self shouldImplement |
428 | 1515 |
|
735 | 1516 |
"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
|
1517 |
"Modified: / 18.6.1998 / 19:10:07 / cg" |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1518 |
! ! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1519 |
|
2529
c22b95752b7b
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2499
diff
changeset
|
1520 |
!WindowBuilder methodsFor:'translating'! |
c22b95752b7b
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2499
diff
changeset
|
1521 |
|
c22b95752b7b
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2499
diff
changeset
|
1522 |
translateString:aString |
c22b95752b7b
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2499
diff
changeset
|
1523 |
"translate aString to the current language. |
c22b95752b7b
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2499
diff
changeset
|
1524 |
If there is an application, it knows best what to do" |
c22b95752b7b
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2499
diff
changeset
|
1525 |
|
c22b95752b7b
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2499
diff
changeset
|
1526 |
application isNil ifTrue:[ |
c22b95752b7b
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2499
diff
changeset
|
1527 |
^ self resources string:aString |
c22b95752b7b
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2499
diff
changeset
|
1528 |
]. |
2608 | 1529 |
^ application translateString:aString |
2529
c22b95752b7b
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2499
diff
changeset
|
1530 |
! ! |
c22b95752b7b
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2499
diff
changeset
|
1531 |
|
132 | 1532 |
!WindowBuilder class methodsFor:'documentation'! |
1533 |
||
1534 |
version |
|
2610 | 1535 |
^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.138 2009-03-06 15:09:34 cg Exp $' |
132 | 1536 |
! ! |