author | ca |
Thu, 17 Oct 2002 19:01:45 +0200 | |
changeset 1637 | 5745a22735c8 |
parent 1636 | c9ed206b5d32 |
child 1763 | fabe0b506e33 |
permissions | -rw-r--r-- |
1124 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
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 |
||
14 |
||
15 |
||
16 |
||
1388 | 17 |
"{ Package: 'stx:libview2' }" |
18 |
||
1124 | 19 |
Object subclass:#KeyboardProcessor |
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
20 |
instanceVariableNames:'returnIsOKInDialog escapeIsCancelInDialog menuBar |
1251 | 21 |
autoAcceptListeners globalAccelerators' |
1124 | 22 |
classVariableNames:'' |
23 |
poolDictionaries:'' |
|
24 |
category:'Interface-Support-UI' |
|
25 |
! |
|
26 |
||
27 |
!KeyboardProcessor class methodsFor:'documentation'! |
|
28 |
||
29 |
copyright |
|
30 |
" |
|
31 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
32 |
All Rights Reserved |
|
33 |
||
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
||
42 |
||
43 |
||
44 |
||
45 |
! |
|
46 |
||
47 |
documentation |
|
48 |
" |
|
49 |
ST80 compatibility (mimicry) class. |
|
50 |
||
51 |
The class is not completed yet and certainly not bug free. |
|
52 |
||
53 |
Notice: |
|
54 |
this class was implemented using protocol information |
|
55 |
from alpha testers, literature and by reading public domain code |
|
56 |
- it may not be complete or compatible to |
|
57 |
the corresponding ST-80 class. |
|
58 |
If you encounter any incompatibilities, please forward a note |
|
59 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
60 |
||
1160 | 61 |
KeyboardProcessor is going to take over the focus control |
62 |
mechanism (which are currently located in the windowGroup). |
|
63 |
Currently, it keeps track of inputFields, and allows for |
|
64 |
a global accept to be forced. |
|
65 |
This is especially useful with dialogs, where a global accept |
|
66 |
should be performed on all inputFields, when the OK button |
|
67 |
is pressed. |
|
68 |
||
1124 | 69 |
[author:] |
1160 | 70 |
Claus Gittinger |
1124 | 71 |
" |
72 |
||
73 |
||
74 |
||
75 |
||
76 |
! ! |
|
77 |
||
1422 | 78 |
!KeyboardProcessor class methodsFor:'defaults'! |
79 |
||
1455
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
80 |
isKeyEventIgnoredAsShortcut:aKeyEvent |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
81 |
"returns true if the key event ignored is a shortCut key |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
82 |
" |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
83 |
|rawKey| |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
84 |
|
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
85 |
rawKey := aKeyEvent rawKey. |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
86 |
rawKey isSymbol ifFalse:[^ true]. |
1503
b3c4b1b1bfbb
cursor keys ARE allowed as accelerators (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
87 |
"/ "/ ignore cursor keys |
b3c4b1b1bfbb
cursor keys ARE allowed as accelerators (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
88 |
"/ (#( |
b3c4b1b1bfbb
cursor keys ARE allowed as accelerators (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
89 |
"/ Up Down Left Right |
b3c4b1b1bfbb
cursor keys ARE allowed as accelerators (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
90 |
"/ CursorUp CursorDown CursorLeft CursorRight |
b3c4b1b1bfbb
cursor keys ARE allowed as accelerators (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
91 |
"/ ) includes:rawKey) ifTrue:[^ true]. |
1455
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
92 |
|
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
93 |
"/ ignore some meta keys |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
94 |
(#( |
1499 | 95 |
#'Control_L' #'Control_R' #'Control' #'Ctrl' |
96 |
#'CmdMenu' #'BackSpace' #Tab |
|
97 |
#'Cmd_L' #'Cmd_R' #'Cmd' |
|
98 |
#'Shift_L' #'Shift_R' Shift |
|
99 |
#'Alt_L' #'Alt_R' #'Alt' |
|
100 |
#'Super_R' #'Super_L' #'Super' |
|
1455
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
101 |
) includes:aKeyEvent key) ifTrue:[^ true]. |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
102 |
|
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
103 |
^ false |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
104 |
|
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
105 |
"Created: / 17.1.2001 / 11:57:07 / cg" |
1457 | 106 |
"Modified: / 17.1.2001 / 13:05:46 / cg" |
1455
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
107 |
! |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
108 |
|
1422 | 109 |
isMnemonicKeyEvent:aKeyEvent |
110 |
"returns true if the key event is a mnemonic key |
|
111 |
" |
|
112 |
|rawKey| |
|
113 |
||
114 |
rawKey := aKeyEvent rawKey. |
|
1443 | 115 |
^ rawKey size == 4 and:[rawKey startsWith:'Cmd'] |
116 |
! ! |
|
1422 | 117 |
|
1498 | 118 |
!KeyboardProcessor methodsFor:'Compatibility - VW'! |
1124 | 119 |
|
120 |
keyboardConsumers |
|
121 |
^ #() |
|
122 |
||
123 |
"Created: 6.3.1997 / 15:16:32 / cg" |
|
124 |
! |
|
125 |
||
126 |
removeKeyboardReceiver:aController |
|
127 |
||
128 |
"Created: / 31.10.1997 / 01:56:54 / cg" |
|
129 |
! |
|
130 |
||
131 |
sendKeyboardTo:aController |
|
132 |
||
133 |
"Created: / 31.10.1997 / 01:57:15 / cg" |
|
134 |
! |
|
135 |
||
136 |
setActive:aWidget |
|
137 |
||
138 |
"Created: 3.3.1997 / 18:31:09 / cg" |
|
139 |
! ! |
|
140 |
||
141 |
!KeyboardProcessor methodsFor:'accessing'! |
|
142 |
||
1251 | 143 |
addAccelerator:aKey action:aSelectorOrBlock |
144 |
"add a global accelerator - these are handled even if no corresponding |
|
145 |
menu shortcut is defined" |
|
146 |
||
147 |
globalAccelerators isNil ifTrue:[ |
|
148 |
globalAccelerators := Dictionary new |
|
149 |
]. |
|
150 |
globalAccelerators at:aKey put:aSelectorOrBlock |
|
151 |
! |
|
152 |
||
1124 | 153 |
escapeIsCancelInDialog:aBoolean |
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
154 |
"set the escapeIsCancel flag. |
1635 | 155 |
If off, Escape is NOT handled as cancel (the builder defaults it to true,)" |
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
156 |
|
1124 | 157 |
escapeIsCancelInDialog := aBoolean |
158 |
! |
|
159 |
||
160 |
menuBar |
|
161 |
"return the value of the instance variable 'menuBar' (automatically generated)" |
|
162 |
||
1443 | 163 |
^ menuBar |
164 |
! |
|
1124 | 165 |
|
166 |
menuBar:something |
|
167 |
"set the value of the instance variable 'menuBar' (automatically generated)" |
|
168 |
||
1443 | 169 |
menuBar := something. |
170 |
! |
|
1124 | 171 |
|
172 |
returnIsOKInDialog:aBoolean |
|
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
173 |
"set the returnIsOK flag. |
1635 | 174 |
If off, Return is NOT handled as accept (the builder defaults it to true,)" |
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
175 |
|
1124 | 176 |
returnIsOKInDialog := aBoolean |
177 |
! ! |
|
178 |
||
179 |
!KeyboardProcessor methodsFor:'event handling'! |
|
180 |
||
1135 | 181 |
processEvent:event forModalView:modalTopOrNil |
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
182 |
"process a key-event; return true, if handled & eaten; false if not. |
1251 | 183 |
Here, first, we look for a globalAccelerator, |
184 |
then for Return and Escape in modal applications, |
|
185 |
(which lead to Accept & Cancel resp.) |
|
186 |
Finally, menu-shortcuts are handled." |
|
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
187 |
|
1552 | 188 |
|key rawKey topView wg app view action focusView| |
1124 | 189 |
|
190 |
view := event view. |
|
191 |
||
192 |
event isKeyPressEvent ifTrue:[ |
|
193 |
key := event key. |
|
1448
0c7834bd6c0f
early bailOut for cursorKeys (do not check for shortCuts)
Claus Gittinger <cg@exept.de>
parents:
1445
diff
changeset
|
194 |
rawKey := event rawKey. |
1135 | 195 |
topView := modalTopOrNil ? view topView. |
1636
c9ed206b5d32
escapeIsCancel/returnIsOK in popup with same app as mainapp
ca
parents:
1635
diff
changeset
|
196 |
|
1445
50bf6580e064
care for topViews without windowGroup (which should not happen - but...)
tm
parents:
1443
diff
changeset
|
197 |
wg := topView windowGroup. |
1124 | 198 |
app := topView application. |
199 |
||
1251 | 200 |
"/ how about global accelerators ? |
201 |
(globalAccelerators notNil |
|
202 |
and:[(action := globalAccelerators at:key ifAbsent:nil) notNil]) |
|
203 |
ifTrue:[ |
|
1492 | 204 |
event consumed:true. |
1251 | 205 |
action isSymbol ifTrue:[ |
1422 | 206 |
app notNil ifTrue:[ |
207 |
action numArgs == 1 ifTrue:[ |
|
208 |
app perform:action with:event |
|
209 |
] ifFalse:[ |
|
210 |
app perform:action |
|
211 |
]. |
|
212 |
] |
|
1251 | 213 |
] ifFalse:[ |
214 |
action numArgs == 1 ifTrue:[ |
|
215 |
action value:event |
|
216 |
] ifFalse:[ |
|
217 |
action value |
|
218 |
] |
|
219 |
]. |
|
1492 | 220 |
"/ ^ true |
221 |
^ event consumed |
|
1251 | 222 |
]. |
1488
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
223 |
|
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
224 |
topView isModal ifTrue:[ |
1637 | 225 |
(key == #Return and:[returnIsOKInDialog ? true]) ifTrue:[ |
226 |
(wg notNil |
|
227 |
and:[(focusView := wg explicitFocusView) isNil |
|
228 |
or:[ focusView isKeyboardConsumer not |
|
229 |
or:[ focusView isInputField ] ] |
|
230 |
]) ifTrue:[ |
|
1488
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
231 |
self requestGlobalAutoAccept ifFalse:[^ true]. |
1636
c9ed206b5d32
escapeIsCancel/returnIsOK in popup with same app as mainapp
ca
parents:
1635
diff
changeset
|
232 |
|
c9ed206b5d32
escapeIsCancel/returnIsOK in popup with same app as mainapp
ca
parents:
1635
diff
changeset
|
233 |
"/ only care for RETURN and ESC if the window is the |
c9ed206b5d32
escapeIsCancel/returnIsOK in popup with same app as mainapp
ca
parents:
1635
diff
changeset
|
234 |
"/ apps topView (not if its a popup or dialog of it) |
c9ed206b5d32
escapeIsCancel/returnIsOK in popup with same app as mainapp
ca
parents:
1635
diff
changeset
|
235 |
(app notNil and:[app window == topView]) ifTrue:[ |
1422 | 236 |
app doAccept. |
1488
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
237 |
] ifFalse:[ |
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
238 |
"/ oldStyle modalBox - for now, let Box handle it itself |
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
239 |
^ false |
1422 | 240 |
]. |
1134
758151d73aac
only do autoAccept, if there is no focus view.
Claus Gittinger <cg@exept.de>
parents:
1133
diff
changeset
|
241 |
^ true |
758151d73aac
only do autoAccept, if there is no focus view.
Claus Gittinger <cg@exept.de>
parents:
1133
diff
changeset
|
242 |
]. |
1124 | 243 |
]. |
1637 | 244 |
(key == #Escape and:[escapeIsCancelInDialog ? true]) ifTrue:[ |
1636
c9ed206b5d32
escapeIsCancel/returnIsOK in popup with same app as mainapp
ca
parents:
1635
diff
changeset
|
245 |
"/ only care for RETURN and ESC if the window is the |
c9ed206b5d32
escapeIsCancel/returnIsOK in popup with same app as mainapp
ca
parents:
1635
diff
changeset
|
246 |
"/ apps topView (not if its a popup or dialog of it) |
c9ed206b5d32
escapeIsCancel/returnIsOK in popup with same app as mainapp
ca
parents:
1635
diff
changeset
|
247 |
(app notNil and:[app window == topView]) ifTrue:[ |
1488
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
248 |
app doCancel. |
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
249 |
] ifFalse:[ |
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
250 |
"/ oldStyle modalBox - for now, let Box handle it itself |
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
251 |
^ false |
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
252 |
]. |
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
253 |
^ true |
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
254 |
]. |
1422 | 255 |
]. |
1488
9fa3505d2d85
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
256 |
|
1455
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
257 |
wg notNil ifTrue:[ |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
258 |
(self class isMnemonicKeyEvent:event) ifTrue:[ |
1456 | 259 |
"/Transcript showCR:event rawKey. |
260 |
"/Transcript showCR:event key. |
|
1455
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
261 |
(wg processMnemonic:event) ifTrue:[ |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
262 |
^ true |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
263 |
] |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
264 |
]. |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
265 |
(self class isKeyEventIgnoredAsShortcut:event) ifFalse:[ |
1456 | 266 |
"/Transcript showCR:event rawKey. |
267 |
"/Transcript showCR:event key. |
|
1455
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
268 |
(wg processShortcut:event) ifTrue:[ |
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
269 |
^ true |
1445
50bf6580e064
care for topViews without windowGroup (which should not happen - but...)
tm
parents:
1443
diff
changeset
|
270 |
]. |
1124 | 271 |
]. |
1422 | 272 |
]. |
1124 | 273 |
]. |
274 |
||
1423 | 275 |
"/ let view dispatch it. |
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
276 |
^ false |
1455
6d385add9b96
shortcut key processing (too slow)
Claus Gittinger <cg@exept.de>
parents:
1453
diff
changeset
|
277 |
|
1552 | 278 |
"Modified: / 23.12.2001 / 13:12:55 / cg" |
1423 | 279 |
! |
1124 | 280 |
|
281 |
requestForWindowClose |
|
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
282 |
"about to close the window." |
1124 | 283 |
|
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
284 |
^ true |
1124 | 285 |
! |
286 |
||
287 |
requestGlobalAutoAccept |
|
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
288 |
"about to close the window via return ok accept. |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
289 |
Ask all acceptListeners to accept their value and return true, if all of those fields |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
290 |
did." |
1124 | 291 |
|
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
292 |
autoAcceptListeners notNil ifTrue:[ |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
293 |
autoAcceptListeners do:[:aListener | |
1133 | 294 |
(aListener requestAutoAccept) ifFalse:[^ false]. |
295 |
]. |
|
296 |
^ true |
|
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
297 |
]. |
1458
43c22152a2f5
accept autoAccept (RETURN) if no input field widget is present
Claus Gittinger <cg@exept.de>
parents:
1457
diff
changeset
|
298 |
"/ if no input field (or comparable widget) is present ... |
43c22152a2f5
accept autoAccept (RETURN) if no input field widget is present
Claus Gittinger <cg@exept.de>
parents:
1457
diff
changeset
|
299 |
"/ ^ false <- wrong. |
43c22152a2f5
accept autoAccept (RETURN) if no input field widget is present
Claus Gittinger <cg@exept.de>
parents:
1457
diff
changeset
|
300 |
^ true. |
1124 | 301 |
! ! |
302 |
||
1128
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
303 |
!KeyboardProcessor methodsFor:'setup'! |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
304 |
|
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
305 |
addAutoAcceptListener:aListener |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
306 |
"add a aListener to my autoAcceptListeners. |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
307 |
Typically, inputFields add themself, to be notified (via requestForAutoAccept) |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
308 |
when the dialog is about to be closed with returnIsOK or accept. |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
309 |
(of course, other listeners are also invited ;-)" |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
310 |
|
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
311 |
autoAcceptListeners isNil ifTrue:[ |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
312 |
autoAcceptListeners := IdentitySet new. |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
313 |
]. |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
314 |
autoAcceptListeners add:aListener |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
315 |
! ! |
7810bca304e3
added autoAccept (editFields in dialogs)
Claus Gittinger <cg@exept.de>
parents:
1124
diff
changeset
|
316 |
|
1124 | 317 |
!KeyboardProcessor class methodsFor:'documentation'! |
318 |
||
319 |
version |
|
1637 | 320 |
^ '$Header: /cvs/stx/stx/libview2/KeyboardProcessor.st,v 1.30 2002-10-17 17:01:45 ca Exp $' |
1124 | 321 |
! ! |