ClickMenuView.st
author Claus Gittinger <cg@exept.de>
Thu, 09 Nov 2017 20:09:30 +0100
changeset 6225 0122e4e6c587
parent 684 015c23130d7b
permissions -rw-r--r--
#FEATURE by cg class: GenericToolbarIconLibrary class added: #hideFilter16x16Icon
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
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
    41
    ClickMenuViews can be used as persistent menus (i.e. non-popping); 
127
claus
parents: 38
diff changeset
    42
    for example, the old launcher uses an instance of ClickMenuView.
586
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
    43
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
    44
    CAVEAT:
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
    45
        to support a better NextStep look, some popUpMenus should 
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
    46
        become automatically a clickMenu ... (really ?)
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
    47
586
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
    48
    [author:]
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 497
diff changeset
    49
        Claus Gittinger
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
    50
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
    51
    [see also:]
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
    52
        PopUpMenu PullDownMenu
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
    53
        MenuView
127
claus
parents: 38
diff changeset
    54
"
claus
parents: 38
diff changeset
    55
!
claus
parents: 38
diff changeset
    56
claus
parents: 38
diff changeset
    57
examples 
claus
parents: 38
diff changeset
    58
"
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    59
    stupid example:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
    60
                                                                        [exBegin]
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    61
        |top menu1 menu2 application|
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    62
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    63
        application := Plug new.
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    64
        application respondTo:#foo
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
    65
                         with:[Transcript showCR:'foo'].
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    66
        application respondTo:#bar 
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
    67
                         with:[Transcript showCR:'bar'].
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    68
        application respondTo:#baz 
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
    69
                         with:[Transcript showCR:'baz'].
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    70
        application respondTo:#more1 
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
    71
                         with:[Transcript showCR:'more1'].
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    72
        application respondTo:#more2 
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
    73
                         with:[Transcript showCR:'more2'].
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    74
        application respondTo:#more3 
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
    75
                         with:[Transcript showCR:'more3'].
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    76
        application respondTo:#quit 
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    77
                         with:[top destroy].
127
claus
parents: 38
diff changeset
    78
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    79
        top := StandardSystemView new.
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    80
        menu1 := ClickMenuView 
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    81
                    labels:#(
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    82
                             'foo'
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    83
                             'bar'
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    84
                             'baz '
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    85
                             '-'
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    86
                             'more foo'
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
                             'quit'
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    89
                            )
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    90
                    selectors:#(
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    91
                            foo
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    92
                            bar
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    93
                            baz
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    94
                            nil
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    95
                            moreFoo
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    96
                            nil
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
    97
                            quit
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    98
                           )
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    99
                    receiver:application.
127
claus
parents: 38
diff changeset
   100
497
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   101
        menu1 subMenuAt:#moreFoo put:(
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   102
            PopUpMenu labels:#(
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   103
                                'more1 '
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   104
                                'more2 '
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   105
                                'more3'
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
                   selectors:#(
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   108
                                more1
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   109
                                more2
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   110
                                more3
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   111
                               )
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   112
        ).
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   113
        menu1 resize; open.
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   114
        top add:menu1.
072d3b8507fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   115
        top openWithExtent:(menu1 extent).
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   116
                                                                        [exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
   117
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 4
diff changeset
   118
! !
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   119
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   120
!ClickMenuView methodsFor:'event handling'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   121
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   122
buttonRelease:button x:x y:y
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   123
    "redefined to automatically deselect on release"
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   124
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   125
    super buttonRelease:button x:x y:y.
684
015c23130d7b selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   126
    self setSelection:nil
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   127
684
015c23130d7b selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   128
    "Modified: 25.5.1996 / 12:26:49 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   129
! !
202
01f3cbb8e20e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   130
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   131
!ClickMenuView class methodsFor:'documentation'!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   132
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   133
version
684
015c23130d7b selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   134
    ^ '$Header: /cvs/stx/stx/libwidg/ClickMenuView.st,v 1.13 1996-05-25 12:22:42 cg Exp $'
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 202
diff changeset
   135
! !