author | Stefan Vogel <sv@exept.de> |
Wed, 05 Feb 2020 13:55:32 +0100 | |
changeset 8985 | b4d006b79f84 |
parent 8917 | 5942dc35f0e4 |
permissions | -rw-r--r-- |
0 | 1 |
" |
6 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
72 | 3 |
All Rights Reserved |
0 | 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 |
" |
|
3204
ed184af034d3
Remove dependents on various channels when destroying.
Stefan Vogel <sv@exept.de>
parents:
3170
diff
changeset
|
12 |
"{ Package: 'stx:libview' }" |
ed184af034d3
Remove dependents on various channels when destroying.
Stefan Vogel <sv@exept.de>
parents:
3170
diff
changeset
|
13 |
|
6722 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
135 | 16 |
SimpleView subclass:#View |
2548 | 17 |
instanceVariableNames:'model aspectMsg changeMsg menuMsg menuHolder menuPerformer |
3365
a76614b953c7
lifted visibilityChannel stuff to superclass
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
18 |
enableChannel foregroundChannel backgroundChannel' |
616 | 19 |
classVariableNames:'' |
20 |
poolDictionaries:'' |
|
21 |
category:'Views-Basic' |
|
0 | 22 |
! |
23 |
||
2 | 24 |
!View class methodsFor:'documentation'! |
41 | 25 |
|
46 | 26 |
copyright |
27 |
" |
|
28 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
72 | 29 |
All Rights Reserved |
46 | 30 |
|
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! |
|
39 |
||
41 | 40 |
documentation |
2 | 41 |
" |
135 | 42 |
this class adds provisions for views which show or work on a model. |
43 |
This functionality used to be in View, but has been extracted into SimpleView and |
|
44 |
this new View class, to take some of the stuff out of views which do not need |
|
45 |
this functionality (i.e. all views which do only geometry management). |
|
82 | 46 |
Instances of View are seldom used, most views in the system inherit |
47 |
from this class. |
|
41 | 48 |
|
616 | 49 |
[Instance variables:] |
50 |
model <nil | any> the model (if any) |
|
41 | 51 |
|
616 | 52 |
aspectMsg <nil | Symbol> the aspect; typically |
53 |
dependentViews react on changes |
|
54 |
of this aspect and update their contents. |
|
55 |
||
56 |
changeMsg <nil | Symbol> the changeMessage; typically |
|
57 |
dependentViews send this message to |
|
58 |
the model to tell it about changes. |
|
140 | 59 |
|
616 | 60 |
menuMsg <nil | Symbol> the menuMessage; typically |
61 |
dependentViews send this message to |
|
62 |
the model to ask for a popup menu. |
|
1151
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
63 |
|
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
64 |
|
1152
21c666e130dd
menuHolder/menuPerformer stuff.
Stefan Vogel <sv@exept.de>
parents:
1151
diff
changeset
|
65 |
menuHolder <any> who has a menu |
21c666e130dd
menuHolder/menuPerformer stuff.
Stefan Vogel <sv@exept.de>
parents:
1151
diff
changeset
|
66 |
(default: nil i.e. model has menu) |
21c666e130dd
menuHolder/menuPerformer stuff.
Stefan Vogel <sv@exept.de>
parents:
1151
diff
changeset
|
67 |
|
21c666e130dd
menuHolder/menuPerformer stuff.
Stefan Vogel <sv@exept.de>
parents:
1151
diff
changeset
|
68 |
menuPerformer <any> who performs menu actions |
21c666e130dd
menuHolder/menuPerformer stuff.
Stefan Vogel <sv@exept.de>
parents:
1151
diff
changeset
|
69 |
(default: nil i.e. model has menu) |
616 | 70 |
|
71 |
[see also:] |
|
621 | 72 |
StandardSystemView TopView DialogBox |
616 | 73 |
WindowGroup |
621 | 74 |
Model ValueHolder |
616 | 75 |
( introduction to view programming :html: programming/viewintro.html ) |
76 |
||
140 | 77 |
|
616 | 78 |
[author:] |
79 |
Claus Gittinger |
|
80 |
" |
|
81 |
! |
|
82 |
||
83 |
examples |
|
84 |
" |
|
85 |
a subView in a topView: |
|
621 | 86 |
[exBegin] |
616 | 87 |
|top v| |
140 | 88 |
|
2134 | 89 |
top := StandardSystemView new. |
616 | 90 |
v := View new. |
91 |
v origin:0.25 @ 0.25 corner:0.75 @ 0.75. |
|
92 |
top addSubView:v. |
|
93 |
top open |
|
621 | 94 |
[exEnd] |
616 | 95 |
|
96 |
||
97 |
the same, a bit more compact: |
|
621 | 98 |
[exBegin] |
616 | 99 |
|top v| |
100 |
||
2134 | 101 |
top := StandardSystemView new. |
102 |
v := View origin:0.25 @ 0.25 corner:0.75 @ 0.75 in:top. |
|
103 |
top open |
|
104 |
[exEnd] |
|
105 |
||
106 |
menuHolder |
|
107 |
[exBegin] |
|
108 |
|top mh| |
|
109 |
||
110 |
mh := (PopUpMenu itemList:#( ('foo' foo) (#'bar' bar)) resources:nil) asValue. |
|
111 |
||
112 |
top := StandardSystemView extent:200@200. |
|
113 |
top menuHolder:mh. |
|
114 |
top open |
|
115 |
[exEnd] |
|
116 |
||
117 |
||
118 |
menuHolder |
|
119 |
[exBegin] |
|
120 |
|top mh| |
|
121 |
||
122 |
mh := (PopUpMenu itemList:#( ('foo' foo) (#'bar' bar)) resources:nil) asValue. |
|
123 |
[ |
|
124 |
Delay waitForSeconds:5. |
|
125 |
mh value: (PopUpMenu itemList:#( ('waboo' foo) (#'baz' bar)) resources:nil) |
|
126 |
] fork. |
|
127 |
||
128 |
top := StandardSystemView extent:200@200. |
|
129 |
top menuHolder:mh. |
|
616 | 130 |
top open |
621 | 131 |
[exEnd] |
132 |
||
2 | 133 |
" |
134 |
! ! |
|
0 | 135 |
|
118 | 136 |
!View class methodsFor:'instance creation'! |
137 |
||
140 | 138 |
on:aModel aspect:aspectMsg |
139 |
"st-80 style view creation: create a new view, set its model |
|
140 |
and selectors for aspect" |
|
141 |
||
142 |
^ self new |
|
143 |
on:aModel |
|
144 |
aspect:aspectMsg |
|
145 |
! |
|
146 |
||
147 |
on:aModel aspect:aspectMsg change:changeMsg |
|
148 |
"st-80 style view creation: create a new view, set its model |
|
149 |
and selectors for aspect and change" |
|
150 |
||
151 |
^ self new |
|
152 |
on:aModel |
|
153 |
aspect:aspectMsg |
|
154 |
change:changeMsg |
|
155 |
! |
|
156 |
||
135 | 157 |
on:aModel aspect:aspectMsg change:changeMsg menu:menuMsg |
118 | 158 |
"st-80 style view creation: create a new view, set its model |
140 | 159 |
and selectors for aspect, change and menu" |
118 | 160 |
|
135 | 161 |
^ self new |
162 |
on:aModel |
|
163 |
aspect:aspectMsg |
|
164 |
change:changeMsg |
|
165 |
menu:menuMsg |
|
118 | 166 |
! |
167 |
||
269 | 168 |
on:aModel aspect:aspectMsg menu:menuMsg |
169 |
"st-80 style view creation: create a new view, set its model |
|
170 |
and selectors for aspect and menu" |
|
118 | 171 |
|
269 | 172 |
^ self new |
173 |
on:aModel |
|
174 |
aspect:aspectMsg |
|
175 |
menu:menuMsg |
|
118 | 176 |
! ! |
177 |
||
123 | 178 |
!View class methodsFor:'defaults'! |
179 |
||
140 | 180 |
defaultAspectMessage |
135 | 181 |
"subclasses which by default do NOT want to be informed about changed |
182 |
models should redefine this to return nil" |
|
118 | 183 |
|
135 | 184 |
^ #value |
0 | 185 |
! |
186 |
||
140 | 187 |
defaultChangeMessage |
135 | 188 |
"subclasses which by default do NOT want to inform the model |
189 |
should redefine this to return nil" |
|
0 | 190 |
|
135 | 191 |
^ #value: |
1151
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
192 |
! |
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
193 |
|
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
194 |
defaultMenuMessage |
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
195 |
"subclasses which by default do NOT want to send menu messages |
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
196 |
should return nil" |
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
197 |
|
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
198 |
^ nil |
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
199 |
|
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
200 |
"Created: 3.1.1997 / 01:50:36 / stefan" |
0 | 201 |
! ! |
202 |
||
3355
2ec13d9b93ca
in allViewBackground: do not change the bg, if I have a bg-channel
Claus Gittinger <cg@exept.de>
parents:
3204
diff
changeset
|
203 |
!View methodsFor:'accessing-bg & border'! |
2ec13d9b93ca
in allViewBackground: do not change the bg, if I have a bg-channel
Claus Gittinger <cg@exept.de>
parents:
3204
diff
changeset
|
204 |
|
4957 | 205 |
allViewBackground:something if:condition |
3355
2ec13d9b93ca
in allViewBackground: do not change the bg, if I have a bg-channel
Claus Gittinger <cg@exept.de>
parents:
3204
diff
changeset
|
206 |
"set the viewBackground to something, a color, image or form, |
2ec13d9b93ca
in allViewBackground: do not change the bg, if I have a bg-channel
Claus Gittinger <cg@exept.de>
parents:
3204
diff
changeset
|
207 |
in myself and recursively in all of my subviews. |
6605 | 208 |
However, if I have a backgroundChannel, don't change my own bg." |
3355
2ec13d9b93ca
in allViewBackground: do not change the bg, if I have a bg-channel
Claus Gittinger <cg@exept.de>
parents:
3204
diff
changeset
|
209 |
|
2ec13d9b93ca
in allViewBackground: do not change the bg, if I have a bg-channel
Claus Gittinger <cg@exept.de>
parents:
3204
diff
changeset
|
210 |
backgroundChannel isNil ifTrue:[ |
4957 | 211 |
^ super allViewBackground:something if:condition |
3355
2ec13d9b93ca
in allViewBackground: do not change the bg, if I have a bg-channel
Claus Gittinger <cg@exept.de>
parents:
3204
diff
changeset
|
212 |
]. |
2ec13d9b93ca
in allViewBackground: do not change the bg, if I have a bg-channel
Claus Gittinger <cg@exept.de>
parents:
3204
diff
changeset
|
213 |
|
4957 | 214 |
self allSubViewsBackground:something if:condition |
3355
2ec13d9b93ca
in allViewBackground: do not change the bg, if I have a bg-channel
Claus Gittinger <cg@exept.de>
parents:
3204
diff
changeset
|
215 |
! ! |
2ec13d9b93ca
in allViewBackground: do not change the bg, if I have a bg-channel
Claus Gittinger <cg@exept.de>
parents:
3204
diff
changeset
|
216 |
|
170 | 217 |
!View methodsFor:'accessing-channels'! |
218 |
||
2548 | 219 |
backgroundChannel |
220 |
"return a valueHolder for background color" |
|
221 |
||
222 |
^ backgroundChannel |
|
223 |
||
224 |
"Modified: / 30.3.1999 / 13:49:28 / stefan" |
|
225 |
"Created: / 30.3.1999 / 13:50:55 / stefan" |
|
226 |
! |
|
227 |
||
228 |
backgroundChannel:aValueHolder |
|
4985 | 229 |
"set the backgroundChannel - a valueHolder holding a color" |
2548 | 230 |
|
231 |
|prev| |
|
232 |
||
233 |
prev := backgroundChannel. |
|
234 |
backgroundChannel := aValueHolder. |
|
4926 | 235 |
self setupChannel:aValueHolder for:#backgroundColorChanged withOld:prev |
2548 | 236 |
|
237 |
"Modified: / 31.10.1997 / 14:38:38 / cg" |
|
238 |
"Created: / 30.3.1999 / 13:48:42 / stefan" |
|
239 |
! |
|
240 |
||
241 |
enableChannel |
|
242 |
"return a valueHolder for enable/disable" |
|
243 |
||
244 |
^ enableChannel |
|
245 |
||
246 |
"Created: / 30.3.1999 / 13:46:43 / stefan" |
|
247 |
! |
|
248 |
||
249 |
enableChannel:aValueHolder |
|
250 |
"set the valueHolder, which holds the enable boolean value" |
|
251 |
||
252 |
|prev| |
|
253 |
||
254 |
prev := enableChannel. |
|
255 |
enableChannel := aValueHolder. |
|
2950
705ddb097eec
Fix visibilityChannel and enableChannel stuff
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
256 |
self setupChannel:aValueHolder for:#enableStateChanged withOld:prev |
2548 | 257 |
|
258 |
"Modified: / 14.11.1997 / 13:52:44 / cg" |
|
259 |
"Modified: / 30.3.1999 / 13:50:15 / stefan" |
|
260 |
! |
|
261 |
||
262 |
foregroundChannel |
|
263 |
"return a valueHolder for foreground color" |
|
264 |
||
265 |
^ foregroundChannel |
|
266 |
||
267 |
"Modified: / 30.3.1999 / 13:49:28 / stefan" |
|
268 |
! |
|
269 |
||
270 |
foregroundChannel:aValueHolder |
|
271 |
"set the foregroundChannel - a valueHolder holding a color" |
|
272 |
||
273 |
|prev| |
|
274 |
||
275 |
prev := foregroundChannel. |
|
276 |
foregroundChannel := aValueHolder. |
|
4926 | 277 |
self setupChannel:aValueHolder for:#foregroundColorChanged withOld:prev |
2548 | 278 |
|
279 |
"Modified: / 31.10.1997 / 14:38:38 / cg" |
|
280 |
"Modified: / 30.3.1999 / 13:50:08 / stefan" |
|
170 | 281 |
! ! |
282 |
||
269 | 283 |
!View methodsFor:'accessing-menus'! |
284 |
||
8671 | 285 |
defaultMenuPerformer |
286 |
"the stuff below tries to make for a reasonable |
|
287 |
default, in case the menuPerformer was NOT set explicitely |
|
288 |
(you should not depend on this in your application)" |
|
289 |
||
290 |
(model isNil |
|
291 |
or:[model isValueModel |
|
292 |
or:[model isBlock |
|
293 |
or:[model isString]]] |
|
294 |
) ifTrue:[ |
|
295 |
"/ a simple holder-model. Do not send menuMessages to it |
|
296 |
^ self application ? self |
|
297 |
]. |
|
298 |
^ model |
|
299 |
||
300 |
"Created: / 03-04-2019 / 09:42:37 / Claus Gittinger" |
|
301 |
! |
|
302 |
||
269 | 303 |
menuHolder |
304 |
"who has the menu ? |
|
1147
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
305 |
If no explicit menuHolder was defined, its the model if I have one. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
306 |
Otherwise, its the menuHolder (if nonNil) or mySelf. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
307 |
The menuHolder is supposed to return a popUpMenu when asked via the |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
308 |
menuMessage." |
269 | 309 |
|
1147
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
310 |
menuHolder notNil ifTrue:[^ menuHolder]. |
269 | 311 |
model notNil ifTrue:[^ model]. |
312 |
^ self |
|
1147
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
313 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
314 |
"Modified: 23.12.1996 / 13:56:55 / cg" |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
315 |
! |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
316 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
317 |
menuHolder:anObject |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
318 |
"change the one that provides the menu (via menuMsg)." |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
319 |
|
2134 | 320 |
menuHolder := anObject. |
321 |
menuMsg isNil ifTrue:[menuMsg := #value]. |
|
1147
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
322 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
323 |
"Created: 23.12.1996 / 13:54:33 / cg" |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
324 |
! |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
325 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
326 |
menuMessage |
7408 | 327 |
"Return the symbol sent to the model to acquire the menu" |
1147
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
328 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
329 |
^ menuMsg |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
330 |
! |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
331 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
332 |
menuMessage:aSymbol |
8150 | 333 |
"ST-80 style menus: If a view's menuSymbol is nonNil, it |
1147
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
334 |
will send it to its model when the middleButton is pressed. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
335 |
That method should return nil or the menu to be shown. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
336 |
This is useful for very dynamic menus, where it does not |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
337 |
make sense to define an initial menu. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
338 |
This is the same as #menu: which was added for ST-80 compatibility." |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
339 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
340 |
menuMsg := aSymbol |
8150 | 341 |
|
342 |
"Modified (comment): / 31-08-2017 / 20:18:40 / cg" |
|
269 | 343 |
! |
344 |
||
345 |
menuPerformer |
|
8046 | 346 |
"who should perform the menu actions? |
347 |
If no menuPerformer was defined, it is the model if I have one. |
|
348 |
Otherwise it is the menuPerformer (if nonNil), or myself. |
|
349 |
The menuPerformer gets messages from the menu" |
|
269 | 350 |
|
1147
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
351 |
menuPerformer notNil ifTrue:[^ menuPerformer]. |
8671 | 352 |
^ self defaultMenuPerformer |
8046 | 353 |
|
354 |
"Modified (format): / 29-06-2017 / 12:08:58 / mawalch" |
|
8671 | 355 |
"Modified: / 03-04-2019 / 09:43:34 / Claus Gittinger" |
1147
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
356 |
! |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
357 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
358 |
menuPerformer:anObject |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
359 |
"change the one that does the menu actions. |
8671 | 360 |
See the comment in SimpleView>>activateMenu on who gets the menu's |
1147
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
361 |
message." |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
362 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
363 |
menuPerformer := anObject |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
364 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
365 |
" |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
366 |
|top textV plug| |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
367 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
368 |
plug := Plug new. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
369 |
plug respondTo:#textMenu |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
370 |
with:[ |m| |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
371 |
m := PopUpMenu |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
372 |
labels:#('copy' 'foo' '-' 'others') |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
373 |
selectors:#(copySelection foo nil others). |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
374 |
m subMenuAt:#others |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
375 |
put:(PopUpMenu |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
376 |
labels:#('bar' 'goto') |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
377 |
selectors:#(bar gotoLine)) |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
378 |
]. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
379 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
380 |
top := StandardSystemView new. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
381 |
top extent:300@300. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
382 |
|
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
383 |
textV := TextView origin:0.0@0.0 corner:1.0@1.0 in:top. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
384 |
textV menuHolder:plug; menuMessage:#textMenu; menuPerformer:plug. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
385 |
textV contents:'hello world'. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
386 |
top open. |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
387 |
" |
83ed804938e7
moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1146
diff
changeset
|
388 |
|
8671 | 389 |
"Created: / 23-12-1996 / 13:57:28 / cg" |
390 |
"Modified (comment): / 03-04-2019 / 08:54:30 / Claus Gittinger" |
|
2166
d6e05def4f83
added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
2134
diff
changeset
|
391 |
! |
d6e05def4f83
added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
2134
diff
changeset
|
392 |
|
d6e05def4f83
added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
2134
diff
changeset
|
393 |
performer:anObject |
d6e05def4f83
added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
2134
diff
changeset
|
394 |
"same as #menuPerformer - ST80 compatibility" |
d6e05def4f83
added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
2134
diff
changeset
|
395 |
|
d6e05def4f83
added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
2134
diff
changeset
|
396 |
self menuPerformer:anObject |
d6e05def4f83
added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
2134
diff
changeset
|
397 |
|
d6e05def4f83
added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
2134
diff
changeset
|
398 |
"Created: / 6.7.1998 / 13:38:32 / cg" |
269 | 399 |
! ! |
400 |
||
118 | 401 |
!View methodsFor:'accessing-mvc'! |
402 |
||
269 | 403 |
addModelInterfaceTo:aDictionary |
404 |
"this adds entries for all messages sent to my model |
|
405 |
to aDictionary" |
|
406 |
||
407 |
aDictionary at:#aspectMessage put:aspectMsg. |
|
408 |
aDictionary at:#changeMessage put:changeMsg. |
|
409 |
aDictionary at:#menuMessage put:menuMsg. |
|
410 |
||
411 |
" |
|
412 |
Button new modelInterface |
|
413 |
" |
|
414 |
! |
|
135 | 415 |
|
269 | 416 |
aspect |
417 |
"Return the aspect used with changes from/to the model" |
|
418 |
||
419 |
^ aspectMsg |
|
420 |
! |
|
421 |
||
422 |
aspectMessage |
|
423 |
"Return the aspect used with changes from/to the model" |
|
424 |
||
425 |
^ aspectMsg |
|
426 |
! |
|
427 |
||
428 |
aspectMessage:aspectSymbol |
|
8150 | 429 |
"ST-80 style updating: If a view's aspectSymbol is nonNil, |
269 | 430 |
it will respond to changes of this aspect from the model." |
431 |
||
432 |
aspectMsg := aspectSymbol |
|
8150 | 433 |
|
434 |
"Modified (comment): / 31-08-2017 / 20:18:12 / cg" |
|
135 | 435 |
! |
436 |
||
269 | 437 |
change:changeSymbol |
8150 | 438 |
"ST-80 style change notification: If a view's changeSymbol is nonNil, |
269 | 439 |
it will send it to its model when something changes. |
440 |
Alias for changeMessage: for ST-80 compatibility." |
|
441 |
||
442 |
self changeMessage:changeSymbol |
|
8150 | 443 |
|
444 |
"Modified (comment): / 31-08-2017 / 20:18:15 / cg" |
|
269 | 445 |
! |
446 |
||
447 |
changeMessage |
|
448 |
"Return the symbol sent to the model if nonNil when something changes." |
|
135 | 449 |
|
269 | 450 |
^ changeMsg |
451 |
! |
|
452 |
||
453 |
changeMessage:aSymbol |
|
8150 | 454 |
"ST-80 style change notification: If a view's changeSymbol is nonNil, |
269 | 455 |
it will send it to its model when something changes. |
456 |
This is the same as change: which was added for ST-80 compatibility." |
|
457 |
||
458 |
changeMsg := aSymbol |
|
8150 | 459 |
|
460 |
"Modified (comment): / 31-08-2017 / 20:18:18 / cg" |
|
269 | 461 |
! |
462 |
||
463 |
controller:aController |
|
464 |
"set the controller" |
|
118 | 465 |
|
269 | 466 |
super controller:aController. |
467 |
controller notNil ifTrue:[ |
|
468 |
controller model:model |
|
0 | 469 |
] |
470 |
! |
|
471 |
||
269 | 472 |
menu:menuSymbol |
8150 | 473 |
"ST-80 style menus: If a view's menuSymbol is nonNil, it |
269 | 474 |
will send it to its model when the middleButton is pressed. |
475 |
That method should return nil or the menu to be shown. |
|
476 |
This is useful for very dynamic menus, where it does not |
|
477 |
make sense to define an initial menu. |
|
478 |
Alias for #menuMessage:, for ST-80 compatibility." |
|
479 |
||
480 |
menuMsg := menuSymbol |
|
8150 | 481 |
|
482 |
"Modified (comment): / 31-08-2017 / 20:18:24 / cg" |
|
269 | 483 |
! |
484 |
||
118 | 485 |
model |
486 |
"return the model, for non-MVC views, |
|
487 |
this is nil or the receiver" |
|
488 |
||
489 |
^ model |
|
490 |
! |
|
491 |
||
492 |
model:aModel |
|
1151
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
493 |
"Set the model. |
1149
a3a75ffb29ce
Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents:
1147
diff
changeset
|
494 |
Here, if I am my own menuPerformer/menuHolder, |
1151
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
495 |
set the menuHolder and menuPerformer to the model. |
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
496 |
This is a compatibility kludge, |
1149
a3a75ffb29ce
Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents:
1147
diff
changeset
|
497 |
since typically, ST-80 code expects the model to provide a menu |
1151
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
498 |
and perform it. If the model does not support a menu message, |
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
499 |
it will be forwarded to the view. |
1149
a3a75ffb29ce
Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents:
1147
diff
changeset
|
500 |
Those apps which want the view to provide the (default) menu have to reset |
a3a75ffb29ce
Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents:
1147
diff
changeset
|
501 |
this by sending #menuHolder: message (again)" |
118 | 502 |
|
503 |
model notNil ifTrue:[ |
|
1149
a3a75ffb29ce
Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents:
1147
diff
changeset
|
504 |
model removeDependent:self |
89 | 505 |
]. |
118 | 506 |
model := aModel. |
2524
6a32a348aaa4
relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents:
2166
diff
changeset
|
507 |
|
6a32a348aaa4
relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents:
2166
diff
changeset
|
508 |
"/ ST80 kludge start |
6a32a348aaa4
relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents:
2166
diff
changeset
|
509 |
(menuPerformer == self |
8671 | 510 |
and:[menuHolder == self |
511 |
and:[model isValueModel not |
|
512 |
and:[model isString not |
|
513 |
]]]) ifTrue:[ |
|
514 |
self menuPerformer:model. |
|
515 |
self menuHolder:model. |
|
1149
a3a75ffb29ce
Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents:
1147
diff
changeset
|
516 |
]. |
2524
6a32a348aaa4
relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents:
2166
diff
changeset
|
517 |
"/ ST80 kludge end. |
6a32a348aaa4
relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents:
2166
diff
changeset
|
518 |
|
118 | 519 |
model notNil ifTrue:[ |
1149
a3a75ffb29ce
Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents:
1147
diff
changeset
|
520 |
aModel addDependent:self |
118 | 521 |
]. |
522 |
controller notNil ifTrue:[ |
|
1149
a3a75ffb29ce
Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents:
1147
diff
changeset
|
523 |
controller model:aModel |
1395
7218ca27d752
moved class>.model to superClass.
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
524 |
]. |
1149
a3a75ffb29ce
Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents:
1147
diff
changeset
|
525 |
|
8671 | 526 |
"Modified: / 28-02-1997 / 19:23:06 / cg" |
527 |
"Modified: / 03-04-2019 / 09:44:19 / Claus Gittinger" |
|
118 | 528 |
! |
529 |
||
140 | 530 |
modelInterface |
531 |
"this returns a dictionary of messages sent to my model. |
|
532 |
It can be used for builders and wrappers to get information |
|
533 |
about the messages sent to my model. |
|
534 |
The returned dictionary contains one entry for each get-Msg, |
|
7234 | 535 |
and the receiver will implement corresponding messages (with a colon) |
140 | 536 |
to set the message symbol." |
537 |
||
538 |
|d| |
|
539 |
||
540 |
d := IdentityDictionary new. |
|
541 |
self addModelInterfaceTo:d. |
|
542 |
^ d |
|
543 |
||
544 |
" |
|
545 |
Button new modelInterface |
|
546 |
Label new modelInterface |
|
547 |
" |
|
548 |
||
549 |
" |
|
550 |
does the view support setting the menuMessage ? |
|
551 |
||
552 |
SelectionInListView new modelInterface includesKey:#menuMessage |
|
553 |
" |
|
554 |
||
555 |
" |
|
556 |
turn off all interaction to the model: |
|
557 |
||
558 |
|m v if| |
|
559 |
||
560 |
m := SelectionInList new. |
|
561 |
m list:#('one' 'two' 'tree' 'four') asValue. |
|
562 |
m selection:1 asValue. |
|
563 |
v := SelectionInListView on:m. |
|
564 |
v open. |
|
565 |
v inspect. |
|
566 |
||
567 |
if := v modelInterface. |
|
568 |
if inspect. |
|
569 |
||
570 |
if keysAndValuesDo:[:what :msg | |
|
7234 | 571 |
v perform:(what , ':') asSymbol with:nil. |
140 | 572 |
]. |
573 |
" |
|
269 | 574 |
! |
575 |
||
576 |
on:aModel aspect:aspectSymbol |
|
577 |
"ST-80 compatibility: set model and aspect |
|
578 |
messages - needs a view which uses these" |
|
579 |
||
580 |
aspectMsg := aspectSymbol. |
|
581 |
self model:aModel. |
|
582 |
! |
|
583 |
||
584 |
on:aModel aspect:aspectSymbol change:changeSymbol |
|
585 |
"ST-80 compatibility: set model, aspect and change |
|
586 |
messages - needs a view which uses these" |
|
587 |
||
588 |
aspectMsg := aspectSymbol. |
|
589 |
changeMsg := changeSymbol. |
|
590 |
self model:aModel. |
|
591 |
! |
|
592 |
||
593 |
on:aModel aspect:aspectSymbol change:changeSymbol menu:menuSymbol |
|
594 |
"ST-80 compatibility: set model, aspect, change and menu |
|
595 |
messages - needs a view which uses these" |
|
596 |
||
597 |
aspectMsg := aspectSymbol. |
|
598 |
changeMsg := changeSymbol. |
|
599 |
menuMsg := menuSymbol. |
|
600 |
self model:aModel. |
|
601 |
! |
|
602 |
||
603 |
on:aModel aspect:aspectSymbol menu:menuSymbol |
|
604 |
"ST-80 compatibility: set model, aspect and menu |
|
605 |
messages - needs a view which uses these" |
|
606 |
||
607 |
aspectMsg := aspectSymbol. |
|
608 |
menuMsg := menuSymbol. |
|
609 |
self model:aModel. |
|
610 |
! |
|
611 |
||
612 |
sendChangeMessage:aSelector with:arg |
|
613 |
"tell the model about a change" |
|
614 |
||
615 |
"/ |
|
616 |
"/ MVC way of doing it: |
|
617 |
"/ if the model is a block, evaluate it, optionally |
|
618 |
"/ passing the arg and the receiver as arguments. |
|
619 |
"/ |
|
620 |
"/ otherwise (the common case) send it a changeMsg message |
|
621 |
"/ also with arg and the receiver (depending on the number of arguments |
|
622 |
"/ as defined by the selector). |
|
623 |
"/ |
|
624 |
(model notNil and:[aSelector notNil]) ifTrue:[ |
|
3170 | 625 |
model isBlock ifTrue:[ |
7674 | 626 |
model valueWithOptionalArgument:aSelector and:arg and:self. |
3170 | 627 |
] ifFalse:[ |
7674 | 628 |
model perform:aSelector withOptionalArgument:arg and:self. |
3170 | 629 |
] |
269 | 630 |
] |
631 |
! |
|
632 |
||
633 |
sendChangeMessageWith:arg |
|
634 |
"tell the model about a change" |
|
635 |
||
636 |
self sendChangeMessage:changeMsg with:arg |
|
72 | 637 |
! ! |
638 |
||
2548 | 639 |
!View methodsFor:'change & update'! |
640 |
||
641 |
update:something with:aParameter from:changedObject |
|
642 |
||
643 |
changedObject == backgroundChannel ifTrue:[ |
|
644 |
self backgroundColor:(backgroundChannel value). |
|
645 |
^ self |
|
646 |
]. |
|
647 |
changedObject == foregroundChannel ifTrue:[ |
|
648 |
self foregroundColor:(foregroundChannel value). |
|
649 |
^ self |
|
650 |
]. |
|
3731 | 651 |
changedObject == model ifTrue:[ |
652 |
self updateFromModel. |
|
653 |
^ self |
|
654 |
]. |
|
2548 | 655 |
super update:something with:aParameter from:changedObject |
656 |
||
657 |
"Created: / 14.1.1998 / 17:10:11 / stefan" |
|
658 |
"Modified: / 30.3.1999 / 13:52:31 / stefan" |
|
3731 | 659 |
! |
660 |
||
661 |
updateFromModel |
|
662 |
"to be redefined in subclasses" |
|
2548 | 663 |
! ! |
664 |
||
269 | 665 |
!View methodsFor:'drawing'! |
118 | 666 |
|
269 | 667 |
redraw |
668 |
"redraw myself |
|
669 |
if there is a model, this one shall redraw itself, |
|
670 |
otherwise we cannot do much here - has to be redefined in subclasses" |
|
118 | 671 |
|
269 | 672 |
model notNil ifTrue:[ |
673 |
model update:self |
|
674 |
] |
|
118 | 675 |
! ! |
676 |
||
2548 | 677 |
!View methodsFor:'event handling'! |
678 |
||
4926 | 679 |
backgroundColorChanged |
680 |
"called to update the background color" |
|
681 |
||
682 |
|color| |
|
683 |
||
684 |
color := backgroundChannel value. |
|
685 |
self backgroundColor:color. |
|
686 |
! |
|
687 |
||
2556
27e9e1cc8cb3
renambe #enableStateChange and #visibilityStateChange
Claus Gittinger <cg@exept.de>
parents:
2548
diff
changeset
|
688 |
enableStateChanged |
2548 | 689 |
"called to update enable/disable state" |
690 |
||
691 |
self enabled:(enableChannel value) |
|
692 |
||
693 |
"Modified: / 30.3.1999 / 16:07:08 / stefan" |
|
4926 | 694 |
! |
695 |
||
696 |
foregroundColorChanged |
|
4977 | 697 |
"called to update the foreground color" |
4926 | 698 |
|
4977 | 699 |
self foregroundColor:(foregroundChannel value) |
2548 | 700 |
! ! |
701 |
||
3095 | 702 |
!View methodsFor:'focus handling'! |
703 |
||
704 |
wantsFocusWithButtonPress |
|
705 |
"views which do not like to take the keyboard focus |
|
706 |
with buttonPress can do so by redefining this |
|
707 |
to return false" |
|
708 |
||
709 |
(self class == View) ifTrue:[ |
|
710 |
"/ a pure filler/geometric layout view |
|
711 |
^ false |
|
712 |
]. |
|
713 |
^ super wantsFocusWithButtonPress |
|
714 |
||
715 |
||
716 |
! ! |
|
717 |
||
3170 | 718 |
!View methodsFor:'initialization & release'! |
2573 | 719 |
|
118 | 720 |
initialize |
7846 | 721 |
<modifier: #super> "must be called if redefined" |
722 |
||
118 | 723 |
super initialize. |
140 | 724 |
|
725 |
aspectMsg := self class defaultAspectMessage. |
|
726 |
changeMsg := self class defaultChangeMessage. |
|
1151
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
727 |
menuMsg := self class defaultMenuMessage. |
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
728 |
|
135 | 729 |
model notNil ifTrue:[ |
1151
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
730 |
controller notNil ifTrue:[ |
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
731 |
controller model:model |
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
732 |
] |
81 | 733 |
]. |
1151
1a3682212ea9
Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents:
1149
diff
changeset
|
734 |
|
7846 | 735 |
"Modified: / 03-01-1997 / 02:11:15 / stefan" |
736 |
"Modified: / 08-02-2017 / 00:26:46 / cg" |
|
3707 | 737 |
! |
738 |
||
739 |
release |
|
740 |
model notNil ifTrue:[ |
|
741 |
model removeDependent:self. |
|
742 |
model := nil. |
|
743 |
]. |
|
4979
649eaf7aecd3
must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
744 |
visibilityChannel notNil ifTrue:[ |
8697 | 745 |
visibilityChannel removeDependentAndRetractInterestsFor:self. |
746 |
visibilityChannel := nil |
|
4979
649eaf7aecd3
must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
747 |
]. |
649eaf7aecd3
must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
748 |
enableChannel notNil ifTrue:[ |
8697 | 749 |
enableChannel removeDependentAndRetractInterestsFor:self. |
750 |
enableChannel := nil |
|
4979
649eaf7aecd3
must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
751 |
]. |
649eaf7aecd3
must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
752 |
foregroundChannel notNil ifTrue:[ |
8697 | 753 |
foregroundChannel removeDependentAndRetractInterestsFor:self. |
754 |
foregroundChannel := nil |
|
4979
649eaf7aecd3
must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
755 |
]. |
649eaf7aecd3
must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
756 |
backgroundChannel notNil ifTrue:[ |
8697 | 757 |
backgroundChannel removeDependentAndRetractInterestsFor:self. |
758 |
backgroundChannel := nil |
|
4979
649eaf7aecd3
must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
759 |
]. |
3707 | 760 |
super release. |
8697 | 761 |
|
762 |
"Modified: / 30-05-2019 / 11:17:21 / Claus Gittinger" |
|
118 | 763 |
! ! |
764 |
||
269 | 765 |
!View class methodsFor:'documentation'! |
766 |
||
767 |
version |
|
7234 | 768 |
^ '$Header$' |
6743 | 769 |
! |
770 |
||
771 |
version_CVS |
|
7234 | 772 |
^ '$Header$' |
269 | 773 |
! ! |
6034
a4e78ef00042
moved assignKeyboardFocus stuff from topView
Claus Gittinger <cg@exept.de>
parents:
4985
diff
changeset
|
774 |