author | Claus Gittinger <cg@exept.de> |
Fri, 09 Feb 1996 23:13:39 +0100 | |
changeset 349 | e4382398fc59 |
parent 317 | f23de8b78f5e |
child 491 | 7b376aaa06d5 |
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 |
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 | 18 |
! |
19 |
||
20 |
!PopUpListController class methodsFor:'documentation'! |
|
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
25 |
All Rights Reserved |
|
26 |
||
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
38 |
redefined the behavior on various keys if my view has the focus. |
|
39 |
" |
|
40 |
! ! |
|
41 |
||
42 |
!PopUpListController methodsFor:'event handling'! |
|
43 |
||
44 |
keyPress:key x:x y:y |
|
45 |
"pull menu on Return and space, if I am the focusView of my group |
|
46 |
(i.e. if I got an explicit focus)" |
|
47 |
||
155 | 48 |
<resource: #keyboard (#CursorUp #CursorDown)> |
49 |
||
136 | 50 |
view hasFocus ifTrue:[ |
317
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
51 |
"/ (key == #Return) ifTrue:[ |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
52 |
"/ view menu shown ifTrue:[ |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
53 |
"/ self halt:'not yet implemented'. |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
54 |
"/ ^ self. |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
55 |
"/ ]. |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
56 |
"/ ]. |
349
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
57 |
(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
|
58 |
view menu shown ifTrue:[ |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
59 |
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
|
60 |
ifFalse:[view menu selectPrevious]. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
61 |
^ self. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
62 |
]. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
63 |
]. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
64 |
(key == Character space) ifTrue:[ |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
65 |
view menu exclusivePointer:false. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
66 |
view menu hideOnRelease:true. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
67 |
view popMenu. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
68 |
view menu exclusivePointer:true. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
69 |
^ self. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
70 |
] |
136 | 71 |
]. |
72 |
view keyPress:key x:x y:y |
|
246 | 73 |
|
74 |
"Created: 9.12.1995 / 23:06:09 / cg" |
|
349
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
75 |
"Modified: 9.2.1996 / 23:12:39 / cg" |
136 | 76 |
! ! |
200 | 77 |
|
203 | 78 |
!PopUpListController class methodsFor:'documentation'! |
79 |
||
80 |
version |
|
349
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
81 |
^ '$Header: /cvs/stx/stx/libwidg/PopUpListController.st,v 1.8 1996-02-09 22:13:19 cg Exp $' |
203 | 82 |
! ! |