PopUpLstC.st
author Claus Gittinger <cg@exept.de>
Wed, 12 Jun 1996 14:55:00 +0200
changeset 760 62824e1f2607
parent 582 e151eeae2c9a
child 977 82696bdd308a
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
136
claus
parents:
diff changeset
     1
"
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
claus
parents:
diff changeset
     3
	      All Rights Reserved
claus
parents:
diff changeset
     4
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents:
diff changeset
    10
 hereby transferred.
claus
parents:
diff changeset
    11
"
claus
parents:
diff changeset
    12
claus
parents:
diff changeset
    13
ButtonController subclass:#PopUpListController
349
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    14
	instanceVariableNames:''
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    15
	classVariableNames:''
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    16
	poolDictionaries:''
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    17
	category:'Interface-Support-Controllers'
136
claus
parents:
diff changeset
    18
!
claus
parents:
diff changeset
    19
claus
parents:
diff changeset
    20
!PopUpListController class methodsFor:'documentation'!
claus
parents:
diff changeset
    21
claus
parents:
diff changeset
    22
copyright
claus
parents:
diff changeset
    23
"
claus
parents:
diff changeset
    24
 COPYRIGHT (c) 1995 by Claus Gittinger
claus
parents:
diff changeset
    25
	      All Rights Reserved
claus
parents:
diff changeset
    26
claus
parents:
diff changeset
    27
 This software is furnished under a license and may be used
claus
parents:
diff changeset
    28
 only in accordance with the terms of that license and with the
claus
parents:
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
claus
parents:
diff changeset
    30
 be provided or otherwise made available to, or used by, any
claus
parents:
diff changeset
    31
 other person.  No title to or ownership of the software is
claus
parents:
diff changeset
    32
 hereby transferred.
claus
parents:
diff changeset
    33
"
claus
parents:
diff changeset
    34
!
claus
parents:
diff changeset
    35
claus
parents:
diff changeset
    36
documentation
claus
parents:
diff changeset
    37
"
claus
parents:
diff changeset
    38
    redefined the behavior on various keys if my view has the focus.
582
e151eeae2c9a documentation
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
    39
e151eeae2c9a documentation
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
    40
    [author:]
e151eeae2c9a documentation
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
    41
        Claus Gittinger
136
claus
parents:
diff changeset
    42
"
claus
parents:
diff changeset
    43
! !
claus
parents:
diff changeset
    44
claus
parents:
diff changeset
    45
!PopUpListController methodsFor:'event handling'!
claus
parents:
diff changeset
    46
claus
parents:
diff changeset
    47
keyPress:key x:x y:y
claus
parents:
diff changeset
    48
    "pull menu on Return and space, if I am the focusView of my group
claus
parents:
diff changeset
    49
     (i.e. if I got an explicit focus)"
claus
parents:
diff changeset
    50
491
7b376aaa06d5 resources
Claus Gittinger <cg@exept.de>
parents: 349
diff changeset
    51
    <resource: #keyboard (#Return #CursorUp #CursorDown)>
155
claus
parents: 136
diff changeset
    52
136
claus
parents:
diff changeset
    53
    view hasFocus ifTrue:[
317
f23de8b78f5e Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    54
"/        (key == #Return) ifTrue:[
f23de8b78f5e Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    55
"/            view menu shown ifTrue:[
f23de8b78f5e Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    56
"/                self halt:'not yet implemented'.
f23de8b78f5e Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    57
"/                ^ self.
f23de8b78f5e Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    58
"/            ].
f23de8b78f5e Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    59
"/        ].
349
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    60
        (key == #CursorUp or:[key == #CursorDown]) ifTrue:[
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    61
            view menu shown ifTrue:[
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    62
                key == #CursorUp ifTrue:[view menu selectNext]
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    63
                                 ifFalse:[view menu selectPrevious].
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    64
                ^ self.
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    65
            ].
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    66
        ].
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    67
        (key == Character space) ifTrue:[
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    68
            view menu exclusivePointer:false.
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    69
            view menu hideOnRelease:true.
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    70
            view popMenu.
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    71
            view menu exclusivePointer:true.
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    72
            ^ self.
e4382398fc59 ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
    73
        ]
136
claus
parents:
diff changeset
    74
    ].
claus
parents:
diff changeset
    75
    view keyPress:key x:x y:y
246
23feabbc76c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
    76
23feabbc76c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
    77
    "Created: 9.12.1995 / 23:06:09 / cg"
491
7b376aaa06d5 resources
Claus Gittinger <cg@exept.de>
parents: 349
diff changeset
    78
    "Modified: 7.3.1996 / 13:17:46 / cg"
136
claus
parents:
diff changeset
    79
! !
200
aa3e56929a5a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    80
203
8a38b0b03233 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    81
!PopUpListController class methodsFor:'documentation'!
8a38b0b03233 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    82
8a38b0b03233 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    83
version
582
e151eeae2c9a documentation
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
    84
    ^ '$Header: /cvs/stx/stx/libwidg/Attic/PopUpLstC.st,v 1.10 1996-04-25 16:34:53 cg Exp $'
203
8a38b0b03233 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    85
! !