author | Claus Gittinger <cg@exept.de> |
Wed, 10 Sep 2008 12:48:31 +0200 | |
changeset 3702 | 30f5a2efe531 |
parent 3648 | 7a959d9db34f |
child 3703 | 5463ea3878b0 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1990 by Claus Gittinger |
59 | 3 |
All Rights Reserved |
0 | 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 |
" |
|
2193
58666d1d312c
Channels moved to superclass (#destroy)
Stefan Vogel <sv@exept.de>
parents:
2130
diff
changeset
|
12 |
"{ Package: 'stx:libwidg' }" |
58666d1d312c
Channels moved to superclass (#destroy)
Stefan Vogel <sv@exept.de>
parents:
2130
diff
changeset
|
13 |
|
0 | 14 |
EditTextView subclass:#EditField |
316
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
15 |
instanceVariableNames:'leaveAction enabled clickAction crAction tabAction converter |
209
7a6db7fac566
dont allow multiline selections in EditField
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
16 |
leaveKeys immediateAccept acceptOnLeave acceptOnReturn |
979 | 17 |
lengthLimit entryCompletionBlock entryCompletionCharacter |
2130
40515380f762
moved control over how-to-move-the-cursor when updating text
Claus Gittinger <cg@exept.de>
parents:
2105
diff
changeset
|
18 |
passwordCharacter autoScrollHorizontally acceptOnTab |
3216 | 19 |
acceptOnLostFocus acceptOnPointerLeave acceptIfUnchanged leaveKey |
20 |
doubleClickAction' |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
21 |
classVariableNames:'DefaultForegroundColor DefaultBackgroundColor |
392
81343306d796
eliminated all DefaultFont classVars (are now classINSTvars)
Claus Gittinger <cg@exept.de>
parents:
343
diff
changeset
|
22 |
DefaultSelectionForegroundColor DefaultSelectionBackgroundColor' |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
23 |
poolDictionaries:'' |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
24 |
category:'Views-Text' |
0 | 25 |
! |
26 |
||
892 | 27 |
!EditField class methodsFor:'documentation'! |
19 | 28 |
|
38 | 29 |
copyright |
30 |
" |
|
31 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
59 | 32 |
All Rights Reserved |
38 | 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 |
||
19 | 43 |
documentation |
44 |
" |
|
38 | 45 |
an editable text-field. Realized by using an EditTextView, |
46 |
and forcing its size to 1 line - disabling cursor movement |
|
47 |
in the vertical direction. |
|
121 | 48 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
49 |
Basically, an editField is an editor for a single line text, |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
50 |
and provides the usual access protocol as defined in its superClasses |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
51 |
(especially: #contents / #contents:). |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
52 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
53 |
The above underlying internal mechanism can be used for fields which |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
54 |
are passive; i.e. into which text can be entered and the value (string) |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
55 |
is extracted actively by someone else. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
56 |
|
2737 | 57 |
accepting: |
58 |
The opposite way to use editFields is to connect them to a model |
|
59 |
and let the field notify changes to it. |
|
60 |
This notification is called ``accepting''. |
|
61 |
Unless accepted, the models value is not updated from the editFields contents |
|
62 |
this default is the normal operation and way things should work, since most |
|
63 |
uses of editFields are not interested in every individual change |
|
64 |
(i.e. getting each keyStroke when a long number is entered). |
|
65 |
The default behavior is to ``accept'' when either return or a cursorUp/Down |
|
66 |
key is pressed in a field. |
|
67 |
However, the field can setup to accept/not accept on leave, on return |
|
68 |
or on each individual key input. |
|
69 |
See the methods #acceptOnLeave: / #acceptOnReturn: / #immediateAccept. |
|
70 |
||
71 |
In addition, the set of keys which are considered ``leaveKeys'' can be |
|
72 |
specified by #leaveKeys: (in case you need keys other than Return, CursorUp/Down). |
|
73 |
||
74 |
models value vs. field contents: |
|
75 |
Although the field internally keeps its contents as some string object, |
|
76 |
the application may prefer to think of numbers, floats, yes/no values etc. |
|
77 |
To support this, a converter may defined, which is responsible for conversion of |
|
78 |
strings to/from the models domain value. |
|
79 |
If present (i.e. nonNil), the converter is asked to convert a string to the models |
|
80 |
domain with #readValueFrom:aString and vice versa, a value to a string by #printStringFor:. |
|
81 |
The PrintConverter class already provides a number of standard conversions, see the examples. |
|
82 |
To access a converted value directly (i.e. not via the model), use #editValue. |
|
83 |
||
84 |
grouping: |
|
85 |
Individual fields do not know about being included in a group. This must be arranged on the |
|
86 |
outside, by placing multiple fields into an EnterFieldGroup. |
|
87 |
This groupObject keeps a reference to one active field, and forwards input from any other |
|
88 |
field to the active one. Also have a look at the examples for this. |
|
89 |
||
90 |
input completion: |
|
91 |
To support input completion (i.e. filename completion, classname completion etc.), |
|
92 |
a completionBlock can be defined which (if non-nil) is evaluated when the completion-key |
|
93 |
is pressed and its value is taken as the new field-contents. |
|
94 |
The physical completion-key is the Tab key (this one cannot be defined by |
|
95 |
the keyboardTranslation mechanism, since that would disable the Tab-key on regular text views. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
96 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
97 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
98 |
|
586 | 99 |
[Instance variables:] |
121 | 100 |
|
101 |
leaveAction <Block | nil> if non-nil, this is evaluated with |
|
586 | 102 |
the key (#Return, #CursorUp etc.) when |
103 |
the field is left via keyboard keys. |
|
104 |
(fieldGroups use this to decide which |
|
105 |
field has to be enabled next) |
|
121 | 106 |
|
107 |
enabled <Boolean> if false, input is ignored. |
|
108 |
||
316
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
109 |
clickAction <Block | nil> action performed if the field is |
586 | 110 |
clicked upon. |
111 |
(this is used by the group to |
|
112 |
set the active field to the clicked upon field) |
|
121 | 113 |
|
114 |
crAction <Block | nil> if non-nil, keyboard input of a cr are not |
|
586 | 115 |
handled specially, instead this block is evaluated |
116 |
(however, this block can perform additional checks and send |
|
117 |
a #accept then) |
|
121 | 118 |
|
119 |
tabAction <Block | nil> if non-nil, keyboard input of a tab character |
|
586 | 120 |
is not entered into the text, instead this block |
121 |
is evaluated. Also, no input completion is performed if |
|
122 |
tabAction is nonNil. |
|
121 | 123 |
|
124 |
converter <PrintConverter | nil> if non-nil, this is supposed to convert between |
|
586 | 125 |
the object and its printed representation and vice versa. |
126 |
Defaults to nil i.e. assume that strings are edited. |
|
121 | 127 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
128 |
leaveKeys <Collection> keys which are interpreted as 'leaving the field' |
122 | 129 |
|
125 | 130 |
immediateAccept <Boolean> if true, every change of the text is immediately |
586 | 131 |
forwarded to the model/acceptBlock. If false, |
132 |
the changed value is only stored in the model |
|
133 |
if the field is left or accepted. |
|
134 |
Default is false. |
|
122 | 135 |
|
136 |
acceptOnLeave <Boolean> if true, leaving the field (via cursor keys) |
|
586 | 137 |
automatically accepts the value into the model. |
138 |
Default is true. |
|
122 | 139 |
|
140 |
acceptOnReturn <Boolean> if true, leaving the field via return |
|
586 | 141 |
automatically accepts the value into the model. |
142 |
Default is true. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
143 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
144 |
acceptOnTab <Boolean> if true, the Tab key accepts and leaves the field. |
586 | 145 |
If false, Tabs are entered into the contents field like |
146 |
ordinary non-control keys. |
|
147 |
AcceptOnTab is ignored if the entryCompletion block is nonNil. |
|
148 |
Default is true. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
149 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
150 |
lengthLimit <Number> the max. number of allowed characters |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
151 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
152 |
entryCompletionBlock <BlockOrNil> if non-nil, this is evaluated to complete the entry |
978
6e678fdc6e5b
allow non-Tab as entryCompleter; care for immediateAccept after completion
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
153 |
when <entryCompletionCharacter> is pressed. |
586 | 154 |
Entry completion is used with Filenamefields or in the |
155 |
browser for classname/selector completion. |
|
156 |
Setting a nonNil entryCompletion disables acceptOnTab. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
157 |
|
2130
40515380f762
moved control over how-to-move-the-cursor when updating text
Claus Gittinger <cg@exept.de>
parents:
2105
diff
changeset
|
158 |
entryCompletionCharacter <CharacterOrNil> if non-nil AND entryCompletionBlock is nonNil, that one |
40515380f762
moved control over how-to-move-the-cursor when updating text
Claus Gittinger <cg@exept.de>
parents:
2105
diff
changeset
|
159 |
is evaluated for completion. Typically used to complete |
40515380f762
moved control over how-to-move-the-cursor when updating text
Claus Gittinger <cg@exept.de>
parents:
2105
diff
changeset
|
160 |
a fileName (also, classNames in the browser) |
40515380f762
moved control over how-to-move-the-cursor when updating text
Claus Gittinger <cg@exept.de>
parents:
2105
diff
changeset
|
161 |
Default is #Tab. |
978
6e678fdc6e5b
allow non-Tab as entryCompleter; care for immediateAccept after completion
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
162 |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
163 |
passwordCharacter <CharacterOrNil> if non-nil, typed input is replaced by this character |
586 | 164 |
for display. Used for secret-input fields (such as password entry). |
165 |
Default is nil. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
166 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
167 |
|
586 | 168 |
[author:] |
169 |
Claus Gittinger |
|
170 |
||
171 |
[see also:] |
|
172 |
DialogBox |
|
594 | 173 |
EnterFieldGroup |
174 |
EnterBox EnterBox2 |
|
175 |
FilenameEditField EditTextView |
|
19 | 176 |
" |
120 | 177 |
! |
178 |
||
179 |
examples |
|
180 |
" |
|
122 | 181 |
see more examples in EnterFieldGroup>>examples. |
182 |
||
183 |
||
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
184 |
Step-by-step introduction: |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
185 |
|
120 | 186 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
187 |
basic field in some view: |
594 | 188 |
[exBegin] |
333 | 189 |
|top field| |
120 | 190 |
|
333 | 191 |
top := StandardSystemView new. |
192 |
top extent:200@100. |
|
120 | 193 |
|
333 | 194 |
field := EditField origin:0.0@0.0 in:top. |
195 |
field width:1.0. 'let its height as-is'. |
|
120 | 196 |
|
333 | 197 |
top open |
594 | 198 |
[exEnd] |
120 | 199 |
|
122 | 200 |
|
125 | 201 |
forward input in topView to the field: |
202 |
(currently, the field does not know this - therefore, |
|
203 |
its been told here ... this may change) |
|
594 | 204 |
[exBegin] |
333 | 205 |
|top field| |
122 | 206 |
|
333 | 207 |
top := StandardSystemView new. |
208 |
top extent:200@100. |
|
122 | 209 |
|
333 | 210 |
field := EditField origin:0.0@0.0 in:top. |
211 |
field width:1.0. 'let its height as-is'. |
|
122 | 212 |
|
333 | 213 |
top delegate:(KeyboardForwarder toView:field). |
214 |
field hasKeyboardFocus:true. |
|
215 |
top open |
|
594 | 216 |
[exEnd] |
122 | 217 |
|
218 |
||
125 | 219 |
to make it look better: set some inset: |
594 | 220 |
[exBegin] |
333 | 221 |
|top field spacing| |
120 | 222 |
|
333 | 223 |
top := StandardSystemView new. |
224 |
top extent:200@100. |
|
120 | 225 |
|
333 | 226 |
spacing := View viewSpacing. |
227 |
field := EditField origin:(0.0 @ spacing) in:top. |
|
228 |
field width:1.0. 'let its height as-is'. |
|
229 |
field leftInset:spacing; rightInset:spacing. |
|
120 | 230 |
|
333 | 231 |
top open |
594 | 232 |
[exEnd] |
120 | 233 |
|
122 | 234 |
|
120 | 235 |
give it an initial contents: |
594 | 236 |
[exBegin] |
333 | 237 |
|top field| |
120 | 238 |
|
333 | 239 |
top := StandardSystemView new. |
240 |
top extent:200@100. |
|
120 | 241 |
|
594 | 242 |
field := EditField origin:(0.0 @ 0.0) in:top. |
333 | 243 |
field width:1.0. |
120 | 244 |
|
333 | 245 |
field editValue:'hello world'. |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
246 |
|
333 | 247 |
top open |
594 | 248 |
[exEnd] |
120 | 249 |
|
122 | 250 |
|
125 | 251 |
have it preselected: |
594 | 252 |
[exBegin] |
333 | 253 |
|top field| |
120 | 254 |
|
333 | 255 |
top := StandardSystemView new. |
256 |
top extent:200@100. |
|
120 | 257 |
|
333 | 258 |
field := EditField origin:(0.0 @ 0.0) in:top. |
259 |
field width:1.0. |
|
260 |
field editValue:'hello world' selected:true. |
|
120 | 261 |
|
333 | 262 |
top open |
594 | 263 |
[exEnd] |
120 | 264 |
|
122 | 265 |
|
120 | 266 |
have part of it preselected: |
594 | 267 |
[exBegin] |
333 | 268 |
|top field| |
120 | 269 |
|
333 | 270 |
top := StandardSystemView new. |
271 |
top extent:200@100. |
|
120 | 272 |
|
333 | 273 |
field := EditField origin:(0.0 @ 0.0) in:top. |
274 |
field width:1.0. |
|
120 | 275 |
|
333 | 276 |
field editValue:'hello world'. |
277 |
field selectFromCharacterPosition:1 to:5. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
278 |
|
333 | 279 |
top open |
594 | 280 |
[exEnd] |
120 | 281 |
|
122 | 282 |
|
125 | 283 |
set a size limit: |
594 | 284 |
[exBegin] |
333 | 285 |
|top field| |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
286 |
|
333 | 287 |
top := StandardSystemView new. |
288 |
top extent:200@100. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
289 |
|
333 | 290 |
field := EditField origin:(0.0 @ 0.0) in:top. |
291 |
field width:1.0. |
|
292 |
field editValue:'hello'. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
293 |
|
333 | 294 |
field maxChars:8. |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
295 |
|
333 | 296 |
top open |
594 | 297 |
[exEnd] |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
298 |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
299 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
300 |
set a size limit, initial width and stop it from scrolling |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
301 |
notice: you may prefer a constant-pitch font (such as courier): |
594 | 302 |
[exBegin] |
333 | 303 |
|top field| |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
304 |
|
333 | 305 |
top := StandardSystemView new. |
306 |
top extent:200@100. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
307 |
|
333 | 308 |
field := EditField origin:(0.0 @ 0.0) in:top. |
309 |
field innerWidth:(field font widthOf:'00000000'). |
|
310 |
field editValue:'12345678'. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
311 |
|
333 | 312 |
field maxChars:8. |
313 |
field autoScroll:false. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
314 |
|
333 | 315 |
top open |
594 | 316 |
[exEnd] |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
317 |
|
125 | 318 |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
319 |
enable / disable: |
594 | 320 |
[exBegin] |
333 | 321 |
|top panel check field ena| |
322 |
||
323 |
top := StandardSystemView new. |
|
324 |
top extent:200@100. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
325 |
|
333 | 326 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top. |
327 |
panel borderWidth:0. |
|
328 |
panel horizontalLayout:#left. |
|
329 |
panel horizontalInset:View viewSpacing. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
330 |
|
333 | 331 |
check := CheckBox label:'enable' in:panel. |
332 |
check turnOn. |
|
333 |
check action:[:onOff | onOff ifTrue:[field enable] ifFalse:[field disable]]. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
334 |
|
333 | 335 |
panel add:(View new height:30; borderWidth:0). |
125 | 336 |
|
333 | 337 |
field := EditField in:panel. |
338 |
field width:1.0. |
|
339 |
field editValue:'hello'. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
340 |
|
333 | 341 |
top open |
594 | 342 |
[exEnd] |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
343 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
344 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
345 |
enable / disable using a channel: |
594 | 346 |
[exBegin] |
333 | 347 |
|top panel check field ena| |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
348 |
|
333 | 349 |
top := StandardSystemView new. |
350 |
top extent:200@100. |
|
125 | 351 |
|
333 | 352 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top. |
353 |
panel borderWidth:0. |
|
354 |
panel horizontalLayout:#left. |
|
355 |
panel horizontalInset:View viewSpacing. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
356 |
|
333 | 357 |
ena := true asValue. |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
358 |
|
333 | 359 |
check := CheckBox label:'enable' in:panel. |
360 |
check model:ena. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
361 |
|
333 | 362 |
panel add:(View new height:30; borderWidth:0). |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
363 |
|
333 | 364 |
field := EditField in:panel. |
365 |
field enableChannel:ena. |
|
366 |
field width:1.0. |
|
367 |
field editValue:'hello'. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
368 |
|
333 | 369 |
top open |
594 | 370 |
[exEnd] |
125 | 371 |
|
372 |
||
121 | 373 |
use a converter: |
125 | 374 |
- numbers (default to 0): |
594 | 375 |
[exBegin] |
376 |
|top field spacing| |
|
121 | 377 |
|
333 | 378 |
top := StandardSystemView new. |
379 |
top extent:200@100. |
|
121 | 380 |
|
594 | 381 |
spacing := View viewSpacing. |
382 |
||
383 |
field := EditField origin:0.0 @ spacing in:top. |
|
333 | 384 |
field width:1.0. |
594 | 385 |
field horizontalInset:spacing. |
121 | 386 |
|
333 | 387 |
field converter:(PrintConverter new initForNumber). |
388 |
field editValue:1234. |
|
655 | 389 |
field acceptAction:[:value | Transcript showCR:value]. |
333 | 390 |
field crAction:[field accept. top destroy]. |
391 |
top open. |
|
594 | 392 |
[exEnd] |
121 | 393 |
|
394 |
- dates: |
|
594 | 395 |
[exBegin] |
396 |
|top field spacing| |
|
121 | 397 |
|
333 | 398 |
top := StandardSystemView new. |
399 |
top extent:200@100. |
|
121 | 400 |
|
594 | 401 |
spacing := View viewSpacing. |
402 |
||
403 |
field := EditField origin:0.0 @ spacing in:top. |
|
333 | 404 |
field width:1.0. |
594 | 405 |
field horizontalInset:spacing. |
121 | 406 |
|
333 | 407 |
field converter:(PrintConverter new initForDate). |
408 |
field editValue:Date today. |
|
655 | 409 |
field acceptAction:[:value | Transcript showCR:value class name , ' ' , value printString]. |
333 | 410 |
field crAction:[field accept. top destroy]. |
411 |
top open. |
|
594 | 412 |
[exEnd] |
121 | 413 |
|
122 | 414 |
|
125 | 415 |
setting immediateAccept, makes the field update with every key: |
416 |
||
417 |
- immediate accept numbers, defaulting to nil: |
|
594 | 418 |
[exBegin] |
419 |
|top field spacing| |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
420 |
|
333 | 421 |
top := StandardSystemView new. |
422 |
top extent:200@100. |
|
121 | 423 |
|
594 | 424 |
spacing := View viewSpacing. |
425 |
||
426 |
field := EditField origin:0.0 @ spacing in:top. |
|
333 | 427 |
field width:1.0. |
594 | 428 |
field horizontalInset:spacing. |
121 | 429 |
|
333 | 430 |
field converter:(PrintConverter new initForNumberOrNil). |
431 |
field immediateAccept:true. |
|
432 |
field editValue:1234. |
|
655 | 433 |
field acceptAction:[:value | Transcript showCR:value]. |
333 | 434 |
field crAction:[field accept. top destroy]. |
435 |
top open. |
|
594 | 436 |
[exEnd] |
121 | 437 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
438 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
439 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
440 |
grouping multiple fields, and forward keyPres from the outer view to the active field |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
441 |
(i.e. actually: to the group): |
594 | 442 |
[exBegin] |
333 | 443 |
|top field1 field2 field3 group| |
121 | 444 |
|
122 | 445 |
|
333 | 446 |
top := StandardSystemView new. |
447 |
top extent:200@100. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
448 |
|
333 | 449 |
field1 := EditField origin:(0.0 @ 0.0) in:top. |
450 |
field1 width:1.0. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
451 |
|
333 | 452 |
field2 := EditField origin:(0.0 @ 0.0) in:top. |
453 |
field2 width:0.5. |
|
454 |
field2 topInset:(field1 height); bottomInset:(field1 height negated). |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
455 |
|
333 | 456 |
field3 := EditField origin:(0.5 @ 0.0) in:top. |
457 |
field3 width:0.5. |
|
458 |
field3 topInset:(field1 height); bottomInset:(field1 height negated). |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
459 |
|
333 | 460 |
group := EnterFieldGroup new. |
461 |
group add:field1; add:field2; add:field3. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
462 |
|
333 | 463 |
top delegate:(KeyboardForwarder to:group). |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
464 |
|
333 | 465 |
top open. |
594 | 466 |
[exEnd] |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
467 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
468 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
469 |
in addition: tell the group to close when the last field is left: |
594 | 470 |
[exBegin] |
333 | 471 |
|top field1 field2 field3 group| |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
472 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
473 |
|
333 | 474 |
top := StandardSystemView new. |
475 |
top extent:200@100. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
476 |
|
333 | 477 |
field1 := EditField origin:(0.0 @ 0.0) in:top. |
478 |
field1 width:1.0. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
479 |
|
333 | 480 |
field2 := EditField origin:(0.0 @ 0.0) in:top. |
481 |
field2 width:0.5. |
|
482 |
field2 topInset:(field1 height); bottomInset:(field1 height negated). |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
483 |
|
333 | 484 |
field3 := EditField origin:(0.5 @ 0.0) in:top. |
485 |
field3 width:0.5. |
|
486 |
field3 topInset:(field1 height); bottomInset:(field1 height negated). |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
487 |
|
333 | 488 |
group := EnterFieldGroup new. |
489 |
group add:field1; add:field2; add:field3. |
|
490 |
group leaveAction:[top destroy]. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
491 |
|
333 | 492 |
top delegate:(KeyboardForwarder to:group). |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
493 |
|
333 | 494 |
top open. |
594 | 495 |
[exEnd] |
127 | 496 |
|
497 |
||
120 | 498 |
use a model: |
499 |
(see changing model value in inspector when return is pressed in the field) |
|
594 | 500 |
[exBegin] |
333 | 501 |
|top field model| |
120 | 502 |
|
333 | 503 |
model := 'hello world' asValue. |
120 | 504 |
|
333 | 505 |
top := StandardSystemView new. |
506 |
top extent:200@100. |
|
120 | 507 |
|
333 | 508 |
field := EditField origin:(0.0 @ 0.0) in:top. |
509 |
field width:1.0. |
|
510 |
field model:model. |
|
511 |
field acceptOnReturn:true. |
|
120 | 512 |
|
333 | 513 |
top open. |
514 |
model inspect. |
|
594 | 515 |
[exEnd] |
121 | 516 |
|
122 | 517 |
|
892 | 518 |
like above, but also accept the value, when the focus is changed |
894 | 519 |
(i.e. out of the input field): |
892 | 520 |
(see changing model value in inspector) |
521 |
[exBegin] |
|
522 |
|top field model| |
|
523 |
||
524 |
model := 'hello world' asValue. |
|
525 |
||
526 |
top := StandardSystemView new. |
|
527 |
top extent:200@100. |
|
528 |
||
529 |
field := EditField origin:(0.0 @ 0.0) in:top. |
|
530 |
field width:1.0. |
|
531 |
field model:model. |
|
532 |
field acceptOnLostFocus:true. |
|
533 |
||
534 |
top open. |
|
894 | 535 |
InspectorView openOn:model monitor:'value'. |
892 | 536 |
[exEnd] |
537 |
||
538 |
||
127 | 539 |
two views on the same model (each accepts on return): |
594 | 540 |
[exBegin] |
333 | 541 |
|top1 top2 field1 field2 model| |
121 | 542 |
|
333 | 543 |
model := 'hello world' asValue. |
121 | 544 |
|
333 | 545 |
top1 := StandardSystemView new. |
546 |
top1 extent:200@100. |
|
547 |
field1 := EditField origin:(0.0 @ 0.0) in:top1. |
|
548 |
field1 width:1.0. |
|
549 |
field1 model:model. |
|
550 |
field1 acceptOnReturn:true. |
|
551 |
top1 open. |
|
121 | 552 |
|
333 | 553 |
top2 := StandardSystemView new. |
554 |
top2 extent:200@100. |
|
555 |
field2 := EditField origin:(0.0 @ 0.0) in:top2. |
|
556 |
field2 width:1.0. |
|
557 |
field2 model:model. |
|
558 |
field2 acceptOnReturn:true. |
|
559 |
top2 open. |
|
594 | 560 |
[exEnd] |
121 | 561 |
|
127 | 562 |
two views on the same model (no accept on return): |
594 | 563 |
[exBegin] |
333 | 564 |
|top1 top2 field1 field2 model| |
127 | 565 |
|
333 | 566 |
model := 'hello world' asValue. |
127 | 567 |
|
333 | 568 |
top1 := StandardSystemView new. |
569 |
top1 extent:200@100. |
|
570 |
field1 := EditField origin:(0.0 @ 0.0) in:top1. |
|
571 |
field1 width:1.0. |
|
572 |
field1 model:model; acceptOnReturn:false. |
|
573 |
top1 open. |
|
127 | 574 |
|
333 | 575 |
top2 := StandardSystemView new. |
576 |
top2 extent:200@100. |
|
577 |
field2 := EditField origin:(0.0 @ 0.0) in:top2. |
|
578 |
field2 width:1.0. |
|
579 |
field2 model:model; acceptOnReturn:false. |
|
580 |
top2 open. |
|
594 | 581 |
[exEnd] |
127 | 582 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
583 |
with immediate accept (every key updates the model): |
594 | 584 |
[exBegin] |
333 | 585 |
|top1 top2 field1 field2 model| |
125 | 586 |
|
333 | 587 |
model := 'hello world' asValue. |
125 | 588 |
|
333 | 589 |
top1 := StandardSystemView new. |
590 |
top1 extent:200@100. |
|
591 |
field1 := EditField origin:(0.0 @ 0.0) in:top1. |
|
592 |
field1 width:1.0. |
|
593 |
field1 model:model; immediateAccept:true. |
|
594 |
top1 open. |
|
125 | 595 |
|
333 | 596 |
top2 := StandardSystemView new. |
597 |
top2 extent:200@100. |
|
598 |
field2 := EditField origin:(0.0 @ 0.0) in:top2. |
|
599 |
field2 width:1.0. |
|
600 |
field2 model:model; immediateAccept:true. |
|
601 |
top2 open. |
|
594 | 602 |
[exEnd] |
122 | 603 |
|
121 | 604 |
just an example; a checkBox and an editField on the same model: |
594 | 605 |
[exBegin] |
333 | 606 |
|top1 top2 field1 box model| |
121 | 607 |
|
333 | 608 |
model := false asValue. |
121 | 609 |
|
333 | 610 |
top1 := StandardSystemView new. |
611 |
top1 extent:200@100. |
|
612 |
field1 := EditField origin:(0.0 @ 0.0) in:top1. |
|
613 |
field1 width:1.0. |
|
614 |
field1 converter:(PrintConverter new initForYesNo). |
|
615 |
field1 model:model. |
|
616 |
top1 open. |
|
121 | 617 |
|
333 | 618 |
top2 := StandardSystemView new. |
619 |
top2 extent:200@100. |
|
620 |
box := CheckBox on:model. |
|
621 |
box label:'on/off'. |
|
622 |
top2 add:box. |
|
623 |
top2 open. |
|
121 | 624 |
|
333 | 625 |
model inspect. |
594 | 626 |
[exEnd] |
125 | 627 |
|
628 |
||
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
629 |
multiple editFields on multiple models (value holders): |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
630 |
(the fields are connected by a group to allow tabbing) |
594 | 631 |
[exBegin] |
632 |
|top panel group field1 field2 field3 box |
|
633 |
v1 v2 v3 spacing| |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
634 |
|
333 | 635 |
v1 := true asValue. |
636 |
v2 := 'some string' asValue. |
|
637 |
v3 := 1.2 asValue. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
638 |
|
333 | 639 |
top := StandardSystemView new. |
640 |
top extent:200@100. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
641 |
|
333 | 642 |
panel := VerticalPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top. |
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
643 |
|
594 | 644 |
spacing := View viewSpacing. |
645 |
||
333 | 646 |
field1 := EditField new. |
647 |
field1 width:1.0. |
|
594 | 648 |
field1 horizontalInset:spacing. |
333 | 649 |
field1 converter:(PrintConverter new initForYesNo). |
650 |
field1 model:v1. |
|
651 |
panel add:field1. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
652 |
|
333 | 653 |
field2 := EditField new. |
654 |
field2 width:1.0. |
|
594 | 655 |
field2 horizontalInset:spacing. |
333 | 656 |
field2 model:v2. |
657 |
panel add:field2. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
658 |
|
333 | 659 |
field3 := EditField new. |
660 |
field3 width:1.0. |
|
594 | 661 |
field3 horizontalInset:spacing. |
333 | 662 |
field3 converter:(PrintConverter new initForNumber). |
663 |
field3 model:v3. |
|
664 |
panel add:field3. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
665 |
|
333 | 666 |
group := EnterFieldGroup new. |
667 |
group add:field1; add:field2; add:field3. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
668 |
|
333 | 669 |
top openModal. |
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
670 |
|
655 | 671 |
Transcript showCR:v1 value. |
672 |
Transcript showCR:v2 value. |
|
673 |
Transcript showCR:v3 value. |
|
594 | 674 |
[exEnd] |
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
675 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
676 |
|
125 | 677 |
connecting fields: |
678 |
update field2 wehenever field1 is changed. |
|
679 |
(normally, the processing below (xChanged) is done in your application |
|
680 |
class, or in a complex model. For the demonstration below, we use |
|
681 |
a Plug to simulate the protocol.) |
|
594 | 682 |
[exBegin] |
333 | 683 |
|application top field1 field2 value1 value2| |
125 | 684 |
|
333 | 685 |
application := Plug new. |
686 |
application respondTo:#value1Changed |
|
687 |
with:[value2 value:(value1 value isNil ifTrue:[nil] |
|
688 |
ifFalse:[value1 value squared])]. |
|
125 | 689 |
|
333 | 690 |
value1 := 1 asValue. |
691 |
value2 := 1 asValue. |
|
125 | 692 |
|
333 | 693 |
top := Dialog new. |
694 |
top extent:200@200. |
|
125 | 695 |
|
333 | 696 |
(top addTextLabel:'some number:') layout:#left. |
697 |
top addVerticalSpace. |
|
125 | 698 |
|
333 | 699 |
(top addInputFieldOn:value1 tabable:false) |
700 |
converter:(PrintConverter new initForNumberOrNil); |
|
701 |
immediateAccept:true. |
|
702 |
top addVerticalSpace. |
|
125 | 703 |
|
333 | 704 |
(top addTextLabel:'squared:') layout:#left. |
705 |
top addVerticalSpace. |
|
706 |
(top addInputFieldOn:value2 tabable:false) |
|
707 |
converter:(PrintConverter new initForNumberOrNil). |
|
125 | 708 |
|
333 | 709 |
value1 onChangeSend:#value1Changed to:application. |
125 | 710 |
|
333 | 711 |
top openModeless. |
594 | 712 |
[exEnd] |
125 | 713 |
|
714 |
||
715 |
two-way connect: |
|
716 |
each field updates the other (notice, that we have to turn off |
|
717 |
onChange: notification, to avoid an endless notification cycle) |
|
594 | 718 |
[exBegin] |
333 | 719 |
|application top field1 field2 value1 value2| |
125 | 720 |
|
333 | 721 |
application := Plug new. |
722 |
application respondTo:#value1Changed |
|
723 |
with:[value2 retractInterestsFor:application. |
|
724 |
value2 value:(value1 value isNil ifTrue:[nil] |
|
725 |
ifFalse:[value1 value squared]). |
|
726 |
value2 onChangeSend:#value2Changed to:application. |
|
727 |
]. |
|
728 |
application respondTo:#value2Changed |
|
729 |
with:[value1 retractInterestsFor:application. |
|
730 |
value1 value:(value2 value isNil ifTrue:[nil] |
|
731 |
ifFalse:[value2 value sqrt]). |
|
732 |
value1 onChangeSend:#value1Changed to:application. |
|
733 |
]. |
|
125 | 734 |
|
333 | 735 |
value1 := 1 asValue. |
736 |
value2 := 1 asValue. |
|
125 | 737 |
|
333 | 738 |
top := Dialog new. |
739 |
top extent:200@200. |
|
125 | 740 |
|
333 | 741 |
(top addTextLabel:'some number:') layout:#left. |
742 |
top addVerticalSpace. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
743 |
|
333 | 744 |
(top addInputFieldOn:value1 tabable:false) |
745 |
converter:(PrintConverter new initForNumberOrNil); |
|
746 |
immediateAccept:true. |
|
747 |
top addVerticalSpace. |
|
125 | 748 |
|
333 | 749 |
(top addTextLabel:'squared:') layout:#left. |
750 |
top addVerticalSpace. |
|
751 |
(top addInputFieldOn:value2 tabable:false) |
|
752 |
converter:(PrintConverter new initForNumberOrNil); |
|
753 |
immediateAccept:true. |
|
125 | 754 |
|
333 | 755 |
value1 onChangeSend:#value1Changed to:application. |
756 |
value2 onChangeSend:#value2Changed to:application. |
|
125 | 757 |
|
333 | 758 |
top openModeless. |
594 | 759 |
[exEnd] |
120 | 760 |
" |
19 | 761 |
! ! |
0 | 762 |
|
892 | 763 |
!EditField class methodsFor:'defaults'! |
0 | 764 |
|
125 | 765 |
defaultLeaveKeys |
128 | 766 |
"return the set of keys which are taken as leave-keys. |
767 |
If the field is in an enterFieldGroup, all leave keys will be |
|
768 |
forwarded to the group and possible step to the next/previous field. |
|
769 |
Also, if acceptOnLeave is true, leave keys will store the current |
|
770 |
value into their model (if any)" |
|
771 |
||
125 | 772 |
^ #(Return CursorUp CursorDown Next Previous Accept) |
773 |
! |
|
774 |
||
192 | 775 |
defaultNumberOfLines |
776 |
"the number of lines in the field" |
|
777 |
||
778 |
^ 1 |
|
779 |
! |
|
780 |
||
59 | 781 |
updateStyleCache |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
782 |
"extract values from the styleSheet and cache them in class variables" |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
783 |
|
1354 | 784 |
<resource: #style (#'editField.foregroundColor' #'editField.backgroundColor' |
785 |
#'editField.selectionForegroundColor' #'editFieldSelectionBackgroundColor' |
|
786 |
#'editField.font')> |
|
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
787 |
|
1354 | 788 |
DefaultForegroundColor := StyleSheet colorAt:'editField.foregroundColor' default:Black. |
789 |
DefaultBackgroundColor := StyleSheet colorAt:'editField.backgroundColor' default:White. |
|
1834 | 790 |
DefaultSelectionForegroundColor := StyleSheet colorAt:'editField.selectionForegroundColor' default:nil. |
791 |
DefaultSelectionForegroundColor isNil ifTrue:[ |
|
792 |
DefaultSelectionForegroundColor := StyleSheet colorAt:'selection.hilightForegroundColor' default:DefaultBackgroundColor. |
|
793 |
]. |
|
794 |
DefaultSelectionBackgroundColor := StyleSheet colorAt:'editField.selectionBackgroundColor' default:nil. |
|
795 |
DefaultSelectionBackgroundColor isNil ifTrue:[ |
|
796 |
DefaultSelectionBackgroundColor := StyleSheet colorAt:'selection.hilightBackgroundColor' default:DefaultForegroundColor. |
|
797 |
]. |
|
1354 | 798 |
DefaultFont := StyleSheet fontAt:'editField.font' default:nil. |
59 | 799 |
|
800 |
" |
|
60 | 801 |
self updateStyleCache |
59 | 802 |
" |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
803 |
|
1834 | 804 |
"Modified: / 31.3.1999 / 00:03:12 / cg" |
0 | 805 |
! ! |
806 |
||
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
807 |
!EditField methodsFor:'accepting'! |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
808 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
809 |
accept |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
810 |
|val string| |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
811 |
|
1108 | 812 |
acceptEnabled == false ifTrue:[ |
3046
c2d66c9ba0d8
Send #beep to window instead of device
Stefan Vogel <sv@exept.de>
parents:
2995
diff
changeset
|
813 |
self beep. |
1108 | 814 |
^ self |
815 |
]. |
|
816 |
||
2105 | 817 |
(acceptIfUnchanged not |
818 |
and:[model notNil |
|
819 |
and:[model value = self editValue]]) ifTrue:[^ self]. |
|
820 |
||
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
821 |
super accept. |
2105 | 822 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
823 |
converter notNil ifTrue:[ |
1108 | 824 |
val := self editValue. |
825 |
string := converter printStringFor:val. |
|
826 |
string ~= self contents ifTrue:[ |
|
827 |
self contents:string. |
|
828 |
self flash |
|
829 |
] |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
830 |
]. |
1108 | 831 |
|
832 |
"Modified: 7.3.1997 / 11:06:00 / cg" |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
833 |
! ! |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
834 |
|
2674 | 835 |
!EditField methodsFor:'accessing'! |
836 |
||
837 |
entryCompletionCharacter |
|
838 |
"return the value of the instance variable 'entryCompletionCharacter' (automatically generated)" |
|
839 |
||
840 |
^ entryCompletionCharacter |
|
2709
f0028ee0df76
leaving editor with cursorUp/down fixed (editing in a dataSet).
Claus Gittinger <cg@exept.de>
parents:
2708
diff
changeset
|
841 |
! |
f0028ee0df76
leaving editor with cursorUp/down fixed (editing in a dataSet).
Claus Gittinger <cg@exept.de>
parents:
2708
diff
changeset
|
842 |
|
f0028ee0df76
leaving editor with cursorUp/down fixed (editing in a dataSet).
Claus Gittinger <cg@exept.de>
parents:
2708
diff
changeset
|
843 |
leaveKey |
f0028ee0df76
leaving editor with cursorUp/down fixed (editing in a dataSet).
Claus Gittinger <cg@exept.de>
parents:
2708
diff
changeset
|
844 |
"only valid after the editField has been left via a leaveCharacter. |
f0028ee0df76
leaving editor with cursorUp/down fixed (editing in a dataSet).
Claus Gittinger <cg@exept.de>
parents:
2708
diff
changeset
|
845 |
Allows for users of the EditField to advance the selection |
f0028ee0df76
leaving editor with cursorUp/down fixed (editing in a dataSet).
Claus Gittinger <cg@exept.de>
parents:
2708
diff
changeset
|
846 |
(especially: DataSets to select next/prev if editor is left via CrsrUp/Down)" |
f0028ee0df76
leaving editor with cursorUp/down fixed (editing in a dataSet).
Claus Gittinger <cg@exept.de>
parents:
2708
diff
changeset
|
847 |
|
f0028ee0df76
leaving editor with cursorUp/down fixed (editing in a dataSet).
Claus Gittinger <cg@exept.de>
parents:
2708
diff
changeset
|
848 |
^ leaveKey |
2674 | 849 |
! ! |
850 |
||
192 | 851 |
!EditField methodsFor:'accessing-behavior'! |
125 | 852 |
|
2105 | 853 |
acceptIfUnchanged |
854 |
"return the acceptIfUnchanged flag setting. |
|
855 |
if set (the default), an accept notification is sent on accept, |
|
856 |
even if the fields value is the same. If cleared, |
|
857 |
the notification is suppressed, if the fields contents is the same." |
|
858 |
||
859 |
^ acceptIfUnchanged |
|
860 |
! |
|
861 |
||
862 |
acceptIfUnchanged:aBoolean |
|
863 |
"if set (the default), an accept notification is sent on accept, |
|
864 |
even if the fields value is the same. If cleared, |
|
865 |
the notification is suppressed, if the fields contents is the same." |
|
866 |
||
867 |
acceptIfUnchanged := aBoolean |
|
868 |
! |
|
869 |
||
2538
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
870 |
acceptOnLeave |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
871 |
"returnr the acceptOnLeave flag. The default is false. |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
872 |
If true, leaving the box (via return, cursor etc.) accepts my |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
873 |
string into the valueHolder (if any). |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
874 |
(actually, the set of keys can be specified with #leaveKeys:)" |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
875 |
|
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
876 |
^ acceptOnLeave |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
877 |
! |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
878 |
|
192 | 879 |
acceptOnLeave:aBoolean |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
880 |
"set/clear the acceptOnLeave flag. The default is false. |
892 | 881 |
If true, leaving the box (via return, cursor etc.) accepts my |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
882 |
string into the valueHolder (if any). |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
883 |
(actually, the set of keys can be specified with #leaveKeys:)" |
125 | 884 |
|
192 | 885 |
acceptOnLeave := aBoolean |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
886 |
|
892 | 887 |
"Modified: 11.12.1996 / 16:47:25 / cg" |
888 |
! |
|
889 |
||
3082 | 890 |
acceptOnLostFocus |
891 |
^ acceptOnLostFocus |
|
892 |
! |
|
893 |
||
892 | 894 |
acceptOnLostFocus:aBoolean |
895 |
"set/clear the acceptOnLostFocus flag. The default is false. |
|
896 |
If true, a lost focus (via mouse-pointer motion etc.) accepts my |
|
897 |
string into the valueHolder (if any)." |
|
898 |
||
899 |
acceptOnLostFocus := aBoolean |
|
900 |
||
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
901 |
"Modified: 16.12.1995 / 16:26:45 / cg" |
892 | 902 |
"Created: 11.12.1996 / 16:48:00 / cg" |
192 | 903 |
! |
904 |
||
1937
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
905 |
acceptOnPointerLeave:aBoolean |
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
906 |
"set/clear the acceptOnPointerLeave flag. The default is false. |
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
907 |
If true, a pointer leave (via mouse-pointer motion etc.) accepts my |
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
908 |
string into the valueHolder (if any)." |
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
909 |
|
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
910 |
acceptOnPointerLeave := aBoolean |
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
911 |
|
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
912 |
"Modified: / 16.12.1995 / 16:26:45 / cg" |
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
913 |
"Created: / 28.6.1999 / 18:07:38 / cg" |
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
914 |
! |
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
915 |
|
192 | 916 |
acceptOnReturn:aBoolean |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
917 |
"set/clear the acceptOnReturn flag. The default is false. |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
918 |
If true, leaving the box via return accepts my |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
919 |
string into the valueHolder (if any)." |
192 | 920 |
|
921 |
acceptOnReturn := aBoolean |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
922 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
923 |
"Modified: 16.12.1995 / 16:25:34 / cg" |
125 | 924 |
! |
925 |
||
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
926 |
acceptOnTab:aBoolean |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
927 |
"set/clear the acceptOnTab flag. The default is true. |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
928 |
If true, a pressed Tab key accepts and leaves the box. |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
929 |
If false, the Tab key is treated like any normal input character |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
930 |
(i.e. inserted into the contents)." |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
931 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
932 |
acceptOnTab := aBoolean |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
933 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
934 |
"Created: 24.1.1996 / 13:13:37 / cg" |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
935 |
! |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
936 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
937 |
autoScroll:aBoolean |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
938 |
"turn on/off automatic scrolling upon keyboard entry |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
939 |
to make the cursor visible." |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
940 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
941 |
autoScrollHorizontally := aBoolean |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
942 |
! |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
943 |
|
325 | 944 |
clickAction:aBlock |
945 |
"define an action to be evaluated when being clicked upon" |
|
946 |
||
947 |
clickAction := aBlock |
|
948 |
! |
|
949 |
||
2792 | 950 |
converter |
951 |
"return the converter (if any)." |
|
952 |
||
953 |
^ converter |
|
954 |
! |
|
955 |
||
956 |
converter:aConverter |
|
957 |
"set the converter. If non-nil, |
|
958 |
the converter is applied to the text to convert from the string |
|
959 |
representation to the actual object value and vice versa. |
|
960 |
The default converter is nil, meaning no-conversion |
|
961 |
(i.e. the edited object is the string itself." |
|
962 |
||
963 |
converter := aConverter |
|
964 |
! |
|
965 |
||
192 | 966 |
crAction:aBlock |
967 |
"define an action to be evaluated when the return key is pressed." |
|
968 |
||
969 |
crAction := aBlock |
|
970 |
! |
|
125 | 971 |
|
3216 | 972 |
doubleClickAction:aBlock |
973 |
"define an action to be evaluated when being double clicked upon" |
|
974 |
||
975 |
doubleClickAction := aBlock |
|
976 |
! |
|
977 |
||
1034 | 978 |
enabled |
979 |
"return true, if the field is enabled (i.e. accepts keyboard input)" |
|
980 |
||
981 |
^ enabled ? true |
|
982 |
||
983 |
! |
|
984 |
||
1829 | 985 |
enabled:aBoolean |
986 |
"enable/disable the field; show/hide the cursor and allow/disallow input" |
|
987 |
||
988 |
enabled ~~ aBoolean ifTrue:[ |
|
989 |
enabled := aBoolean. |
|
990 |
self updateBackground. |
|
991 |
super cursorShown:aBoolean |
|
992 |
] |
|
993 |
||
994 |
"Modified: / 3.8.1998 / 17:52:18 / cg" |
|
995 |
"Created: / 30.3.1999 / 15:19:17 / stefan" |
|
996 |
"Modified: / 30.3.1999 / 16:00:43 / stefan" |
|
997 |
! |
|
998 |
||
2993 | 999 |
entryCompletionBlock |
1000 |
"the action to be evaluated when Tab (EntryCompletionCharacter) is pressed. |
|
1001 |
The block gets the current contents and the field itself as optional arguments |
|
1002 |
(i.e. it can be a 0, 1 or 2-arg block)." |
|
1003 |
||
1004 |
"/ read comment in entryCompletionBlockHolder: on why the following kludge is present |
|
1005 |
entryCompletionBlock isBlock ifTrue:[ |
|
1006 |
^ entryCompletionBlock |
|
1007 |
]. |
|
1008 |
^ entryCompletionBlock value |
|
1009 |
! |
|
1010 |
||
2995 | 1011 |
entryCompletionBlock:aZeroOneOrTwoArgBlock |
2993 | 1012 |
"define an action to be evaluated when Tab (EntryCompletionCharacter) is pressed. |
2628 | 1013 |
The block gets the current contents and the field itself as optional arguments |
1014 |
(i.e. it can be a 0, 1 or 2-arg block)." |
|
192 | 1015 |
|
2995 | 1016 |
entryCompletionBlock := aZeroOneOrTwoArgBlock |
125 | 1017 |
! |
1018 |
||
2995 | 1019 |
entryCompletionBlockHolder:aZeroOneOrTwoArgBlock |
2993 | 1020 |
"a holder for an action to be evaluated when Tab (EntryCompletionCharacter) is pressed. |
1021 |
The block gets the current contents and the field itself as optional arguments |
|
1022 |
(i.e. it can be a 0, 1 or 2-arg block)." |
|
1023 |
||
1024 |
"/ for now (to avoid incompatibilities), misuse the existing |
|
1025 |
"/ entryCompletionBlock and check if its a holder. |
|
1026 |
||
2995 | 1027 |
entryCompletionBlock := aZeroOneOrTwoArgBlock |
2993 | 1028 |
! |
1029 |
||
192 | 1030 |
immediateAccept:aBoolean |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1031 |
"set/clear the immediateAccept flag. The default is false. |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1032 |
If true, every pressed key immediately accepts my |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1033 |
string into the valueHolder (if any)." |
155 | 1034 |
|
192 | 1035 |
immediateAccept := aBoolean |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1036 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1037 |
"Modified: 16.12.1995 / 16:25:57 / cg" |
192 | 1038 |
! |
155 | 1039 |
|
995 | 1040 |
isAcceptOnLeave |
1041 |
"return the acceptOnLeave flag. The default is false. |
|
1042 |
If true, leaving the box (via return, cursor etc.) accepts my |
|
1043 |
string into the valueHolder (if any). |
|
1044 |
(actually, the set of keys can be specified with #leaveKeys:)" |
|
1045 |
||
1046 |
^ acceptOnLeave |
|
1047 |
||
1048 |
"Modified: 11.12.1996 / 16:47:25 / cg" |
|
1049 |
! |
|
1050 |
||
1051 |
isAcceptOnLostFocus |
|
1052 |
"return the acceptOnLostFocus flag. The default is false. |
|
1053 |
If true, a lost focus (via mouse-pointer motion etc.) accepts my |
|
1054 |
string into the valueHolder (if any)." |
|
1055 |
||
1056 |
^ acceptOnLostFocus |
|
1057 |
||
1058 |
"Modified: 16.12.1995 / 16:26:45 / cg" |
|
1059 |
"Created: 11.12.1996 / 16:48:00 / cg" |
|
1060 |
! |
|
1061 |
||
1062 |
isAcceptOnReturn |
|
1063 |
"return the acceptOnReturn flag. The default is false. |
|
1064 |
If true, leaving the box via return accepts my |
|
1065 |
string into the valueHolder (if any)." |
|
1066 |
||
1067 |
^ acceptOnReturn |
|
1068 |
||
1069 |
"Modified: 16.12.1995 / 16:25:34 / cg" |
|
1070 |
! |
|
1071 |
||
1072 |
isAcceptOnTab |
|
1073 |
"return the acceptOnTab flag. The default is true. |
|
1074 |
If true, a pressed Tab key accepts and leaves the box. |
|
1075 |
If false, the Tab key is treated like any normal input character |
|
1076 |
(i.e. inserted into the contents)." |
|
1077 |
||
1078 |
^ acceptOnTab |
|
1079 |
! |
|
1080 |
||
994 | 1081 |
isImmediateAccept |
1082 |
"return the immediateAccept flag. The default is false. |
|
1083 |
If true, every pressed key immediately accepts my |
|
1084 |
string into the valueHolder (if any)." |
|
1085 |
||
1086 |
^ immediateAccept |
|
1087 |
||
1088 |
"Modified: 16.12.1995 / 16:25:57 / cg" |
|
1089 |
! |
|
1090 |
||
192 | 1091 |
leaveAction:aBlock |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1092 |
"define an action to be evaluated when field is left by return or cursor keys. |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1093 |
(actually, the set of keys can be specified with #leaveKeys:)" |
192 | 1094 |
|
1095 |
leaveAction := aBlock |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1096 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1097 |
"Modified: 16.12.1995 / 16:26:36 / cg" |
155 | 1098 |
! |
1099 |
||
1997 | 1100 |
leaveKeys |
1998 | 1101 |
"return (a copy of) the collection of keys which are interpreted as leaveKeys. |
1102 |
I.e. those that make the field inactive and pass the focus to the next field |
|
1103 |
(and accept, if acceptOnLeave is true)" |
|
1997 | 1104 |
|
1105 |
^ leaveKeys copy |
|
1106 |
! |
|
1107 |
||
192 | 1108 |
leaveKeys:aCollectionOfKeySymbols |
1109 |
"define the set of keys which are interpreted as leaveKeys. |
|
1110 |
I.e. those that make the field inactive and accept (if acceptOnLeave is true). |
|
1111 |
The default is a set of #CursorUp, #CursorDown, #Next, #Prior and #Return." |
|
155 | 1112 |
|
192 | 1113 |
leaveKeys := aCollectionOfKeySymbols |
1114 |
! |
|
155 | 1115 |
|
594 | 1116 |
makeTabable |
1117 |
"arrange for Tab to accept & leave the field |
|
1118 |
If the field is part of a group, the next field gets the |
|
1119 |
input focus" |
|
1120 |
||
1121 |
leaveKeys isNil ifTrue:[ |
|
1122 |
leaveKeys := self class defaultLeaveKeys |
|
1123 |
]. |
|
1124 |
leaveKeys := leaveKeys copyWith:#Tab |
|
1125 |
||
1126 |
"Created: 27.4.1996 / 17:09:48 / cg" |
|
1127 |
! |
|
1128 |
||
1609
8a0c1ee30a0a
readOnly fields change the backgroundColor to grey.
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
1129 |
readOnly:aBoolean |
8a0c1ee30a0a
readOnly fields change the backgroundColor to grey.
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
1130 |
"make the text readonly or writable" |
8a0c1ee30a0a
readOnly fields change the backgroundColor to grey.
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
1131 |
|
8a0c1ee30a0a
readOnly fields change the backgroundColor to grey.
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
1132 |
super readOnly:aBoolean. |
1631
f8fae6670540
change viewBackground, when either disabled or readOnly.
Claus Gittinger <cg@exept.de>
parents:
1616
diff
changeset
|
1133 |
self updateBackground. |
1609
8a0c1ee30a0a
readOnly fields change the backgroundColor to grey.
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
1134 |
|
8a0c1ee30a0a
readOnly fields change the backgroundColor to grey.
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
1135 |
"Created: / 26.7.1998 / 21:23:17 / cg" |
1631
f8fae6670540
change viewBackground, when either disabled or readOnly.
Claus Gittinger <cg@exept.de>
parents:
1616
diff
changeset
|
1136 |
"Modified: / 3.8.1998 / 17:52:38 / cg" |
1609
8a0c1ee30a0a
readOnly fields change the backgroundColor to grey.
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
1137 |
! |
8a0c1ee30a0a
readOnly fields change the backgroundColor to grey.
Claus Gittinger <cg@exept.de>
parents:
1547
diff
changeset
|
1138 |
|
1842 | 1139 |
returnKeyIsFocusNext |
1140 |
"arrange for the return key to act as a focus-next key" |
|
1141 |
||
1142 |
leaveKeys := leaveKeys copy asOrderedCollection. |
|
1143 |
leaveKeys remove:#Return ifAbsent:nil |
|
1144 |
! |
|
1145 |
||
192 | 1146 |
tabAction:aBlock |
1147 |
"define an action to be evaluated when the tabulator key is pressed." |
|
155 | 1148 |
|
192 | 1149 |
tabAction := aBlock |
594 | 1150 |
! |
1151 |
||
1152 |
tabKey:aKeySymbol |
|
1153 |
"arrange for aKeySymbol to accept & leave the field |
|
1154 |
If the field is part of a group, the next field gets the |
|
1155 |
input focus" |
|
1156 |
||
1157 |
leaveKeys isNil ifTrue:[ |
|
1158 |
leaveKeys := self class defaultLeaveKeys |
|
1159 |
]. |
|
1160 |
leaveKeys := leaveKeys copyWith:#Tab |
|
1161 |
||
1162 |
"Created: 27.4.1996 / 17:08:54 / cg" |
|
187 | 1163 |
! ! |
125 | 1164 |
|
187 | 1165 |
!EditField methodsFor:'accessing-contents'! |
125 | 1166 |
|
187 | 1167 |
contents |
1168 |
"return contents as a string |
|
1169 |
- redefined since EditFields hold only one line of text. |
|
1170 |
In your application, please use #editValue; |
|
1171 |
it uses a converter (if any) and is compatible to ST-80." |
|
1172 |
||
1173 |
list isNil ifTrue:[^ '']. |
|
1174 |
(list size == 0) ifTrue:[^ '']. |
|
1175 |
^ list at:1 |
|
1176 |
! |
|
1177 |
||
125 | 1178 |
contents:someText |
1179 |
"set the contents from a string |
|
1180 |
- redefined to place the cursor to the end. |
|
1181 |
In your application, please use #editValue:; |
|
1182 |
it uses a converter (if any) and is compatible to ST-80." |
|
1183 |
||
1180
abe00ac05e27
oops - care for nil contents
Claus Gittinger <cg@exept.de>
parents:
1179
diff
changeset
|
1184 |
|newCol txt| |
187 | 1185 |
|
1186 |
newCol := cursorCol. |
|
1187 |
||
2042 | 1188 |
someText notNil ifTrue:[ |
1189 |
(someText respondsTo:#asString) ifTrue:[ |
|
1190 |
txt := someText asString |
|
1191 |
] |
|
1180
abe00ac05e27
oops - care for nil contents
Claus Gittinger <cg@exept.de>
parents:
1179
diff
changeset
|
1192 |
]. |
abe00ac05e27
oops - care for nil contents
Claus Gittinger <cg@exept.de>
parents:
1179
diff
changeset
|
1193 |
super contents:txt. |
125 | 1194 |
|
2130
40515380f762
moved control over how-to-move-the-cursor when updating text
Claus Gittinger <cg@exept.de>
parents:
2105
diff
changeset
|
1195 |
(cursorMovementWhenUpdating == #endOfLine |
40515380f762
moved control over how-to-move-the-cursor when updating text
Claus Gittinger <cg@exept.de>
parents:
2105
diff
changeset
|
1196 |
or:[cursorMovementWhenUpdating == #endOfText |
40515380f762
moved control over how-to-move-the-cursor when updating text
Claus Gittinger <cg@exept.de>
parents:
2105
diff
changeset
|
1197 |
or:[cursorMovementWhenUpdating == #end]]) ifTrue:[ |
1180
abe00ac05e27
oops - care for nil contents
Claus Gittinger <cg@exept.de>
parents:
1179
diff
changeset
|
1198 |
newCol := (txt size + 1). |
187 | 1199 |
] ifFalse:[ |
2130
40515380f762
moved control over how-to-move-the-cursor when updating text
Claus Gittinger <cg@exept.de>
parents:
2105
diff
changeset
|
1200 |
(cursorMovementWhenUpdating == #beginOfLine |
40515380f762
moved control over how-to-move-the-cursor when updating text
Claus Gittinger <cg@exept.de>
parents:
2105
diff
changeset
|
1201 |
or:[cursorMovementWhenUpdating == #beginOfText |
40515380f762
moved control over how-to-move-the-cursor when updating text
Claus Gittinger <cg@exept.de>
parents:
2105
diff
changeset
|
1202 |
or:[cursorMovementWhenUpdating == #begin]]) ifTrue:[ |
1179 | 1203 |
newCol := 1 |
1204 |
] ifFalse:[ |
|
1205 |
"/ default: stay where it was |
|
1206 |
] |
|
187 | 1207 |
]. |
125 | 1208 |
|
187 | 1209 |
self cursorCol:newCol. |
1179 | 1210 |
|
2042 | 1211 |
"Modified: / 13.11.1999 / 13:50:30 / cg" |
125 | 1212 |
! |
1213 |
||
1214 |
editValue |
|
1215 |
"if the field edits a string, this is a name alias for #contents. |
|
1216 |
Otherwise, if there is a converter, return the edited string |
|
1217 |
converted to an appropriate object." |
|
1218 |
||
1219 |
|string| |
|
1220 |
||
1221 |
string := self contents. |
|
279 | 1222 |
string isNil ifTrue:[string := '']. |
125 | 1223 |
converter isNil ifTrue:[^ string]. |
1224 |
^ converter readValueFrom:string |
|
1225 |
! |
|
0 | 1226 |
|
125 | 1227 |
editValue:aStringOrObject |
1228 |
"set the contents. If there is a converter, use it to convert |
|
1229 |
the object into a printed representation. |
|
1230 |
Otherwise, the argument is supposed to be a string like object, |
|
1231 |
and used directly (i.e. this is equivalent to sending #contents:)." |
|
1232 |
||
1233 |
self editValue:aStringOrObject selected:false |
|
0 | 1234 |
! |
1235 |
||
125 | 1236 |
editValue:aStringOrObject selected:aBoolean |
1237 |
"set the contents. If there is a converter, use it to convert |
|
1238 |
the object into a printed representation. |
|
1239 |
Otherwise, the argument is supposed to be a string like object, |
|
187 | 1240 |
and used directly (i.e. this is equivalent to sending #initialText:selected:)." |
125 | 1241 |
|
1242 |
|string| |
|
1243 |
||
1244 |
converter notNil ifTrue:[ |
|
1245 |
string := converter printStringFor:aStringOrObject |
|
1246 |
] ifFalse:[ |
|
1247 |
string := aStringOrObject. |
|
1248 |
]. |
|
1249 |
self contents:string. |
|
1250 |
aBoolean ifTrue:[ |
|
1251 |
self selectFromLine:1 col:1 toLine:1 col:string size |
|
1252 |
] |
|
1253 |
! |
|
1254 |
||
192 | 1255 |
initialText:aString |
1256 |
"set the initialText and select it" |
|
1257 |
||
1258 |
self initialText:aString selected:true |
|
1259 |
! |
|
1260 |
||
187 | 1261 |
initialText:aString selected:aBoolean |
1262 |
"set the initialText and select it if aBoolean is true" |
|
1263 |
||
1264 |
|len s| |
|
125 | 1265 |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1266 |
viewOrigin := 0 @ viewOrigin y. |
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1267 |
|
187 | 1268 |
(s := aString) notNil ifTrue:[ |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1269 |
s := s asString |
187 | 1270 |
]. |
1271 |
self contents:s. |
|
1272 |
aBoolean ifTrue:[ |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1273 |
(len := s size) ~~ 0 ifTrue:[ |
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1274 |
self selectFromLine:1 col:1 toLine:1 col:len |
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1275 |
] |
187 | 1276 |
] |
1277 |
! |
|
1278 |
||
192 | 1279 |
list:someText |
1280 |
"low level access to the underlying contents' list. |
|
1281 |
Redefined to force text to 1 line, and notify dependents |
|
1282 |
of any changed extent-wishes (for automatic box resizing)." |
|
1283 |
||
1284 |
|l oldWidth| |
|
187 | 1285 |
|
192 | 1286 |
l := someText. |
1287 |
l size > 1 ifTrue:[ |
|
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1288 |
l := OrderedCollection with:(l at:1) |
192 | 1289 |
]. |
1290 |
oldWidth := self widthOfContents. |
|
1291 |
super list:l. |
|
1292 |
self widthOfContents ~~ oldWidth ifTrue:[ |
|
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1293 |
self changedPreferredBounds:nil |
192 | 1294 |
] |
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1295 |
|
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1296 |
"Modified: 6.3.1997 / 16:13:36 / cg" |
187 | 1297 |
! |
1298 |
||
1299 |
stringValue |
|
1300 |
"alias for #contents - for compatibility with ST-80's InputField" |
|
1301 |
||
1302 |
^ self contents |
|
1303 |
! ! |
|
1304 |
||
1305 |
!EditField methodsFor:'accessing-look'! |
|
125 | 1306 |
|
3585 | 1307 |
bePassword |
1308 |
"make me a password entry field (i.e. show *'s for typed characters" |
|
1309 |
||
1310 |
self passwordCharacter:$* |
|
1311 |
! |
|
1312 |
||
155 | 1313 |
maxChars |
1314 |
"return the maximum number of characters that are allowed in |
|
1315 |
the field. |
|
1316 |
A limit of nil means: unlimited. This is the default." |
|
1317 |
||
1318 |
^ lengthLimit |
|
1319 |
||
1320 |
"Modified: 6.9.1995 / 13:43:33 / claus" |
|
1321 |
! |
|
1322 |
||
125 | 1323 |
maxChars:aNumberOrNil |
1324 |
"set the maximum number of characters that are allowed in |
|
1325 |
the field. Additional input will be ignored by the field. |
|
1034 | 1326 |
A limit of nil or zero means: unlimited. This is the default. |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1327 |
If set, a lengthLimit must be defined before any contents is placed |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1328 |
into the field, because the contents is not cut when the max is |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1329 |
changed later. I.e. it should be set early after creation of the field. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1330 |
|
125 | 1331 |
This method has been renamed from #lengthLimit: for ST-80 |
1332 |
compatibility." |
|
1333 |
||
1034 | 1334 |
aNumberOrNil == 0 ifTrue:[ |
1335 |
lengthLimit := nil |
|
1336 |
] ifFalse:[ |
|
1337 |
lengthLimit := aNumberOrNil. |
|
1338 |
] |
|
187 | 1339 |
! |
1340 |
||
192 | 1341 |
passwordCharacter |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1342 |
"return the passwordCharacter; |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1343 |
If nonNil, that one is replacing typed input |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1344 |
(for secret input)" |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1345 |
|
192 | 1346 |
^ passwordCharacter |
0 | 1347 |
|
192 | 1348 |
"Modified: 6.9.1995 / 12:25:39 / claus" |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1349 |
"Modified: 16.12.1995 / 16:24:25 / cg" |
125 | 1350 |
! |
1351 |
||
192 | 1352 |
passwordCharacter:aCharacter |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1353 |
"set the passwordCharacter; |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1354 |
If nonNil, that one is replacing typed input |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1355 |
(for secret input)" |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1356 |
|
192 | 1357 |
passwordCharacter := aCharacter |
97 | 1358 |
|
192 | 1359 |
"Modified: 6.9.1995 / 12:25:33 / claus" |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1360 |
"Modified: 16.12.1995 / 16:24:33 / cg" |
38 | 1361 |
! ! |
1362 |
||
1829 | 1363 |
!EditField methodsFor:'cursor drawing'! |
1364 |
||
1365 |
cursorShown:aBoolean |
|
1366 |
"make cursor visible if currently invisible - but only if this |
|
1880 | 1367 |
EditField is enabled. |
1368 |
Return the previous cursor-shown-state" |
|
1399 | 1369 |
|
1836 | 1370 |
^ super cursorShown:(aBoolean and:[enabled and:[self isReadOnly not]]) |
1399 | 1371 |
|
1829 | 1372 |
"Created: / 30.3.1999 / 16:00:25 / stefan" |
1880 | 1373 |
"Modified: / 1.4.1999 / 11:18:38 / cg" |
1829 | 1374 |
! |
0 | 1375 |
|
155 | 1376 |
drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg |
1377 |
startVisLineNr to:endVisLineNr do:[:visLine | |
|
1378 |
self drawVisibleLine:visLine with:fg and:bg |
|
1379 |
] |
|
1380 |
||
1381 |
"Modified: 6.9.1995 / 12:24:29 / claus" |
|
0 | 1382 |
! ! |
1383 |
||
1384 |
!EditField methodsFor:'cursor movement'! |
|
1385 |
||
1386 |
cursorDown |
|
1387 |
"catch cursor movement" |
|
1388 |
||
1389 |
(cursorVisibleLine == nLinesShown) ifFalse:[ |
|
59 | 1390 |
super cursorDown |
0 | 1391 |
] |
192 | 1392 |
! |
1393 |
||
1394 |
cursorLine:line col:col |
|
1395 |
"catch cursor movement" |
|
1396 |
||
1397 |
super cursorLine:1 col:col |
|
673
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1398 |
! |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1399 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1400 |
validateCursorCol:col inLine:line |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1401 |
"check of col is a valid cursor position; |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1402 |
return a fixed value if not." |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1403 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1404 |
|sz| |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1405 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1406 |
sz := self contents size. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1407 |
lengthLimit notNil ifTrue:[ |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1408 |
sz := sz min:lengthLimit. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1409 |
]. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1410 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1411 |
col <= sz ifTrue:[ |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1412 |
^ col |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1413 |
]. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1414 |
^ sz + 1. "/ to allow positioning right behind the string |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1415 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1416 |
"Created: 22.5.1996 / 18:17:27 / cg" |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1417 |
"Modified: 22.5.1996 / 18:19:04 / cg" |
192 | 1418 |
! ! |
1419 |
||
3413 | 1420 |
!EditField methodsFor:'drag & drop'! |
1421 |
||
1422 |
dropFileObject:aDropObject |
|
1423 |
"drop objects |
|
1424 |
Redefined to always drop the name only" |
|
1425 |
||
3494 | 1426 |
self undoablePaste:(aDropObject asFilename pathName) info:'drop filename'. |
3413 | 1427 |
|
1428 |
"Created: / 13-10-2006 / 17:42:22 / cg" |
|
3494 | 1429 |
"Modified: / 28-07-2007 / 13:27:32 / cg" |
3413 | 1430 |
! ! |
1431 |
||
192 | 1432 |
!EditField methodsFor:'editing'! |
1433 |
||
1434 |
paste:someText |
|
1435 |
"redefined to force text to 1 line" |
|
1436 |
||
1437 |
super paste:someText. |
|
1438 |
list size > 1 ifTrue:[ |
|
1439 |
self deleteFromLine:2 toLine:(list size) |
|
1440 |
] |
|
0 | 1441 |
! ! |
1442 |
||
70 | 1443 |
!EditField methodsFor:'event handling'! |
19 | 1444 |
|
192 | 1445 |
buttonPress:button x:x y:y |
1446 |
"enable myself on mouse click" |
|
1447 |
||
673
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1448 |
|prevFocus| |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1449 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1450 |
enabled ifFalse:[^ self]. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1451 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1452 |
prevFocus := hasKeyboardFocus. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1453 |
clickAction notNil ifTrue:[ |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1454 |
clickAction value:self |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1455 |
]. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1456 |
hasKeyboardFocus ~~ prevFocus ifTrue:[ |
333 | 1457 |
^ self |
1458 |
]. |
|
1459 |
||
316
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1460 |
super buttonPress:button x:x y:y |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1461 |
|
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1462 |
"/ enabled ifFalse:[ |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1463 |
"/ enabled := true. |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1464 |
"/ super buttonPress:button x:x y:y. |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1465 |
"/ enableAction notNil ifTrue:[ |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1466 |
"/ enableAction value |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1467 |
"/ ] |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1468 |
"/ ] ifTrue:[ |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1469 |
"/ super buttonPress:button x:x y:y |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1470 |
"/ ] |
333 | 1471 |
|
673
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1472 |
"Modified: 22.5.1996 / 15:02:45 / cg" |
192 | 1473 |
! |
1474 |
||
1475 |
canHandle:aKey |
|
1476 |
"return true, if the receiver would like to handle aKey |
|
1477 |
(usually from another view, when the receiver is part of |
|
1478 |
a more complex dialog box). |
|
1479 |
We do return true here, since the editfield will handle |
|
1480 |
all keys. |
|
1481 |
OBSOLETE: dont use this anymore - its a leftover for the tableWidget" |
|
1482 |
||
1483 |
^ true |
|
1484 |
! |
|
1485 |
||
3216 | 1486 |
doubleClickX:x y:y |
1487 |
doubleClickAction notNil ifTrue: [ |
|
1488 |
doubleClickAction value. |
|
1489 |
]. |
|
1490 |
||
1491 |
super doubleClickX:x y:y |
|
1492 |
! |
|
1493 |
||
3460 | 1494 |
handleFocusKey:key |
3535 | 1495 |
"handle a focus key, to assign the focus to another field in my group" |
1496 |
||
3460 | 1497 |
<resource: #keyboard (#Tab #Return #CursorDown #CursorUp)> |
1498 |
||
1499 |
windowGroup isNil ifTrue:[^ self ]. |
|
1500 |
||
1501 |
(key == #Tab) ifTrue:[ |
|
1502 |
(self tabRequiresControl not |
|
1503 |
or:[ self sensor ctrlDown ]) ifTrue:[ |
|
1504 |
self sensor shiftDown ifTrue:[ |
|
1505 |
windowGroup focusPrevious |
|
1506 |
] ifFalse:[ |
|
1507 |
windowGroup focusNext |
|
1508 |
]. |
|
1509 |
]. |
|
1510 |
^ self |
|
1511 |
]. |
|
1512 |
||
1513 |
(key == #Return) ifTrue:[ |
|
1514 |
windowGroup focusNext. |
|
1515 |
^ self |
|
1516 |
]. |
|
1517 |
||
1518 |
key == #CursorDown ifTrue:[ |
|
1519 |
windowGroup focusNext. |
|
1520 |
^ self. |
|
1521 |
]. |
|
1522 |
key == #CursorUp ifTrue:[ |
|
1523 |
windowGroup focusPrevious. |
|
1524 |
^ self. |
|
1525 |
]. |
|
1526 |
||
1527 |
"Created: / 06-03-2007 / 20:14:04 / cg" |
|
1528 |
! |
|
1529 |
||
125 | 1530 |
keyPress:key x:x y:y |
1531 |
"if keyHandler is defined, pass input; otherwise check for leave |
|
1532 |
keys" |
|
1533 |
||
490 | 1534 |
<resource: #keyboard (#Tab #Return #Find #FindNext #FindPrev |
922 | 1535 |
#DeleteLine #GotoLine #EndOfLine #EndOfText |
1536 |
#CursorDown #CursorUp)> |
|
132 | 1537 |
|
3462
447eb65a523f
check for numArgs == 0 before evaluating the keyAction
boris
parents:
3461
diff
changeset
|
1538 |
|leave oldContents newContents doAccept keyAction didAccept numArgs| |
125 | 1539 |
|
1540 |
enabled ifFalse:[ |
|
325 | 1541 |
^ self |
125 | 1542 |
]. |
1543 |
||
1544 |
(key == #DeleteLine) ifTrue:[ |
|
325 | 1545 |
Smalltalk at:#CopyBuffer put:(self contents). |
1546 |
self contents:''. ^ self |
|
125 | 1547 |
]. |
19 | 1548 |
|
3460 | 1549 |
(key == entryCompletionCharacter and:[self entryCompletionBlock notNil]) ifTrue:[ |
979 | 1550 |
oldContents := self contents. |
1551 |
oldContents isNil ifTrue:[ |
|
1552 |
oldContents := '' |
|
1553 |
] ifFalse:[ |
|
978
6e678fdc6e5b
allow non-Tab as entryCompleter; care for immediateAccept after completion
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1554 |
oldContents := oldContents asString |
6e678fdc6e5b
allow non-Tab as entryCompleter; care for immediateAccept after completion
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1555 |
]. |
6e678fdc6e5b
allow non-Tab as entryCompleter; care for immediateAccept after completion
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1556 |
|
2993 | 1557 |
self entryCompletionBlock valueWithOptionalArgument:oldContents and:self. |
978
6e678fdc6e5b
allow non-Tab as entryCompleter; care for immediateAccept after completion
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1558 |
|
979 | 1559 |
newContents := self contents. |
1560 |
newContents isNil ifTrue:[ |
|
1561 |
newContents := '' |
|
1562 |
] ifFalse:[ |
|
1563 |
newContents := newContents asString |
|
1564 |
]. |
|
1565 |
newContents ~= oldContents ifTrue:[ |
|
1566 |
self textChanged |
|
1567 |
]. |
|
1568 |
^ self |
|
978
6e678fdc6e5b
allow non-Tab as entryCompleter; care for immediateAccept after completion
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1569 |
]. |
6e678fdc6e5b
allow non-Tab as entryCompleter; care for immediateAccept after completion
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1570 |
|
125 | 1571 |
(key == #Tab) ifTrue:[ |
3460 | 1572 |
doAccept := acceptOnTab. |
1573 |
keyAction := tabAction. |
|
1574 |
]. |
|
1575 |
(key == #Return) ifTrue:[ |
|
1576 |
doAccept := acceptOnReturn. |
|
1577 |
keyAction := crAction. |
|
1578 |
]. |
|
1579 |
||
1580 |
leave := leaveKeys includes:key. |
|
1581 |
leave ifTrue:[ |
|
1582 |
leaveKey := key. |
|
1583 |
doAccept := doAccept ? acceptOnLeave. |
|
1584 |
keyAction := keyAction ? leaveAction. |
|
1585 |
]. |
|
1586 |
||
1587 |
doAccept == true ifTrue:[ |
|
1588 |
self accept. |
|
1589 |
didAccept := true. |
|
1590 |
]. |
|
1591 |
||
1592 |
keyAction notNil ifTrue:[ |
|
3462
447eb65a523f
check for numArgs == 0 before evaluating the keyAction
boris
parents:
3461
diff
changeset
|
1593 |
numArgs := keyAction numArgs. |
447eb65a523f
check for numArgs == 0 before evaluating the keyAction
boris
parents:
3461
diff
changeset
|
1594 |
|
447eb65a523f
check for numArgs == 0 before evaluating the keyAction
boris
parents:
3461
diff
changeset
|
1595 |
numArgs == 2 ifTrue:[ |
3460 | 1596 |
^ keyAction value:self value:key |
964
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1597 |
]. |
3462
447eb65a523f
check for numArgs == 0 before evaluating the keyAction
boris
parents:
3461
diff
changeset
|
1598 |
numArgs == 0 ifTrue:[ |
447eb65a523f
check for numArgs == 0 before evaluating the keyAction
boris
parents:
3461
diff
changeset
|
1599 |
^ keyAction value |
447eb65a523f
check for numArgs == 0 before evaluating the keyAction
boris
parents:
3461
diff
changeset
|
1600 |
]. |
3460 | 1601 |
^ keyAction value:key |
125 | 1602 |
]. |
480 | 1603 |
|
125 | 1604 |
leave ifTrue:[ |
611
87637cf3931b
Handle keypress:key x:nil y:nil correctly (means recursion).
Stefan Vogel <sv@exept.de>
parents:
601
diff
changeset
|
1605 |
(x notNil and:[x >= 0]) ifTrue:[ |
325 | 1606 |
" |
737
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1607 |
we do not handle this key directly. |
611
87637cf3931b
Handle keypress:key x:nil y:nil correctly (means recursion).
Stefan Vogel <sv@exept.de>
parents:
601
diff
changeset
|
1608 |
let superview know about the key that caused us to leave (maybe RETURN, DOWN, UP etc.... |
325 | 1609 |
" |
1610 |
(superView notNil and:[superView canHandle:key from:self]) ifTrue:[ |
|
1611 |
superView keyPress:key x:x y:y. |
|
1612 |
]. |
|
1613 |
]. |
|
737
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1614 |
|
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1615 |
"/ a leave, but no action defined |
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1616 |
"/ forward it as a Focus-step |
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1617 |
key == #CursorDown ifTrue:[ |
3460 | 1618 |
self handleFocusKey:key. |
2708
dfdf8977e9ba
care for nil windogroup (editor in dataSet)
Claus Gittinger <cg@exept.de>
parents:
2707
diff
changeset
|
1619 |
^ self. |
737
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1620 |
]. |
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1621 |
key == #CursorUp ifTrue:[ |
3460 | 1622 |
self handleFocusKey:key. |
2708
dfdf8977e9ba
care for nil windogroup (editor in dataSet)
Claus Gittinger <cg@exept.de>
parents:
2707
diff
changeset
|
1623 |
^ self. |
737
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1624 |
]. |
325 | 1625 |
^ self |
19 | 1626 |
]. |
121 | 1627 |
|
125 | 1628 |
" |
1629 |
ignore some keys (if not a leaveKey) ... |
|
1630 |
" |
|
1631 |
(key == #Find) ifTrue:[^self]. |
|
1632 |
(key == #FindNext) ifTrue:[^self]. |
|
1633 |
(key == #FindPrev) ifTrue:[^self]. |
|
1634 |
(key == #GotoLine) ifTrue:[^self]. |
|
1635 |
||
1636 |
" |
|
1637 |
a normal key - let superclass's method insert it |
|
1638 |
" |
|
1639 |
super keyPress:key x:x y:y. |
|
1640 |
||
1641 |
" |
|
1642 |
for end-of-text, also move to end-of-line |
|
1643 |
" |
|
1644 |
key == #EndOfText ifTrue:[ |
|
325 | 1645 |
super keyPress:#EndOfLine x:x y:y. |
125 | 1646 |
]. |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1647 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1648 |
self resizeOrScroll. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1649 |
|
3460 | 1650 |
"Modified: / 02-05-1996 / 17:24:16 / stefan" |
1651 |
"Modified: / 06-03-2007 / 20:31:42 / cg" |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1652 |
! |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1653 |
|
1936 | 1654 |
pointerLeave:state |
1937
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
1655 |
(acceptOnPointerLeave and:[enabled and:[self modified]]) ifTrue:[ |
1936 | 1656 |
self accept |
1657 |
]. |
|
1658 |
super pointerLeave:state |
|
1937
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
1659 |
|
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
1660 |
"Modified: / 28.6.1999 / 18:08:29 / cg" |
1936 | 1661 |
! |
1662 |
||
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1663 |
resizeOrScroll |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1664 |
"helper for keyPress. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1665 |
Extracted for easier subclass redefinition." |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1666 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1667 |
|xCol newOffset newWidth| |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1668 |
|
125 | 1669 |
newWidth := self widthOfContents. |
1670 |
||
1671 |
" |
|
1672 |
should (& can) we resize ? |
|
1673 |
" |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1674 |
xCol := (self xOfCol:cursorCol inVisibleLine:cursorLine) - viewOrigin x. |
125 | 1675 |
(xCol > (width * (5/6))) ifTrue:[ |
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1676 |
self changedPreferredBounds:nil |
125 | 1677 |
] ifFalse:[ |
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1678 |
newWidth < (width * (1/6)) ifTrue:[ |
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1679 |
self changedPreferredBounds:nil |
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1680 |
] |
125 | 1681 |
]. |
1682 |
||
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1683 |
autoScrollHorizontally ifTrue:[ |
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1684 |
" |
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1685 |
did someone react (i.e. has my extent changed) ? |
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1686 |
(if not, we scroll horizontally) |
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1687 |
" |
2016
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
1688 |
lengthLimit notNil ifTrue:[ |
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
1689 |
(self xOfCol:lengthLimit+1 inVisibleLine:cursorLine) <= self innerWidth |
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
1690 |
ifTrue:[ |
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
1691 |
^ self |
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
1692 |
]. |
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
1693 |
]. |
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
1694 |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1695 |
xCol := (self xOfCol:cursorCol inVisibleLine:cursorLine) - viewOrigin x. |
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1696 |
(xCol > (width * (5/6))) ifTrue:[ |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1697 |
newOffset := viewOrigin x + (width // 2). |
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1698 |
] ifFalse:[ |
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1699 |
(xCol < (width * (1/6))) ifTrue:[ |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1700 |
newOffset := 0 max: viewOrigin x - (width // 2). |
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1701 |
] ifFalse:[ |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1702 |
newOffset := viewOrigin x |
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1703 |
] |
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1704 |
]. |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1705 |
newOffset ~~ viewOrigin x ifTrue:[ |
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1706 |
self scrollHorizontalTo:newOffset. |
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1707 |
] |
125 | 1708 |
]. |
1103
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1709 |
|
0efbd1ac68f4
use new #changedPreferredBounds
Claus Gittinger <cg@exept.de>
parents:
1080
diff
changeset
|
1710 |
"Modified: 6.3.1997 / 16:13:59 / cg" |
316
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1711 |
! |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1712 |
|
784
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1713 |
sizeChanged:how |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1714 |
"scroll to origin, if all fits" |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1715 |
|
1282 | 1716 |
|xCol| |
784
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1717 |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
1718 |
viewOrigin x ~~ 0 ifTrue:[ |
784
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1719 |
xCol := self xOfCol:cursorCol inVisibleLine:cursorLine. |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1720 |
(xCol < (width * (5/6))) ifTrue:[ |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1721 |
self scrollHorizontalTo:0 |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1722 |
]. |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1723 |
]. |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1724 |
self makeCursorVisible. |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1725 |
super sizeChanged:how |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1726 |
|
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1727 |
"Modified: 10.7.1996 / 10:59:37 / cg" |
192 | 1728 |
! ! |
1729 |
||
1806 | 1730 |
!EditField methodsFor:'focus handling'! |
1731 |
||
1732 |
hasKeyboardFocus:aBoolean |
|
1733 |
"the view got/lost the keyboard focus" |
|
1734 |
||
2349 | 1735 |
hasKeyboardFocus ~~ aBoolean ifTrue:[ |
1736 |
aBoolean ifFalse:[ |
|
1737 |
enabled ifTrue:[ |
|
1738 |
acceptOnLostFocus ifTrue:[ |
|
1739 |
model notNil ifTrue:[ |
|
1740 |
model value = self argForChangeMessage ifTrue:[ |
|
1741 |
^ self |
|
1742 |
] |
|
1743 |
]. |
|
1744 |
self accept. |
|
1999
7042cec087eb
hasKeyboardFocus -> do not validate if enabled is false
tm
parents:
1998
diff
changeset
|
1745 |
]. |
1806 | 1746 |
]. |
1747 |
]. |
|
1748 |
]. |
|
1749 |
super hasKeyboardFocus:aBoolean |
|
1750 |
||
1751 |
"Created: / 11.12.1996 / 16:57:50 / cg" |
|
1752 |
"Modified: / 6.12.1997 / 14:07:12 / cg" |
|
1753 |
! |
|
1754 |
||
1755 |
showFocus:explicit |
|
1756 |
"the view got the keyboard focus |
|
1757 |
(either explicit, via tabbing; or implicit, by pointer movement) |
|
1758 |
- change any display attributes as req'd." |
|
1759 |
||
1760 |
"/ giving me the focus is like clicking on me |
|
1761 |
"/ (tell my enterFieldGroup ...) |
|
1762 |
||
1763 |
||
1764 |
(enabled or:[explicit]) ifTrue:[ |
|
1765 |
clickAction notNil ifTrue:[clickAction value:self]. |
|
3461 | 1766 |
"/ mhmh - should we ALWAYS do this ? |
1767 |
explicit ifTrue:[ self makeCursorVisible ]. |
|
1806 | 1768 |
super showFocus:explicit |
1769 |
] |
|
1770 |
||
3461 | 1771 |
"Modified: / 06-03-2007 / 21:11:17 / cg" |
1806 | 1772 |
! |
1773 |
||
1774 |
showNoFocus:explicit |
|
1775 |
"the view lost the keyboard focus |
|
1776 |
(either explicit, via tabbing; or implicit, by pointer movement) |
|
1777 |
- change any display attributes as req'd." |
|
1778 |
||
1779 |
self hideCursor. |
|
1780 |
super showNoFocus:explicit |
|
1781 |
||
1782 |
"Modified: / 17.9.1998 / 15:10:04 / cg" |
|
1918
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1783 |
! |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1784 |
|
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1785 |
wantsFocusWithPointerEnter |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1786 |
"return true, if I want the focus when |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1787 |
the mouse pointer enters" |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1788 |
|
3305 | 1789 |
(UserPreferences current focusFollowsMouse ~~ false |
1918
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1790 |
and:[(styleSheet at:#'editField.requestFocusOnPointerEnter' default:true) |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1791 |
and:[enabled |
2692 | 1792 |
and:[self isReadOnly not]]]) ifTrue:[ |
1918
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1793 |
^ true |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1794 |
]. |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1795 |
|
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
1796 |
^ false |
1806 | 1797 |
! ! |
1798 |
||
2750 | 1799 |
!EditField methodsFor:'initialization & release'! |
192 | 1800 |
|
1801 |
initStyle |
|
967 | 1802 |
"setup viewStyle specifics" |
1803 |
||
3265 | 1804 |
<resource: #style (#'editField.cursorType' |
1805 |
#'editField.cursorForegroundColor' |
|
1806 |
#'editField.cursorBackgroundColor' |
|
1807 |
)> |
|
1808 |
||
192 | 1809 |
super initStyle. |
1810 |
||
392
81343306d796
eliminated all DefaultFont classVars (are now classINSTvars)
Claus Gittinger <cg@exept.de>
parents:
343
diff
changeset
|
1811 |
"/ DefaultFont notNil ifTrue:[font := DefaultFont on:device] |
81343306d796
eliminated all DefaultFont classVars (are now classINSTvars)
Claus Gittinger <cg@exept.de>
parents:
343
diff
changeset
|
1812 |
|
192 | 1813 |
DefaultBackgroundColor notNil ifTrue:[ |
1993 | 1814 |
bgColor := DefaultBackgroundColor onDevice:device. |
1482 | 1815 |
"/ bgColor ditherForm notNil ifTrue:[ |
1816 |
"/ bgColor := (bgColor copy) exactOrNearestOn:device |
|
1817 |
"/ ]. |
|
967 | 1818 |
self viewBackground:bgColor. |
192 | 1819 |
]. |
1820 |
fgColor := DefaultForegroundColor. |
|
1821 |
selectionFgColor := DefaultSelectionForegroundColor. |
|
1822 |
selectionBgColor := DefaultSelectionBackgroundColor. |
|
967 | 1823 |
|
1544
bb7e168dd651
dont hide editFields non-focus cursor (for now - focusDetection must be fixed)
Claus Gittinger <cg@exept.de>
parents:
1542
diff
changeset
|
1824 |
"/ enable this, when the focus detection works correctly (in dialogs) |
1848 | 1825 |
cursorTypeNoFocus := #none. |
1826 |
||
1827 |
cursorType := styleSheet at:#'editField.cursorType' default:cursorType. |
|
1828 |
||
1829 |
cursorFgColor := styleSheet at:#'editField.cursorForegroundColor' default:cursorFgColor. |
|
1830 |
cursorBgColor := styleSheet at:#'editField.cursorBackgroundColor' default:cursorBgColor. |
|
1544
bb7e168dd651
dont hide editFields non-focus cursor (for now - focusDetection must be fixed)
Claus Gittinger <cg@exept.de>
parents:
1542
diff
changeset
|
1831 |
|
bb7e168dd651
dont hide editFields non-focus cursor (for now - focusDetection must be fixed)
Claus Gittinger <cg@exept.de>
parents:
1542
diff
changeset
|
1832 |
"Modified: / 21.5.1998 / 15:38:14 / cg" |
192 | 1833 |
! |
0 | 1834 |
|
192 | 1835 |
initialize |
1836 |
super initialize. |
|
832 | 1837 |
self initialHeight:(font height + font descent + (topMargin * 2)). |
673
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1838 |
|
192 | 1839 |
nFullLinesShown := 1. |
1840 |
nLinesShown := 1. |
|
1225
6220d3bd3033
initialize acceptOnLostFocus
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
1841 |
trimBlankLines := immediateAccept := acceptOnLostFocus := false. |
1937
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
1842 |
acceptOnPointerLeave := false. |
1225
6220d3bd3033
initialize acceptOnLostFocus
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
1843 |
enabled := fixedSize := autoScrollHorizontally := true. |
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
1844 |
acceptOnLeave := acceptOnReturn := acceptOnTab := true. |
192 | 1845 |
cursorShown := true. |
978
6e678fdc6e5b
allow non-Tab as entryCompleter; care for immediateAccept after completion
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1846 |
entryCompletionCharacter := #Tab. |
2105 | 1847 |
acceptIfUnchanged := false. |
673
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1848 |
|
594 | 1849 |
leaveKeys isNil ifTrue:[ |
1850 |
leaveKeys := self class defaultLeaveKeys. |
|
1851 |
]. |
|
192 | 1852 |
cursorMovementWhenUpdating := #endOfLine |
594 | 1853 |
|
1937
b88111019826
added acceptOnPointerLeave - must be separate from acceptOnLeave
Claus Gittinger <cg@exept.de>
parents:
1936
diff
changeset
|
1854 |
"Modified: / 28.6.1999 / 18:08:17 / cg" |
192 | 1855 |
! ! |
1856 |
||
3702 | 1857 |
!EditField methodsFor:'menu actions'! |
1858 |
||
1859 |
editMenu |
|
1860 |
"return a popUpMenu for the receiver" |
|
1861 |
||
1862 |
<resource: #keyboard ( #Accept #Copy #Cut #Paste ) > |
|
1863 |
<resource: #programMenu> |
|
1864 |
||
1865 |
|items m| |
|
1866 |
||
1867 |
self isReadOnly == true ifTrue:[ |
|
1868 |
items := #( |
|
1869 |
('Copy' copySelection Copy ) |
|
1870 |
) |
|
1871 |
] ifFalse:[ |
|
1872 |
items := #( |
|
1873 |
('Cut' cut Cut ) |
|
1874 |
('Copy' copySelection Copy ) |
|
1875 |
('Paste' pasteOrReplace Paste ) |
|
1876 |
). |
|
1877 |
(acceptAction notNil |
|
1878 |
or:[model notNil and:[changeMsg notNil]]) ifTrue:[ |
|
1879 |
immediateAccept ifFalse:[ |
|
1880 |
items := items , #( |
|
1881 |
('-' ) |
|
1882 |
('Accept' accept Accept) |
|
1883 |
). |
|
1884 |
]. |
|
1885 |
]. |
|
1886 |
]. |
|
1887 |
||
1888 |
m := PopUpMenu itemList:items resources:resources. |
|
1889 |
||
1890 |
passwordCharacter notNil ifTrue:[ |
|
1891 |
m disable:#copySelection |
|
1892 |
]. |
|
1893 |
||
1894 |
self hasSelectionForCopy ifFalse:[ |
|
1895 |
m disable:#copySelection |
|
1896 |
]. |
|
1897 |
self hasSelection ifFalse:[ |
|
1898 |
m disable:#cut |
|
1899 |
]. |
|
1900 |
(enabled not or:[self isReadOnly]) ifTrue:[ |
|
1901 |
m disableAll:#(cut pasteOrReplace accept) |
|
1902 |
]. |
|
1903 |
||
1904 |
^ m |
|
1905 |
||
1906 |
"Modified: / 28.7.1998 / 11:35:41 / cg" |
|
1907 |
! ! |
|
1908 |
||
192 | 1909 |
!EditField methodsFor:'private'! |
1910 |
||
1911 |
argForChangeMessage |
|
1912 |
"redefined to send use converted value (if I have one)" |
|
1913 |
||
2538
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
1914 |
|str| |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
1915 |
|
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
1916 |
str := self editValue. |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
1917 |
(acceptIfUnchanged |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
1918 |
and:[model notNil |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
1919 |
and:[model value == self editValue]]) ifTrue:[ |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
1920 |
"/ copy to force valueHolder to trigger |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
1921 |
str := str copy. |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
1922 |
]. |
ce313a0572e7
care for accept with unchangedValue;
Claus Gittinger <cg@exept.de>
parents:
2518
diff
changeset
|
1923 |
^ str |
192 | 1924 |
! |
1925 |
||
1926 |
getListFromModel |
|
1927 |
"redefined to aquire the text via the aspectMsg - not the listMsg, |
|
1928 |
and to ignore updates resulting from my own change." |
|
1929 |
||
1464 | 1930 |
|val| |
1931 |
||
192 | 1932 |
(model notNil and:[aspectMsg notNil]) ifTrue:[ |
1464 | 1933 |
aspectMsg == #value ifTrue:[ |
1934 |
val := model value |
|
1935 |
] ifFalse:[ |
|
1936 |
val := model perform:aspectMsg |
|
1937 |
]. |
|
1503
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1938 |
|
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1939 |
" |
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1940 |
ignore updates from my own change |
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1941 |
" |
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1942 |
lockUpdates ifTrue:[ |
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1943 |
lockUpdates := false. |
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1944 |
val = self editValue ifTrue:[ |
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1945 |
^ self |
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1946 |
] |
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1947 |
]. |
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1948 |
|
1464 | 1949 |
self editValue:val. |
0 | 1950 |
] |
1464 | 1951 |
|
1503
ae953a367422
care for models ignoring a change (i.e. if doing range checks in
Claus Gittinger <cg@exept.de>
parents:
1482
diff
changeset
|
1952 |
"Modified: / 23.4.1998 / 10:10:37 / cg" |
0 | 1953 |
! |
1954 |
||
192 | 1955 |
startAutoScrollDown:y |
1956 |
"no vertical scrolling in editfields" |
|
1957 |
||
1958 |
^ self |
|
1959 |
! |
|
1960 |
||
1961 |
startAutoScrollUp:y |
|
1962 |
"no vertical scrolling in editfields" |
|
1963 |
||
1964 |
^ self |
|
1965 |
! |
|
0 | 1966 |
|
192 | 1967 |
textChanged |
1968 |
"this is sent by mySelf (somewhere in a superclass) whenever |
|
1969 |
my contents has changed. |
|
1970 |
A good place to add immediateAccept functionality and check for the |
|
1971 |
lengthLimit." |
|
1972 |
||
1973 |
|string c| |
|
1974 |
||
1975 |
super textChanged. |
|
1976 |
string := self contents. |
|
1977 |
lengthLimit notNil ifTrue:[ |
|
1978 |
string size > lengthLimit ifTrue:[ |
|
1979 |
c := cursorCol. |
|
1980 |
self contents:(string copyTo:lengthLimit). |
|
1981 |
self flash. |
|
1982 |
self cursorCol:c. |
|
125 | 1983 |
] |
0 | 1984 |
]. |
192 | 1985 |
immediateAccept ifTrue:[ |
1986 |
self accept |
|
1987 |
] |
|
105 | 1988 |
! |
1989 |
||
2616 | 1990 |
textChangedButNoSizeChange |
2296
b924cc94580c
immediate update did not work for Backspace key (and some others)
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1991 |
"this is sent by mySelf (somewhere in a superclass) whenever |
b924cc94580c
immediate update did not work for Backspace key (and some others)
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1992 |
my contents has changed. |
b924cc94580c
immediate update did not work for Backspace key (and some others)
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1993 |
A good place to add immediateAccept functionality." |
b924cc94580c
immediate update did not work for Backspace key (and some others)
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1994 |
|
2616 | 1995 |
super textChangedButNoSizeChange. |
2296
b924cc94580c
immediate update did not work for Backspace key (and some others)
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1996 |
immediateAccept ifTrue:[ |
b924cc94580c
immediate update did not work for Backspace key (and some others)
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1997 |
self accept |
b924cc94580c
immediate update did not work for Backspace key (and some others)
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1998 |
] |
b924cc94580c
immediate update did not work for Backspace key (and some others)
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
1999 |
! |
b924cc94580c
immediate update did not work for Backspace key (and some others)
Claus Gittinger <cg@exept.de>
parents:
2193
diff
changeset
|
2000 |
|
1631
f8fae6670540
change viewBackground, when either disabled or readOnly.
Claus Gittinger <cg@exept.de>
parents:
1616
diff
changeset
|
2001 |
updateBackground |
f8fae6670540
change viewBackground, when either disabled or readOnly.
Claus Gittinger <cg@exept.de>
parents:
1616
diff
changeset
|
2002 |
"make my background grey, whenever either readOnly or disable" |
f8fae6670540
change viewBackground, when either disabled or readOnly.
Claus Gittinger <cg@exept.de>
parents:
1616
diff
changeset
|
2003 |
|
1974 | 2004 |
|fg| |
2005 |
||
3648
7a959d9db34f
dont (re)set the background, if I have a bg-channel.
Claus Gittinger <cg@exept.de>
parents:
3585
diff
changeset
|
2006 |
backgroundChannel notNil ifTrue:[^ self]. |
7a959d9db34f
dont (re)set the background, if I have a bg-channel.
Claus Gittinger <cg@exept.de>
parents:
3585
diff
changeset
|
2007 |
|
1733
c5139b7402f0
use self isReadonly; readOnly may now be a valueHolder.
Claus Gittinger <cg@exept.de>
parents:
1683
diff
changeset
|
2008 |
(self isReadOnly or:[enabled not]) ifTrue:[ |
1632
01a7b330622a
change foregroundColor when disabled.
Claus Gittinger <cg@exept.de>
parents:
1631
diff
changeset
|
2009 |
self backgroundColor:(View defaultViewBackgroundColor). |
01a7b330622a
change foregroundColor when disabled.
Claus Gittinger <cg@exept.de>
parents:
1631
diff
changeset
|
2010 |
enabled ifFalse:[ |
1974 | 2011 |
fg := StyleSheet colorAt:'editField.disabledForegroundColor' default:nil. |
2012 |
fg isNil ifTrue:[ |
|
2013 |
fg := StyleSheet colorAt:'button.disabledForegroundColor' default:Color gray. |
|
2014 |
]. |
|
2015 |
self foregroundColor:fg. |
|
3408 | 2016 |
] ifTrue:[ |
2017 |
self foregroundColor:DefaultForegroundColor. |
|
2018 |
]. |
|
1631
f8fae6670540
change viewBackground, when either disabled or readOnly.
Claus Gittinger <cg@exept.de>
parents:
1616
diff
changeset
|
2019 |
] ifFalse:[ |
1632
01a7b330622a
change foregroundColor when disabled.
Claus Gittinger <cg@exept.de>
parents:
1631
diff
changeset
|
2020 |
self backgroundColor:DefaultBackgroundColor. |
01a7b330622a
change foregroundColor when disabled.
Claus Gittinger <cg@exept.de>
parents:
1631
diff
changeset
|
2021 |
self foregroundColor:DefaultForegroundColor. |
1631
f8fae6670540
change viewBackground, when either disabled or readOnly.
Claus Gittinger <cg@exept.de>
parents:
1616
diff
changeset
|
2022 |
] |
f8fae6670540
change viewBackground, when either disabled or readOnly.
Claus Gittinger <cg@exept.de>
parents:
1616
diff
changeset
|
2023 |
|
1632
01a7b330622a
change foregroundColor when disabled.
Claus Gittinger <cg@exept.de>
parents:
1631
diff
changeset
|
2024 |
"Modified: / 3.8.1998 / 18:40:11 / cg" |
1631
f8fae6670540
change viewBackground, when either disabled or readOnly.
Claus Gittinger <cg@exept.de>
parents:
1616
diff
changeset
|
2025 |
! |
f8fae6670540
change viewBackground, when either disabled or readOnly.
Claus Gittinger <cg@exept.de>
parents:
1616
diff
changeset
|
2026 |
|
192 | 2027 |
visibleAt:visLineNr |
2028 |
"return the string at lineNr for display. |
|
2029 |
If there is a password character, return a string consisting of those only." |
|
2030 |
||
2031 |
|s| |
|
105 | 2032 |
|
192 | 2033 |
s := super visibleAt:visLineNr. |
2034 |
passwordCharacter notNil ifTrue:[ |
|
2035 |
^ String new:(s size) withAll:passwordCharacter |
|
2036 |
]. |
|
2037 |
^ s |
|
2038 |
||
2039 |
"Modified: 6.9.1995 / 12:25:06 / claus" |
|
0 | 2040 |
! ! |
125 | 2041 |
|
192 | 2042 |
!EditField methodsFor:'queries'! |
2043 |
||
2350
c09d3dd534e3
do not allow copy of password-characters out of an editfield.
Claus Gittinger <cg@exept.de>
parents:
2349
diff
changeset
|
2044 |
hasSelectionForCopy |
c09d3dd534e3
do not allow copy of password-characters out of an editfield.
Claus Gittinger <cg@exept.de>
parents:
2349
diff
changeset
|
2045 |
"return true, if there is a selection which can be copied." |
c09d3dd534e3
do not allow copy of password-characters out of an editfield.
Claus Gittinger <cg@exept.de>
parents:
2349
diff
changeset
|
2046 |
|
c09d3dd534e3
do not allow copy of password-characters out of an editfield.
Claus Gittinger <cg@exept.de>
parents:
2349
diff
changeset
|
2047 |
passwordCharacter notNil ifTrue:[ ^ false ]. |
c09d3dd534e3
do not allow copy of password-characters out of an editfield.
Claus Gittinger <cg@exept.de>
parents:
2349
diff
changeset
|
2048 |
^ self hasSelection |
c09d3dd534e3
do not allow copy of password-characters out of an editfield.
Claus Gittinger <cg@exept.de>
parents:
2349
diff
changeset
|
2049 |
! |
c09d3dd534e3
do not allow copy of password-characters out of an editfield.
Claus Gittinger <cg@exept.de>
parents:
2349
diff
changeset
|
2050 |
|
561 | 2051 |
isInputField |
2052 |
"return true, if the receiver is some kind of input view, |
|
2053 |
i.e. it should (can) be part of an enterGroup. |
|
2054 |
Return true here" |
|
2055 |
||
2056 |
^ true |
|
2057 |
||
2058 |
"Created: 4.3.1996 / 11:32:34 / cg" |
|
2059 |
! |
|
2060 |
||
192 | 2061 |
preferredExtent |
2062 |
"return the preferred extent of this view. |
|
2063 |
That is the width of the string plus some extra, |
|
2064 |
but not wider than half of the screen" |
|
2065 |
||
1120 | 2066 |
|string w h f| |
125 | 2067 |
|
800 | 2068 |
"/ If I have an explicit preferredExtent .. |
2069 |
||
714
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
677
diff
changeset
|
2070 |
preferredExtent notNil ifTrue:[ |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
677
diff
changeset
|
2071 |
^ preferredExtent |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
677
diff
changeset
|
2072 |
]. |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
677
diff
changeset
|
2073 |
|
192 | 2074 |
string := self contents. |
2075 |
(string isNil or:[string isBlank]) ifTrue:[ |
|
667
d02f6bba8fc5
use fonts maxHeight in prefExtent (A-Umlaut)
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
2076 |
string := ' ' "/ just any string is ok ^ super preferredExtent |
192 | 2077 |
]. |
1993 | 2078 |
f := font onDevice:device. |
192 | 2079 |
w := ((f widthOf:string) * 1.5) rounded. |
1120 | 2080 |
w := w + margin + margin. |
192 | 2081 |
w := w min:(device width // 2). |
667
d02f6bba8fc5
use fonts maxHeight in prefExtent (A-Umlaut)
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
2082 |
|
1542
5778dd813273
default height a bit larger (for caret cursors);
Claus Gittinger <cg@exept.de>
parents:
1537
diff
changeset
|
2083 |
h := f maxHeight + (f maxDescent * 2) + (margin * 2). |
1120 | 2084 |
|
2085 |
^ w rounded @ h rounded |
|
192 | 2086 |
|
1542
5778dd813273
default height a bit larger (for caret cursors);
Claus Gittinger <cg@exept.de>
parents:
1537
diff
changeset
|
2087 |
"Modified: / 6.9.1995 / 19:24:06 / claus" |
5778dd813273
default height a bit larger (for caret cursors);
Claus Gittinger <cg@exept.de>
parents:
1537
diff
changeset
|
2088 |
"Modified: / 21.5.1998 / 02:13:35 / cg" |
192 | 2089 |
! |
2090 |
||
2091 |
specClass |
|
1372 | 2092 |
"redefined, since the name of my specClass is nonStandard (i.e. not EditFieldSpec)" |
2093 |
||
192 | 2094 |
self class == EditField ifTrue:[^ InputFieldSpec]. |
1047 | 2095 |
^ super specClass |
125 | 2096 |
|
1372 | 2097 |
"Modified: / 5.9.1995 / 17:28:27 / claus" |
2098 |
"Modified: / 31.10.1997 / 19:48:59 / cg" |
|
325 | 2099 |
! |
2100 |
||
2101 |
tabMeansNextField |
|
2102 |
"return true, if Tab character should shift focus to the next field" |
|
2103 |
||
2104 |
"if I have a completionBlock, I want my Tabs ..." |
|
2105 |
||
2993 | 2106 |
^ self entryCompletionBlock isNil or:[entryCompletionCharacter ~~ #Tab] |
325 | 2107 |
|
2108 |
"Created: 7.2.1996 / 19:16:38 / cg" |
|
192 | 2109 |
! ! |
2110 |
||
2111 |
!EditField methodsFor:'realization'! |
|
2112 |
||
1274 | 2113 |
realize |
192 | 2114 |
"scroll back to beginning when realized" |
1268 | 2115 |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
2116 |
viewOrigin := 0 @ viewOrigin y. |
1274 | 2117 |
super realize |
1268 | 2118 |
|
1274 | 2119 |
"Created: 24.7.1997 / 18:23:15 / cg" |
125 | 2120 |
! ! |
192 | 2121 |
|
2122 |
!EditField methodsFor:'scrolling'! |
|
2123 |
||
1751
f29c3312beaf
adjust h-scroll offset if only part is visible,
Claus Gittinger <cg@exept.de>
parents:
1733
diff
changeset
|
2124 |
makeColVisible:col inLine:lineNr |
2707 | 2125 |
"dont scroll for the cursor, if its beyond the text and a lengthLimit |
192 | 2126 |
is present." |
2127 |
||
2759 | 2128 |
|wText innerWidth colToMakeVisible| |
2424 | 2129 |
|
2130 |
||
2131 |
innerWidth := self innerWidth. |
|
2759 | 2132 |
colToMakeVisible := col. |
2016
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
2133 |
|
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
2134 |
lengthLimit notNil ifTrue:[ |
2424 | 2135 |
(self xOfCol:col inVisibleLine:1) <= innerWidth |
2016
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
2136 |
ifTrue:[ |
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
2137 |
^ self |
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
2138 |
]. |
2424 | 2139 |
(self xOfCol:lengthLimit inVisibleLine:1) <= innerWidth |
2016
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
2140 |
ifTrue:[ |
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
2141 |
^ self |
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
2142 |
]. |
2759 | 2143 |
(col == cursorCol and:[col > lengthLimit]) ifTrue:[ |
2144 |
colToMakeVisible := lengthLimit |
|
2016
7a4d89c99c98
dont scroll horizontally, if there is a lengthLimit,
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
2145 |
]. |
192 | 2146 |
]. |
1751
f29c3312beaf
adjust h-scroll offset if only part is visible,
Claus Gittinger <cg@exept.de>
parents:
1733
diff
changeset
|
2147 |
|
2759 | 2148 |
super makeColVisible:colToMakeVisible inLine:lineNr. |
2149 |
||
1751
f29c3312beaf
adjust h-scroll offset if only part is visible,
Claus Gittinger <cg@exept.de>
parents:
1733
diff
changeset
|
2150 |
"/ new: |
f29c3312beaf
adjust h-scroll offset if only part is visible,
Claus Gittinger <cg@exept.de>
parents:
1733
diff
changeset
|
2151 |
"/ care to make the most possible visible |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
2152 |
viewOrigin x > 0 ifTrue:[ |
1751
f29c3312beaf
adjust h-scroll offset if only part is visible,
Claus Gittinger <cg@exept.de>
parents:
1733
diff
changeset
|
2153 |
wText := self widthOfLine:lineNr. |
2424 | 2154 |
wText <= innerWidth ifTrue:[ |
1751
f29c3312beaf
adjust h-scroll offset if only part is visible,
Claus Gittinger <cg@exept.de>
parents:
1733
diff
changeset
|
2155 |
self scrollHorizontalTo:0 |
f29c3312beaf
adjust h-scroll offset if only part is visible,
Claus Gittinger <cg@exept.de>
parents:
1733
diff
changeset
|
2156 |
] |
f29c3312beaf
adjust h-scroll offset if only part is visible,
Claus Gittinger <cg@exept.de>
parents:
1733
diff
changeset
|
2157 |
] |
192 | 2158 |
|
2159 |
"Modified: 6.9.1995 / 13:57:53 / claus" |
|
2160 |
! ! |
|
2161 |
||
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
2162 |
!EditField methodsFor:'selections'! |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
2163 |
|
3366
0df1eb5da5aa
refuse to copy passwords to the clipboard.
Claus Gittinger <cg@exept.de>
parents:
3305
diff
changeset
|
2164 |
copySelection |
0df1eb5da5aa
refuse to copy passwords to the clipboard.
Claus Gittinger <cg@exept.de>
parents:
3305
diff
changeset
|
2165 |
"refuse to copy a password to the clipboard" |
0df1eb5da5aa
refuse to copy passwords to the clipboard.
Claus Gittinger <cg@exept.de>
parents:
3305
diff
changeset
|
2166 |
|
0df1eb5da5aa
refuse to copy passwords to the clipboard.
Claus Gittinger <cg@exept.de>
parents:
3305
diff
changeset
|
2167 |
passwordCharacter notNil ifTrue:[ |
3367 | 2168 |
self beep. |
3366
0df1eb5da5aa
refuse to copy passwords to the clipboard.
Claus Gittinger <cg@exept.de>
parents:
3305
diff
changeset
|
2169 |
^ self |
0df1eb5da5aa
refuse to copy passwords to the clipboard.
Claus Gittinger <cg@exept.de>
parents:
3305
diff
changeset
|
2170 |
]. |
0df1eb5da5aa
refuse to copy passwords to the clipboard.
Claus Gittinger <cg@exept.de>
parents:
3305
diff
changeset
|
2171 |
^ super copySelection |
0df1eb5da5aa
refuse to copy passwords to the clipboard.
Claus Gittinger <cg@exept.de>
parents:
3305
diff
changeset
|
2172 |
! |
0df1eb5da5aa
refuse to copy passwords to the clipboard.
Claus Gittinger <cg@exept.de>
parents:
3305
diff
changeset
|
2173 |
|
1080
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2174 |
selectAll |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2175 |
"select the whole text. |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2176 |
redefined to send super selectFrom... since we dont want the |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2177 |
cursor to be moved in this case." |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2178 |
|
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2179 |
|len| |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2180 |
|
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2181 |
list isNil ifTrue:[ |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2182 |
self unselect |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2183 |
] ifFalse:[ |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2184 |
len := (self listAt:1) size. |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2185 |
len ~~ 0 ifTrue:[ |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2186 |
super selectFromLine:1 col:1 toLine:1 col:len. |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2187 |
]. |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2188 |
typeOfSelection := nil |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2189 |
] |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2190 |
|
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2191 |
"Modified: 28.2.1997 / 19:16:21 / cg" |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2192 |
! |
73877901fa7d
redefined #selectAll to select nothing if there is nothing
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
2193 |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
2194 |
validateNewSelection |
1654 | 2195 |
"make certain that only one line is ever selected" |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
2196 |
|
1654 | 2197 |
selectionEndLine notNil ifTrue:[ |
2198 |
selectionEndLine > 1 ifTrue:[ |
|
2199 |
selectionEndLine := 2. selectionEndCol := 0 |
|
2200 |
] |
|
2201 |
]. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
2202 |
! ! |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
2203 |
|
892 | 2204 |
!EditField class methodsFor:'documentation'! |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
2205 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
2206 |
version |
3702 | 2207 |
^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.193 2008-09-10 10:48:31 cg Exp $' |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
2208 |
! ! |