author | Claus Gittinger <cg@exept.de> |
Mon, 27 Jan 1997 17:47:40 +0100 | |
changeset 977 | 82696bdd308a |
parent 582 | e151eeae2c9a |
child 2263 | 7ce448c9ca35 |
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. |
|
582 | 39 |
|
40 |
[author:] |
|
41 |
Claus Gittinger |
|
136 | 42 |
" |
43 |
! ! |
|
44 |
||
45 |
!PopUpListController methodsFor:'event handling'! |
|
46 |
||
977
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
47 |
buttonPress:button x:x y:y |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
48 |
"redefined to not send any change message to the model when |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
49 |
pressed (this is done by the popped menu)" |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
50 |
|
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
51 |
(button == 1 or:[button == #select]) ifFalse:[ |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
52 |
^ super buttonPress:button x:x y:y |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
53 |
]. |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
54 |
|
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
55 |
enableChannel value ifTrue:[ |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
56 |
pressed ifFalse:[ |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
57 |
pressed := true. |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
58 |
view showActive. |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
59 |
|
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
60 |
(pressActionBlock notNil or:[model notNil]) ifTrue:[ |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
61 |
" |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
62 |
force output - so that button is drawn correctly in case |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
63 |
of any long-computation (at high priority) |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
64 |
" |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
65 |
view flush. |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
66 |
]. |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
67 |
|
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
68 |
pressActionBlock value. |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
69 |
|
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
70 |
] |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
71 |
] |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
72 |
|
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
73 |
"Created: 27.1.1997 / 17:22:16 / cg" |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
74 |
"Modified: 27.1.1997 / 17:23:17 / cg" |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
75 |
! |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
76 |
|
136 | 77 |
keyPress:key x:x y:y |
78 |
"pull menu on Return and space, if I am the focusView of my group |
|
79 |
(i.e. if I got an explicit focus)" |
|
80 |
||
491 | 81 |
<resource: #keyboard (#Return #CursorUp #CursorDown)> |
155 | 82 |
|
136 | 83 |
view hasFocus ifTrue:[ |
317
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
84 |
"/ (key == #Return) ifTrue:[ |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
85 |
"/ view menu shown ifTrue:[ |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
86 |
"/ self halt:'not yet implemented'. |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
87 |
"/ ^ self. |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
88 |
"/ ]. |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
89 |
"/ ]. |
349
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
90 |
(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
|
91 |
view menu shown ifTrue:[ |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
92 |
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
|
93 |
ifFalse:[view menu selectPrevious]. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
94 |
^ self. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
95 |
]. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
96 |
]. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
97 |
(key == Character space) ifTrue:[ |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
98 |
view menu exclusivePointer:false. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
99 |
view menu hideOnRelease:true. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
100 |
view popMenu. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
101 |
view menu exclusivePointer:true. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
102 |
^ self. |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
103 |
] |
136 | 104 |
]. |
105 |
view keyPress:key x:x y:y |
|
246 | 106 |
|
107 |
"Created: 9.12.1995 / 23:06:09 / cg" |
|
491 | 108 |
"Modified: 7.3.1996 / 13:17:46 / cg" |
136 | 109 |
! ! |
200 | 110 |
|
203 | 111 |
!PopUpListController class methodsFor:'documentation'! |
112 |
||
113 |
version |
|
977
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
114 |
^ '$Header: /cvs/stx/stx/libwidg/PopUpListController.st,v 1.11 1997-01-27 16:47:40 cg Exp $' |
203 | 115 |
! ! |