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