author | Claus Gittinger <cg@exept.de> |
Thu, 23 Nov 1995 03:26:58 +0100 | |
changeset 197 | 00927189c882 |
parent 174 | d80a6cc3f9b2 |
child 200 | aa3e56929a5a |
permissions | -rw-r--r-- |
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 class methodsFor:'documentation'! |
|
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
version |
|
174
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
155
diff
changeset
|
39 |
^ '$Header: /cvs/stx/stx/libwidg/PopUpListController.st,v 1.3 1995-11-11 16:22:08 cg Exp $' |
136 | 40 |
! |
41 |
||
42 |
documentation |
|
43 |
" |
|
44 |
redefined the behavior on various keys if my view has the focus. |
|
45 |
" |
|
46 |
! ! |
|
47 |
||
48 |
!PopUpListController methodsFor:'event handling'! |
|
49 |
||
50 |
keyPress:key x:x y:y |
|
51 |
"pull menu on Return and space, if I am the focusView of my group |
|
52 |
(i.e. if I got an explicit focus)" |
|
53 |
||
155 | 54 |
<resource: #keyboard (#CursorUp #CursorDown)> |
55 |
||
136 | 56 |
view hasFocus ifTrue:[ |
57 |
(key == #Return) ifTrue:[ |
|
58 |
view menu shown ifTrue:[ |
|
59 |
self halt. |
|
60 |
^ self. |
|
61 |
]. |
|
62 |
]. |
|
63 |
(key == #CursorUp or:[key == #CursorDown]) ifTrue:[ |
|
64 |
view menu shown ifTrue:[ |
|
65 |
key == #CursorUp ifTrue:[view menu selectNext] |
|
66 |
ifFalse:[view menu selectPrevious]. |
|
67 |
^ self. |
|
68 |
]. |
|
69 |
]. |
|
70 |
(key == #Return or:[key == Character space]) ifTrue:[ |
|
71 |
view menu exclusivePointer:false. |
|
72 |
view menu hideOnRelease:true. |
|
73 |
view popMenu. |
|
74 |
view menu exclusivePointer:true. |
|
75 |
^ self. |
|
76 |
] |
|
77 |
]. |
|
78 |
view keyPress:key x:x y:y |
|
79 |
! ! |