author | Claus Gittinger <cg@exept.de> |
Sat, 20 Jun 2009 10:47:07 +0200 | |
changeset 3901 | 113dd960ba11 |
parent 3003 | 74d174a0e52a |
child 3919 | 9a5d0db0c12e |
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 |
||
2263
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
13 |
"{ Package: 'stx:libwidg' }" |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
14 |
|
136 | 15 |
ButtonController subclass:#PopUpListController |
349
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
16 |
instanceVariableNames:'' |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
17 |
classVariableNames:'' |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
18 |
poolDictionaries:'' |
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
19 |
category:'Interface-Support-Controllers' |
136 | 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 |
documentation |
|
39 |
" |
|
40 |
redefined the behavior on various keys if my view has the focus. |
|
582 | 41 |
|
42 |
[author:] |
|
43 |
Claus Gittinger |
|
136 | 44 |
" |
45 |
! ! |
|
46 |
||
47 |
!PopUpListController methodsFor:'event handling'! |
|
48 |
||
977
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
49 |
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
|
50 |
"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
|
51 |
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
|
52 |
|
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
53 |
(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
|
54 |
^ 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
|
55 |
]. |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
56 |
|
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
57 |
enableChannel value ifTrue:[ |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
58 |
pressed ifFalse:[ |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
59 |
pressed := true. |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
60 |
view showActive. |
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 |
(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
|
63 |
" |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
64 |
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
|
65 |
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
|
66 |
" |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
67 |
view flush. |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
68 |
]. |
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 |
pressActionBlock value. |
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 |
] |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
74 |
|
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
75 |
"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
|
76 |
"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
|
77 |
! |
82696bdd308a
oops - need fix, since order of model-notification vs. actionBlock
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
78 |
|
136 | 79 |
keyPress:key x:x y:y |
80 |
"pull menu on Return and space, if I am the focusView of my group |
|
81 |
(i.e. if I got an explicit focus)" |
|
82 |
||
3003 | 83 |
<resource: #keyboard (#Return #CursorUp #CursorDown #Space)> |
155 | 84 |
|
2263
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
85 |
|menu| |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
86 |
|
136 | 87 |
view hasFocus ifTrue:[ |
317
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
88 |
"/ (key == #Return) ifTrue:[ |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
89 |
"/ view menu shown ifTrue:[ |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
90 |
"/ self halt:'not yet implemented'. |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
91 |
"/ ^ self. |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
92 |
"/ ]. |
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
93 |
"/ ]. |
2263
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
94 |
menu := view menu. |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
95 |
(menu notNil and:[menu isView]) ifTrue:[ |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
96 |
(key == #CursorUp or:[key == #CursorDown]) ifTrue:[ |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
97 |
menu shown ifTrue:[ |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
98 |
key == #CursorUp ifTrue:[menu selectNext] |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
99 |
ifFalse:[menu selectPrevious]. |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
100 |
^ self. |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
101 |
]. |
349
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
102 |
]. |
2263
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
103 |
(key == Character space) ifTrue:[ |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
104 |
menu exclusivePointer:false. |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
105 |
menu hideOnRelease:true. |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
106 |
view popMenu. |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
107 |
view menu exclusivePointer:true. |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
108 |
^ self. |
7ce448c9ca35
care for Gui-builder menu (do ask if shown)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
109 |
] |
349
e4382398fc59
ignore Return key - its meant to close a box
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
110 |
] |
136 | 111 |
]. |
112 |
view keyPress:key x:x y:y |
|
246 | 113 |
|
114 |
"Created: 9.12.1995 / 23:06:09 / cg" |
|
491 | 115 |
"Modified: 7.3.1996 / 13:17:46 / cg" |
136 | 116 |
! ! |
200 | 117 |
|
203 | 118 |
!PopUpListController class methodsFor:'documentation'! |
119 |
||
120 |
version |
|
3003 | 121 |
^ '$Header: /cvs/stx/stx/libwidg/PopUpListController.st,v 1.13 2004-07-13 11:59:27 stefan Exp $' |
203 | 122 |
! ! |