View.st
author matilk
Wed, 13 Sep 2017 09:40:34 +0200
changeset 8174 2704c965b97b
parent 8150 459bd59e8137
child 8284 a085dfe0614b
permissions -rw-r--r--
#BUGFIX by Maren class: DeviceGraphicsContext changed: #displayDeviceOpaqueForm:x:y: nil check
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
8150
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   315
    "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
   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
8150
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   323
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   324
    "Modified (comment): / 31-08-2017 / 20:18:40 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   325
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   326
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   327
menuPerformer
8046
40b9636819d8 #DOCUMENTATION by mawalch
mawalch
parents: 7846
diff changeset
   328
    "who should perform the menu actions?
40b9636819d8 #DOCUMENTATION by mawalch
mawalch
parents: 7846
diff changeset
   329
     If no menuPerformer was defined, it is the model if I have one.
40b9636819d8 #DOCUMENTATION by mawalch
mawalch
parents: 7846
diff changeset
   330
     Otherwise it is the menuPerformer (if nonNil), or myself.
40b9636819d8 #DOCUMENTATION by mawalch
mawalch
parents: 7846
diff changeset
   331
     The menuPerformer gets messages from the menu"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   332
1147
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   333
    menuPerformer notNil ifTrue:[^ menuPerformer].
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   334
3405
0c6b6fcd819f if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   335
    "/ 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
   336
    "/ 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
   337
    "/ (you should not depend on this in your application)
8046
40b9636819d8 #DOCUMENTATION by mawalch
mawalch
parents: 7846
diff changeset
   338
    (model isNil
3405
0c6b6fcd819f if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   339
    or:[model isValueModel
0c6b6fcd819f if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   340
    or:[model isBlock]]) ifTrue:[
8046
40b9636819d8 #DOCUMENTATION by mawalch
mawalch
parents: 7846
diff changeset
   341
        "/ a simple holder-model. Do not send menuMessages to it
3405
0c6b6fcd819f if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   342
        ^ self application ? self
0c6b6fcd819f if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   343
    ].
0c6b6fcd819f if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   344
    ^ model
8046
40b9636819d8 #DOCUMENTATION by mawalch
mawalch
parents: 7846
diff changeset
   345
40b9636819d8 #DOCUMENTATION by mawalch
mawalch
parents: 7846
diff changeset
   346
    "Modified (format): / 29-06-2017 / 12:08:58 / mawalch"
