ClickMenuView.st
author Claus Gittinger <cg@exept.de>
Fri, 08 Mar 1996 14:45:20 +0100
changeset 497 072d3b8507fd
parent 205 6814c0bf8df8
child 586 032b3245e53a
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     1
"
4
88eb91574867 *** empty log message ***
claus
parents: 2
diff changeset
     2
 COPYRIGHT (c) 1991 by Claus Gittinger
127
claus
parents: 38
diff changeset
     3
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     4
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    11
"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    12
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    13
MenuView subclass:#ClickMenuView
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    14
	instanceVariableNames:''
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    15
	classVariableNames:''
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    16
	poolDictionaries:''
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    17
	category:'Views-Menus'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    18
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    19
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    20
!ClickMenuView class methodsFor:'documentation'!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    21
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    22
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    23
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    24
 COPYRIGHT (c) 1991 by Claus Gittinger
127
claus
parents: 38
diff changeset
    25
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    26
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    27
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    28
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    30
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    31
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    32
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    33
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    34
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    35
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    36
documentation
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    37
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    38
    ClickMenuViews are like menuViews, but deselects automatically
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
    39
    after clicked on an entry.
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    40
127
claus
parents: 38
diff changeset
    41
    ClickMenuViews can be used as static menus (i.e. non-popping); 
claus
parents: 38
diff changeset
    42
    for example, the old launcher uses an instance of ClickMenuView.
claus
parents: 38
diff changeset
    43
"
claus
parents: 38
diff changeset
    44
!
claus
parents: 38
diff changeset
    45
claus
parents: 38
diff changeset
    46
examples 
claus
parents: 38
diff changeset
    47
"
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    48
    stupid example:
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    49
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    50
        |top menu1 menu2 application|
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    51
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    52
        application := Plug new.
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    53
        application respondTo:#foo
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    54
                         with:[Transcript showCr:'foo'].
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    55
        application respondTo:#bar 
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    56
                         with:[Transcript showCr:'bar'].
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    57
        application respondTo:#baz 
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    58
                         with:[Transcript showCr:'baz'].
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    59
        application respondTo:#more1 
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    60
                         with:[Transcript showCr:'more1'].
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    61
        application respondTo:#more2 
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    62
                         with:[Transcript showCr:'more2'].
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    63
        application respondTo:#more3 
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    64
                         with:[Transcript showCr:'more3'].
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    65
        application respondTo:#quit 
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    66
                         with:[top destroy].
127
claus
parents: 38
diff changeset
    67
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    68
        top := StandardSystemView new.
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    69
        menu1 := ClickMenuView 
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    70
                    labels:#(
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    71
                             'foo'
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    72
                             'bar'
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    73
                             'baz '
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    74
                             '-'
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    75
                             'more foo'
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    76
                             '='
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    77
                             'quit'
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    78
                            )
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    79
                    selectors:#(
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    80
                            foo
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    81
                            bar
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    82
                            baz
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    83
                            nil
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    84
                            moreFoo
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    85
                            nil
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    86
                            destroy
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    87
                           )
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    88
                    receiver:application.
127
claus
parents: 38
diff changeset
    89
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    90
        menu1 subMenuAt:#moreFoo put:(
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    91
            PopUpMenu labels:#(
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    92
                                'more1 '
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    93
                                'more2 '
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    94
                                'more3'
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    95
                               )
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    96
                   selectors:#(
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    97
                                more1
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    98
                                more2
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    99
                                more3
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   100
                               )
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   101
        ).
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   102
        menu1 resize; open.
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   103
        top add:menu1.
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   104
        top openWithExtent:(menu1 extent).
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   105
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   106
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   107
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
   108
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
   109
! !
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   110
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   111
!ClickMenuView methodsFor:'event handling'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   112
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   113
buttonRelease:button x:x y:y
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   114
    super buttonRelease:button x:x y:y.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   115
    self selection:nil
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   116
! !
202
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   117
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   118
!ClickMenuView class methodsFor:'documentation'!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   119
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   120
version
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   121
    ^ '$Header: /cvs/stx/stx/libwidg/ClickMenuView.st,v 1.9 1996-03-08 13:43:54 cg Exp $'
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   122
! !