136
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
'From Smalltalk/X, Version:2.10.6 on 4-aug-1995 at 1:24:43 am' !
|
|
14 |
|
|
15 |
ButtonController subclass:#PopUpListController
|
|
16 |
instanceVariableNames:''
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'Interface-Support-Controllers'
|
|
20 |
!
|
|
21 |
|
|
22 |
PopUpListController comment:'
|
|
23 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
24 |
All Rights Reserved
|
|
25 |
|
155
|
26 |
$Header: /cvs/stx/stx/libwidg/PopUpListController.st,v 1.2 1995-09-07 12:45:41 claus Exp $
|
136
|
27 |
'!
|
|
28 |
|
|
29 |
!PopUpListController class methodsFor:'documentation'!
|
|
30 |
|
|
31 |
copyright
|
|
32 |
"
|
|
33 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
34 |
All Rights Reserved
|
|
35 |
|
|
36 |
This software is furnished under a license and may be used
|
|
37 |
only in accordance with the terms of that license and with the
|
|
38 |
inclusion of the above copyright notice. This software may not
|
|
39 |
be provided or otherwise made available to, or used by, any
|
|
40 |
other person. No title to or ownership of the software is
|
|
41 |
hereby transferred.
|
|
42 |
"
|
|
43 |
!
|
|
44 |
|
|
45 |
version
|
|
46 |
"
|
155
|
47 |
$Header: /cvs/stx/stx/libwidg/PopUpListController.st,v 1.2 1995-09-07 12:45:41 claus Exp $
|
136
|
48 |
"
|
|
49 |
!
|
|
50 |
|
|
51 |
documentation
|
|
52 |
"
|
|
53 |
redefined the behavior on various keys if my view has the focus.
|
|
54 |
"
|
|
55 |
! !
|
|
56 |
|
|
57 |
!PopUpListController methodsFor:'event handling'!
|
|
58 |
|
|
59 |
keyPress:key x:x y:y
|
|
60 |
"pull menu on Return and space, if I am the focusView of my group
|
|
61 |
(i.e. if I got an explicit focus)"
|
|
62 |
|
155
|
63 |
<resource: #keyboard (#CursorUp #CursorDown)>
|
|
64 |
|
136
|
65 |
view hasFocus ifTrue:[
|
|
66 |
(key == #Return) ifTrue:[
|
|
67 |
view menu shown ifTrue:[
|
|
68 |
self halt.
|
|
69 |
^ self.
|
|
70 |
].
|
|
71 |
].
|
|
72 |
(key == #CursorUp or:[key == #CursorDown]) ifTrue:[
|
|
73 |
view menu shown ifTrue:[
|
|
74 |
key == #CursorUp ifTrue:[view menu selectNext]
|
|
75 |
ifFalse:[view menu selectPrevious].
|
|
76 |
^ self.
|
|
77 |
].
|
|
78 |
].
|
|
79 |
(key == #Return or:[key == Character space]) ifTrue:[
|
|
80 |
view menu exclusivePointer:false.
|
|
81 |
view menu hideOnRelease:true.
|
|
82 |
view popMenu.
|
|
83 |
view menu exclusivePointer:true.
|
|
84 |
^ self.
|
|
85 |
]
|
|
86 |
].
|
|
87 |
view keyPress:key x:x y:y
|
|
88 |
! !
|