1147
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   347
!
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   348
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   349
menuPerformer:anObject
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   350
    "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
   351
     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
   352
     message."
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   353
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   354
    menuPerformer := anObject
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   355
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
     |top textV plug|
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   358
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   359
     plug := Plug new.
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   360
     plug respondTo:#textMenu
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   361
               with:[ |m|
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   362
                        m := PopUpMenu
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   363
                                  labels:#('copy' 'foo' '-' 'others')
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   364
                                  selectors:#(copySelection foo nil others).
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   365
                        m subMenuAt:#others
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   366
                                put:(PopUpMenu 
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   367
                                        labels:#('bar' 'goto')
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   368
                                        selectors:#(bar gotoLine))        
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
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   371
     top := StandardSystemView new.
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   372
     top extent:300@300.
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   373
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   374
     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
   375
     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
   376
     textV contents:'hello world'.
83ed804938e7 moved menuHolder/menuPerformer stuff up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
   377
     top open.
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
    "Created: 23.12.1996 / 13:57:28 / cg"
2166
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
d6e05def4f83 added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 2134
diff changeset
   383
performer:anObject
d6e05def4f83 added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 2134
diff changeset
   384
    "same as #menuPerformer - ST80 compatibility"
d6e05def4f83 added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 2134
diff changeset
   385
d6e05def4f83 added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 2134
diff changeset
   386
    self menuPerformer:anObject
d6e05def4f83 added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 2134
diff changeset
   387
d6e05def4f83 added #performer: (dummy - ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 2134
diff changeset
   388
    "Created: / 6.7.1998 / 13:38:32 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   389
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   390
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   391
!View methodsFor:'accessing-mvc'!
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   392
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   393
addModelInterfaceTo:aDictionary
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   394
    "this adds entries for all messages sent to my model
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   395
     to aDictionary"
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
    aDictionary at:#aspectMessage put:aspectMsg.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   398
    aDictionary at:#changeMessage put:changeMsg.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   399
    aDictionary at:#menuMessage put:menuMsg.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   400
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   401
    "
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   402
     Button new modelInterface 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   403
    "
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   404
!
135
claus
parents: 133
diff changeset
   405
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   406
aspect
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   407
    "Return the aspect used with changes from/to the model"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   408
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   409
    ^ aspectMsg
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
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   412
aspectMessage
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   413
    "Return the aspect used with changes from/to the model"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   414
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   415
    ^ aspectMsg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   416
!
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
aspectMessage:aspectSymbol
8150
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   419
    "ST-80 style updating: If a view's aspectSymbol is nonNil, 
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   420
     it will respond to changes of this aspect from the model."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   421
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   422
    aspectMsg := aspectSymbol
8150
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   423
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   424
    "Modified (comment): / 31-08-2017 / 20:18:12 / cg"
135
claus
parents: 133
diff changeset
   425
!
claus
parents: 133
diff changeset
   426
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   427
change:changeSymbol
8150
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   428
    "ST-80 style change notification: If a view's changeSymbol is nonNil, 
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   429
     it will send it to its model when something changes.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   430
     Alias for changeMessage: for ST-80 compatibility."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   431
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   432
    self changeMessage:changeSymbol
8150
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   433
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   434
    "Modified (comment): / 31-08-2017 / 20:18:15 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   435
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   436
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   437
changeMessage
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   438
    "Return the symbol sent to the model if nonNil when something changes."
135
claus
parents: 133
diff changeset
   439
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   440
    ^ changeMsg
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
changeMessage:aSymbol
8150
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   444
    "ST-80 style change notification: If a view's changeSymbol is nonNil, 
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   445
     it will send it to its model when something changes.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   446
     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
   447
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   448
    changeMsg := aSymbol
8150
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   449
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   450
    "Modified (comment): / 31-08-2017 / 20:18:18 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   451
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   452
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   453
controller:aController
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   454
    "set the controller"
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   455
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   456
    super controller:aController.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   457
    controller notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   458
	controller model:model
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   459
    ]
48194c26a46c Initial revision
claus
parents:
diff changeset
   460
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   461
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   462
menu:menuSymbol
8150
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   463
    "ST-80 style menus: If a view's menuSymbol is nonNil, it
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   464
     will send it to its model when the middleButton is pressed.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   465
     That method should return nil or the menu to be shown.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   466
     This is useful for very dynamic menus, where it does not
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   467
     make sense to define an initial menu.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   468
     Alias for #menuMessage:, for ST-80 compatibility."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   469
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   470
    menuMsg := menuSymbol
8150
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   471
459bd59e8137 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 8046
diff changeset
   472
    "Modified (comment): / 31-08-2017 / 20:18:24 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   473
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   474
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   475
model
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   476
    "return the model, for non-MVC views,
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   477
     this is nil or the receiver"
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   478
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   479
    ^ model
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   480
!
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   481
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   482
model:aModel
1151
1a3682212ea9 Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents: 1149
diff changeset
   483
    "Set the model.
1149
a3a75ffb29ce Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents: 1147
diff changeset
   484
     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
   485
     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
   486
     This is a compatibility kludge,
1149
a3a75ffb29ce Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents: 1147
diff changeset
   487
     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
   488
     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
   489
     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
   490
     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
   491
     this by sending #menuHolder: message (again)"
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   492
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   493
    model notNil ifTrue:[
1149
a3a75ffb29ce Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents: 1147
diff changeset
   494
        model removeDependent:self
89
ea2bf46eb669 *** empty log message ***
claus
parents: 87
diff changeset
   495
    ].
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   496
    model := aModel.
2524
6a32a348aaa4 relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
   497
6a32a348aaa4 relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
   498
    "/ ST80 kludge start
6a32a348aaa4 relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
   499
    (menuPerformer == self 
6a32a348aaa4 relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
   500
    and:[menuHolder == self
6a32a348aaa4 relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
   501
    and:[model isValueModel not]]) ifTrue:[
1149
a3a75ffb29ce Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents: 1147
diff changeset
   502
        menuPerformer := menuHolder := model
a3a75ffb29ce Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents: 1147
diff changeset
   503
    ].
2524
6a32a348aaa4 relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
   504
    "/ ST80 kludge end.
6a32a348aaa4 relaxed setting of menuPerformer to model,
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
   505
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   506
    model notNil ifTrue:[
1149
a3a75ffb29ce Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents: 1147
diff changeset
   507
        aModel addDependent:self
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   508
    ].
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   509
    controller notNil ifTrue:[
1149
a3a75ffb29ce Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents: 1147
diff changeset
   510
        controller model:aModel
1395
7218ca27d752 moved class>.model to superClass.
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   511
    ].
1149
a3a75ffb29ce Set meuPerformer also, when model is set.
Stefan Vogel <sv@exept.de>
parents: 1147
diff changeset
   512
1395
7218ca27d752 moved class>.model to superClass.
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   513
    "Modified: 28.2.1997 / 19:23:06 / cg"
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   514
!
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   515
140
claus
parents: 135
diff changeset
   516
modelInterface
claus
parents: 135
diff changeset
   517
    "this returns a dictionary of messages sent to my model.
claus
parents: 135
diff changeset
   518
     It can be used for builders and wrappers to get information
claus
parents: 135
diff changeset
   519
     about the messages sent to my model.
claus
parents: 135
diff changeset
   520
     The returned dictionary contains one entry for each get-Msg,
7234
335f9a3179bd #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 6844
diff changeset
   521
     and the receiver will implement corresponding messages (with a colon)
140
claus
parents: 135
diff changeset
   522
     to set the message symbol."
claus
parents: 135
diff changeset
   523
claus
parents: 135
diff changeset
   524
    |d|
claus
parents: 135
diff changeset
   525
claus
parents: 135
diff changeset
   526
    d := IdentityDictionary new.
claus
parents: 135
diff changeset
   527
    self addModelInterfaceTo:d.
claus
parents: 135
diff changeset
   528
    ^ d
claus
parents: 135
diff changeset
   529
claus
parents: 135
diff changeset
   530
    "
claus
parents: 135
diff changeset
   531
     Button new modelInterface
claus
parents: 135
diff changeset
   532
     Label new modelInterface 
claus
parents: 135
diff changeset
   533
    "
claus
parents: 135
diff changeset
   534
claus
parents: 135
diff changeset
   535
    "
claus
parents: 135
diff changeset
   536
     does the view support setting the menuMessage ?
claus
parents: 135
diff changeset
   537
claus
parents: 135
diff changeset
   538
     SelectionInListView new modelInterface includesKey:#menuMessage 
claus
parents: 135
diff changeset
   539
    "
claus
parents: 135
diff changeset
   540
claus
parents: 135
diff changeset
   541
    "
claus
parents: 135
diff changeset
   542
     turn off all interaction to the model:
claus
parents: 135
diff changeset
   543
claus
parents: 135
diff changeset
   544
     |m v if|
claus
parents: 135
diff changeset
   545
claus
parents: 135
diff changeset
   546
     m := SelectionInList new.
claus
parents: 135
diff changeset
   547
     m list:#('one' 'two' 'tree' 'four') asValue.
claus
parents: 135
diff changeset
   548
     m selection:1 asValue.
claus
parents: 135
diff changeset
   549
     v := SelectionInListView on:m.
claus
parents: 135
diff changeset
   550
     v open.
claus
parents: 135
diff changeset
   551
     v inspect.
claus
parents: 135
diff changeset
   552
claus
parents: 135
diff changeset
   553
     if := v modelInterface.
claus
parents: 135
diff changeset
   554
     if inspect.
claus
parents: 135
diff changeset
   555
claus
parents: 135
diff changeset
   556
     if keysAndValuesDo:[:what :msg |
7234
335f9a3179bd #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 6844
diff changeset
   557
         v perform:(what , ':') asSymbol with:nil.
140
claus
parents: 135
diff changeset
   558
     ].
claus
parents: 135
diff changeset
   559
    "
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   560
!
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
on:aModel aspect:aspectSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   563
    "ST-80 compatibility: set model and aspect
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   564
     messages - needs a view which uses these"
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
    aspectMsg := aspectSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   567
    self model:aModel.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   568
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   569
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   570
on:aModel aspect:aspectSymbol change:changeSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   571
    "ST-80 compatibility: set model, aspect and change
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   572
     messages - needs a view which uses these"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   573
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   574
    aspectMsg := aspectSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   575
    changeMsg := changeSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   576
    self model:aModel.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   577
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   578
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   579
on:aModel aspect:aspectSymbol change:changeSymbol menu:menuSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   580
    "ST-80 compatibility: set model, aspect, change and menu
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   581
     messages - needs a view which uses these"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   582
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   583
    aspectMsg := aspectSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   584
    changeMsg := changeSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   585
    menuMsg := menuSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   586
    self model:aModel.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   587
!
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
on:aModel aspect:aspectSymbol menu:menuSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   590
    "ST-80 compatibility: set model, aspect and menu
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   591
     messages - needs a view which uses these"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   592
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   593
    aspectMsg := aspectSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   594
    menuMsg := menuSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   595
    self model:aModel.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   596
!
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
sendChangeMessage:aSelector with:arg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   599
    "tell the model about a change"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   600
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   601
    "/
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   602
    "/ MVC way of doing it:
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   603
    "/ if the model is a block, evaluate it, optionally
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   604
    "/ passing the arg and the receiver as arguments.
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
    "/ otherwise (the common case) send it a changeMsg message
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   607
    "/ 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
   608
    "/ as defined by the selector).
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
    (model notNil and:[aSelector notNil]) ifTrue:[
3170
5ef7c961d23d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   611
        model isBlock ifTrue:[
7674
a3cdff150bcf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7666
diff changeset
   612
            model valueWithOptionalArgument:aSelector and:arg and:self.
3170
5ef7c961d23d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   613
        ] ifFalse:[
7674
a3cdff150bcf #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7666
diff changeset
   614
            model perform:aSelector withOptionalArgument:arg and:self.
3170
5ef7c961d23d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   615
        ]
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   616
    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   617
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   618
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   619
sendChangeMessageWith:arg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   620
    "tell the model about a change"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   621
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   622
    self sendChangeMessage:changeMsg with:arg
72
3e84121988c3 *** empty log message ***
claus
parents: 60
diff changeset
   623
! !
3e84121988c3 *** empty log message ***
claus
parents: 60
diff changeset
   624
2548
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   625
!View methodsFor:'change & update'!
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   626
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   627
update:something with:aParameter from:changedObject
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   628
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   629
    changedObject == backgroundChannel ifTrue:[
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   630
        self backgroundColor:(backgroundChannel value).
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   631
        ^ self
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   632
    ].
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   633
    changedObject == foregroundChannel ifTrue:[
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   634
        self foregroundColor:(foregroundChannel value).
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   635
        ^ self
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   636
    ].
3731
bc73047686e0 updateFromModel hook added
Claus Gittinger <cg@exept.de>
parents: 3707
diff changeset
   637
    changedObject == model ifTrue:[
bc73047686e0 updateFromModel hook added
Claus Gittinger <cg@exept.de>
parents: 3707
diff changeset
   638
        self updateFromModel.
bc73047686e0 updateFromModel hook added
Claus Gittinger <cg@exept.de>
parents: 3707
diff changeset
   639
        ^ self
bc73047686e0 updateFromModel hook added
Claus Gittinger <cg@exept.de>
parents: 3707
diff changeset
   640
    ].
2548
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   641
    super update:something with:aParameter from:changedObject
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   642
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   643
    "Created: / 14.1.1998 / 17:10:11 / stefan"
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   644
    "Modified: / 30.3.1999 / 13:52:31 / stefan"
3731
bc73047686e0 updateFromModel hook added
Claus Gittinger <cg@exept.de>
parents: 3707
diff changeset
   645
!
bc73047686e0 updateFromModel hook added
Claus Gittinger <cg@exept.de>
parents: 3707
diff changeset
   646
bc73047686e0 updateFromModel hook added
Claus Gittinger <cg@exept.de>
parents: 3707
diff changeset
   647
updateFromModel
bc73047686e0 updateFromModel hook added
Claus Gittinger <cg@exept.de>
parents: 3707
diff changeset
   648
    "to be redefined in subclasses"
2548
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   649
! !
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   650
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   651
!View methodsFor:'drawing'!
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   652
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   653
redraw
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   654
    "redraw myself
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   655
     if there is a model, this one shall redraw itself,
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   656
     otherwise we cannot do much here - has to be redefined in subclasses"
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   657
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   658
    model notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   659
	model update:self
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   660
    ]
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   661
! !
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   662
2548
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   663
!View methodsFor:'event handling'!
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   664
4926
421eca160208 Color holders
Stefan Vogel <sv@exept.de>
parents: 3731
diff changeset
   665
backgroundColorChanged
421eca160208 Color holders
Stefan Vogel <sv@exept.de>
parents: 3731
diff changeset
   666
    "called to update the background color"
421eca160208 Color holders
Stefan Vogel <sv@exept.de>
parents: 3731
diff changeset
   667
421eca160208 Color holders
Stefan Vogel <sv@exept.de>
parents: 3731
diff changeset
   668
    |color|
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
    color := backgroundChannel value.
421eca160208 Color holders
Stefan Vogel <sv@exept.de>
parents: 3731
diff changeset
   671
    self backgroundColor:color.
421eca160208 Color holders
Stefan Vogel <sv@exept.de>
parents: 3731
diff changeset
   672
!
421eca160208 Color holders
Stefan Vogel <sv@exept.de>
parents: 3731
diff changeset
   673
2556
27e9e1cc8cb3 renambe #enableStateChange and #visibilityStateChange
Claus Gittinger <cg@exept.de>
parents: 2548
diff changeset
   674
enableStateChanged
2548
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   675
    "called to update enable/disable state"
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   676
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   677
    self enabled:(enableChannel value)
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   678
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   679
    "Modified: / 30.3.1999 / 16:07:08 / stefan"
4926
421eca160208 Color holders
Stefan Vogel <sv@exept.de>
parents: 3731
diff changeset
   680
!
421eca160208 Color holders
Stefan Vogel <sv@exept.de>
parents: 3731
diff changeset
   681
421eca160208 Color holders
Stefan Vogel <sv@exept.de>
parents: 3731
diff changeset
   682
foregroundColorChanged
4977
c39c817d228a +foregroundColorChanged
Claus Gittinger <cg@exept.de>
parents: 4957
diff changeset
   683
    "called to update the foreground color"
4926
421eca160208 Color holders
Stefan Vogel <sv@exept.de>
parents: 3731
diff changeset
   684
4977
c39c817d228a +foregroundColorChanged
Claus Gittinger <cg@exept.de>
parents: 4957
diff changeset
   685
    self foregroundColor:(foregroundChannel value)
2548
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   686
! !
804e5f66a240 Move coomon channels to view.
Stefan Vogel <sv@exept.de>
parents: 2524
diff changeset
   687
3095
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   688
!View methodsFor:'focus handling'!
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
wantsFocusWithButtonPress
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   691
    "views which do not like to take the keyboard focus
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   692
     with buttonPress can do so by redefining this
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   693
     to return false"
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   694
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   695
    (self class == View) ifTrue:[
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   696
        "/ a pure filler/geometric layout view
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   697
        ^ false
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   698
    ].
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   699
    ^ super wantsFocusWithButtonPress
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   700
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   701
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   702
! !
d7b5e6495c79 pure layout views dont want the focusWithButtonPress
ca
parents: 2950
diff changeset
   703
3170
5ef7c961d23d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
   704
!View methodsFor:'initialization & release'!
2573
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
   705
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   706
initialize
7846
6fa91be41543 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7674
diff changeset
   707
    <modifier: #super> "must be called if redefined"
6fa91be41543 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7674
diff changeset
   708
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   709
    super initialize.
140
claus
parents: 135
diff changeset
   710
claus
parents: 135
diff changeset
   711
    aspectMsg := self class defaultAspectMessage.
claus
parents: 135
diff changeset
   712
    changeMsg := self class defaultChangeMessage.
1151
1a3682212ea9 Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents: 1149
diff changeset
   713
    menuMsg := self class defaultMenuMessage.
1a3682212ea9 Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents: 1149
diff changeset
   714
135
claus
parents: 133
diff changeset
   715
    model notNil ifTrue:[
1151
1a3682212ea9 Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents: 1149
diff changeset
   716
        controller notNil ifTrue:[
1a3682212ea9 Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents: 1149
diff changeset
   717
            controller model:model
1a3682212ea9 Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents: 1149
diff changeset
   718
        ]
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   719
    ].
1151
1a3682212ea9 Move rest of menuHolder/menuPerformer stuff to view.
Stefan Vogel <sv@exept.de>
parents: 1149
diff changeset
   720
7846
6fa91be41543 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7674
diff changeset
   721
    "Modified: / 03-01-1997 / 02:11:15 / stefan"
6fa91be41543 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7674
diff changeset
   722
    "Modified: / 08-02-2017 / 00:26:46 / cg"
3707
b95c67aeace4 destroy - release
Claus Gittinger <cg@exept.de>
parents: 3405
diff changeset
   723
!
b95c67aeace4 destroy - release
Claus Gittinger <cg@exept.de>
parents: 3405
diff changeset
   724
b95c67aeace4 destroy - release
Claus Gittinger <cg@exept.de>
parents: 3405
diff changeset
   725
release
b95c67aeace4 destroy - release
Claus Gittinger <cg@exept.de>
parents: 3405
diff changeset
   726
    model notNil ifTrue:[
b95c67aeace4 destroy - release
Claus Gittinger <cg@exept.de>
parents: 3405
diff changeset
   727
        model removeDependent:self.
b95c67aeace4 destroy - release
Claus Gittinger <cg@exept.de>
parents: 3405
diff changeset
   728
        model := nil.
b95c67aeace4 destroy - release
Claus Gittinger <cg@exept.de>
parents: 3405
diff changeset
   729
    ].
4979
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   730
    visibilityChannel notNil ifTrue:[
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   731
        visibilityChannel retractInterestsFor:self.
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   732
        visibilityChannel removeDependent:self. visibilityChannel := nil
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   733
    ].
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   734
    enableChannel notNil ifTrue:[
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   735
        enableChannel retractInterestsFor:self.
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   736
        enableChannel removeDependent:self. enableChannel := nil
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   737
    ].
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   738
    foregroundChannel notNil ifTrue:[
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   739
        foregroundChannel retractInterestsFor:self.
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   740
        foregroundChannel removeDependent:self. foregroundChannel := nil
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   741
    ].
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   742
    backgroundChannel notNil ifTrue:[
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   743
        backgroundChannel retractInterestsFor:self.
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   744
        backgroundChannel removeDependent:self. backgroundChannel := nil
649eaf7aecd3 must retract interests - not remove dependent
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
   745
    ].
3707
b95c67aeace4 destroy - release
Claus Gittinger <cg@exept.de>
parents: 3405
diff changeset
   746
    super release.
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   747
! !
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   748
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   749
!View class methodsFor:'documentation'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   750
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   751
version
7234
335f9a3179bd #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 6844
diff changeset
   752
    ^ '$Header$'
6743
5e81c856acce class: View
Claus Gittinger <cg@exept.de>
parents: 6722
diff changeset
   753
!
5e81c856acce class: View
Claus Gittinger <cg@exept.de>
parents: 6722
diff changeset
   754
5e81c856acce class: View
Claus Gittinger <cg@exept.de>
parents: 6722
diff changeset
   755
version_CVS
7234
335f9a3179bd #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 6844
diff changeset
   756
    ^ '$Header$'
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   757
! !
6034
a4e78ef00042 moved assignKeyboardFocus stuff from topView
Claus Gittinger <cg@exept.de>
parents: 4985
diff changeset
   758