PopUpListController.st
author Claus Gittinger <cg@exept.de>
Thu, 25 Apr 1996 18:36:01 +0200
changeset 582 e151eeae2c9a
parent 491 7b376aaa06d5
child 977 82696bdd308a
permissions -rw-r--r--
documentation

"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

ButtonController subclass:#PopUpListController
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Support-Controllers'
!

!PopUpListController class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    redefined the behavior on various keys if my view has the focus.

    [author:]
        Claus Gittinger
"
! !

!PopUpListController methodsFor:'event handling'!

keyPress:key x:x y:y
    "pull menu on Return and space, if I am the focusView of my group
     (i.e. if I got an explicit focus)"

    <resource: #keyboard (#Return #CursorUp #CursorDown)>

    view hasFocus ifTrue:[
"/        (key == #Return) ifTrue:[
"/            view menu shown ifTrue:[
"/                self halt:'not yet implemented'.
"/                ^ self.
"/            ].
"/        ].
        (key == #CursorUp or:[key == #CursorDown]) ifTrue:[
            view menu shown ifTrue:[
                key == #CursorUp ifTrue:[view menu selectNext]
                                 ifFalse:[view menu selectPrevious].
                ^ self.
            ].
        ].
        (key == Character space) ifTrue:[
            view menu exclusivePointer:false.
            view menu hideOnRelease:true.
            view popMenu.
            view menu exclusivePointer:true.
            ^ self.
        ]
    ].
    view keyPress:key x:x y:y

    "Created: 9.12.1995 / 23:06:09 / cg"
    "Modified: 7.3.1996 / 13:17:46 / cg"
! !

!PopUpListController class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libwidg/PopUpListController.st,v 1.10 1996-04-25 16:34:53 cg Exp $'
! !