author | Claus Gittinger <cg@exept.de> |
Wed, 22 Jan 1997 18:21:36 +0100 | |
changeset 967 | 6739eb5496da |
parent 964 | 73525cfd8fa2 |
child 978 | 6e678fdc6e5b |
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 |
" |
|
12 |
||
13 |
EditTextView subclass:#EditField |
|
316
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
14 |
instanceVariableNames:'leaveAction enabled clickAction crAction tabAction converter |
209
7a6db7fac566
dont allow multiline selections in EditField
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
15 |
leaveKeys immediateAccept acceptOnLeave acceptOnReturn |
7a6db7fac566
dont allow multiline selections in EditField
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
16 |
lengthLimit entryCompletionBlock passwordCharacter |
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
17 |
cursorMovementWhenUpdating enableChannel autoScrollHorizontally |
892 | 18 |
acceptOnTab acceptOnLostFocus' |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
19 |
classVariableNames:'DefaultForegroundColor DefaultBackgroundColor |
392
81343306d796
eliminated all DefaultFont classVars (are now classINSTvars)
Claus Gittinger <cg@exept.de>
parents:
343
diff
changeset
|
20 |
DefaultSelectionForegroundColor DefaultSelectionBackgroundColor' |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
21 |
poolDictionaries:'' |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
22 |
category:'Views-Text' |
0 | 23 |
! |
24 |
||
892 | 25 |
!EditField class methodsFor:'documentation'! |
19 | 26 |
|
38 | 27 |
copyright |
28 |
" |
|
29 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
59 | 30 |
All Rights Reserved |
38 | 31 |
|
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
19 | 41 |
documentation |
42 |
" |
|
38 | 43 |
an editable text-field. Realized by using an EditTextView, |
44 |
and forcing its size to 1 line - disabling cursor movement |
|
45 |
in the vertical direction. |
|
121 | 46 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
47 |
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
|
48 |
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
|
49 |
(especially: #contents / #contents:). |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
50 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
51 |
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
|
52 |
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
|
53 |
is extracted actively by someone else. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
54 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
55 |
accepting: |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
56 |
The opposite way to use editFields is to connect them to a model |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
57 |
and let the field notify changes to it. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
58 |
This notification is called ``accepting''. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
59 |
Unless accepted, the models value is not updated from the editFields contents |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
60 |
this default is the normal operation and way things should work, since most |
842
a27a1c6ddde0
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
832
diff
changeset
|
61 |
uses of editFields are not interested in every individual change |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
62 |
(i.e. getting each keyStroke when a long number is entered). |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
63 |
The default behavior is to ``accept'' when either return or a cursorUp/Down |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
64 |
key is pressed in a field. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
65 |
However, the field can setup to accept/not accept on leave, on return |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
66 |
or on each individual key input. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
67 |
See the methods #acceptOnLeave: / #acceptOnReturn: / #immediateAccept. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
68 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
69 |
In addition, the set of keys which are considered ``leaveKeys'' can be |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
70 |
specified by #leaveKeys: (in case you need keys other than Return, CursorUp/Down). |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
71 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
72 |
models value vs. field contents: |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
73 |
Although the field internally keeps its contents as some string object, |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
74 |
the application may prefer to think of numbers, floats, yes/no values etc. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
75 |
To support this, a converter may defined, which is responsible for conversion of |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
76 |
strings to/from the models domain value. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
77 |
If present (i.e. nonNil), the converter is asked to convert a string to the models |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
78 |
domain with #readValueFrom:aString and vice versa, a value to a string by #printStringFor:. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
79 |
The PrintConverter class already provides a number of standard conversions, see the examples. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
80 |
To access a converted value directly (i.e. not via the model), use #editValue. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
81 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
82 |
grouping: |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
83 |
Individual fields do not know about being included in a group. This must be arranged on the |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
84 |
outside, by placing multiple fields into an EnterFieldGroup. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
85 |
This groupObject keeps a reference to one active field, and forwards input from any other |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
86 |
field to the active one. Also have a look at the examples for this. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
87 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
88 |
input completion: |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
89 |
To support input completion (i.e. filename completion, classname completion etc.), |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
90 |
a completionBlock can be defined which (if non-nil) is evaluated when the completion-key |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
91 |
is pressed and its value is taken as the new field-contents. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
92 |
The physical completion-key is the Tab key (this one cannot be defined by |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
93 |
the keyboardTranslation mechanism, since that would disable the Tab-key on regular text views. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
94 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
95 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
96 |
|
586 | 97 |
[Instance variables:] |
121 | 98 |
|
99 |
leaveAction <Block | nil> if non-nil, this is evaluated with |
|
586 | 100 |
the key (#Return, #CursorUp etc.) when |
101 |
the field is left via keyboard keys. |
|
102 |
(fieldGroups use this to decide which |
|
103 |
field has to be enabled next) |
|
121 | 104 |
|
105 |
enabled <Boolean> if false, input is ignored. |
|
106 |
||
316
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
107 |
clickAction <Block | nil> action performed if the field is |
586 | 108 |
clicked upon. |
109 |
(this is used by the group to |
|
110 |
set the active field to the clicked upon field) |
|
121 | 111 |
|
112 |
crAction <Block | nil> if non-nil, keyboard input of a cr are not |
|
586 | 113 |
handled specially, instead this block is evaluated |
114 |
(however, this block can perform additional checks and send |
|
115 |
a #accept then) |
|
121 | 116 |
|
117 |
tabAction <Block | nil> if non-nil, keyboard input of a tab character |
|
586 | 118 |
is not entered into the text, instead this block |
119 |
is evaluated. Also, no input completion is performed if |
|
120 |
tabAction is nonNil. |
|
121 | 121 |
|
122 |
converter <PrintConverter | nil> if non-nil, this is supposed to convert between |
|
586 | 123 |
the object and its printed representation and vice versa. |
124 |
Defaults to nil i.e. assume that strings are edited. |
|
121 | 125 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
126 |
leaveKeys <Collection> keys which are interpreted as 'leaving the field' |
122 | 127 |
|
125 | 128 |
immediateAccept <Boolean> if true, every change of the text is immediately |
586 | 129 |
forwarded to the model/acceptBlock. If false, |
130 |
the changed value is only stored in the model |
|
131 |
if the field is left or accepted. |
|
132 |
Default is false. |
|
122 | 133 |
|
134 |
acceptOnLeave <Boolean> if true, leaving the field (via cursor keys) |
|
586 | 135 |
automatically accepts the value into the model. |
136 |
Default is true. |
|
122 | 137 |
|
138 |
acceptOnReturn <Boolean> if true, leaving the field via return |
|
586 | 139 |
automatically accepts the value into the model. |
140 |
Default is true. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
141 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
142 |
acceptOnTab <Boolean> if true, the Tab key accepts and leaves the field. |
586 | 143 |
If false, Tabs are entered into the contents field like |
144 |
ordinary non-control keys. |
|
145 |
AcceptOnTab is ignored if the entryCompletion block is nonNil. |
|
146 |
Default is true. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
147 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
148 |
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
|
149 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
150 |
entryCompletionBlock <BlockOrNil> if non-nil, this is evaluated to complete the entry |
586 | 151 |
when Tab is pressed. |
152 |
Entry completion is used with Filenamefields or in the |
|
153 |
browser for classname/selector completion. |
|
154 |
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
|
155 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
156 |
passwordCharacter <CharacterOrNil> if non-nil, typed input is replaced by this character |
586 | 157 |
for display. Used for secret-input fields (such as password entry). |
158 |
Default is nil. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
159 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
160 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
161 |
cursorMovementWhenUpdating <Symbol> defines where the cursor is to be positioned if the |
586 | 162 |
model changes its value by some outside activity |
163 |
(i.e. not by user input into the field). |
|
164 |
Can be one of: |
|
165 |
#keep / nil -> stay where it was |
|
166 |
#endOfLine -> position cursor after the string |
|
167 |
#beginOfLine -> position cursor to the beginning |
|
168 |
The default is nil (i.e. stay where it was before). |
|
169 |
||
170 |
[author:] |
|
171 |
Claus Gittinger |
|
172 |
||
173 |
[see also:] |
|
174 |
DialogBox |
|
594 | 175 |
EnterFieldGroup |
176 |
EnterBox EnterBox2 |
|
177 |
FilenameEditField EditTextView |
|
19 | 178 |
" |
120 | 179 |
! |
180 |
||
181 |
examples |
|
182 |
" |
|
122 | 183 |
see more examples in EnterFieldGroup>>examples. |
184 |
||
185 |
||
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
186 |
Step-by-step introduction: |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
187 |
|
120 | 188 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
189 |
basic field in some view: |
594 | 190 |
[exBegin] |
333 | 191 |
|top field| |
120 | 192 |
|
333 | 193 |
top := StandardSystemView new. |
194 |
top extent:200@100. |
|
120 | 195 |
|
333 | 196 |
field := EditField origin:0.0@0.0 in:top. |
197 |
field width:1.0. 'let its height as-is'. |
|
120 | 198 |
|
333 | 199 |
top open |
594 | 200 |
[exEnd] |
120 | 201 |
|
122 | 202 |
|
125 | 203 |
forward input in topView to the field: |
204 |
(currently, the field does not know this - therefore, |
|
205 |
its been told here ... this may change) |
|
594 | 206 |
[exBegin] |
333 | 207 |
|top field| |
122 | 208 |
|
333 | 209 |
top := StandardSystemView new. |
210 |
top extent:200@100. |
|
122 | 211 |
|
333 | 212 |
field := EditField origin:0.0@0.0 in:top. |
213 |
field width:1.0. 'let its height as-is'. |
|
122 | 214 |
|
333 | 215 |
top delegate:(KeyboardForwarder toView:field). |
216 |
field hasKeyboardFocus:true. |
|
217 |
top open |
|
594 | 218 |
[exEnd] |
122 | 219 |
|
220 |
||
125 | 221 |
to make it look better: set some inset: |
594 | 222 |
[exBegin] |
333 | 223 |
|top field spacing| |
120 | 224 |
|
333 | 225 |
top := StandardSystemView new. |
226 |
top extent:200@100. |
|
120 | 227 |
|
333 | 228 |
spacing := View viewSpacing. |
229 |
field := EditField origin:(0.0 @ spacing) in:top. |
|
230 |
field width:1.0. 'let its height as-is'. |
|
231 |
field leftInset:spacing; rightInset:spacing. |
|
120 | 232 |
|
333 | 233 |
top open |
594 | 234 |
[exEnd] |
120 | 235 |
|
122 | 236 |
|
120 | 237 |
give it an initial contents: |
594 | 238 |
[exBegin] |
333 | 239 |
|top field| |
120 | 240 |
|
333 | 241 |
top := StandardSystemView new. |
242 |
top extent:200@100. |
|
120 | 243 |
|
594 | 244 |
field := EditField origin:(0.0 @ 0.0) in:top. |
333 | 245 |
field width:1.0. |
120 | 246 |
|
333 | 247 |
field editValue:'hello world'. |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
248 |
|
333 | 249 |
top open |
594 | 250 |
[exEnd] |
120 | 251 |
|
122 | 252 |
|
125 | 253 |
have it preselected: |
594 | 254 |
[exBegin] |
333 | 255 |
|top field| |
120 | 256 |
|
333 | 257 |
top := StandardSystemView new. |
258 |
top extent:200@100. |
|
120 | 259 |
|
333 | 260 |
field := EditField origin:(0.0 @ 0.0) in:top. |
261 |
field width:1.0. |
|
262 |
field editValue:'hello world' selected:true. |
|
120 | 263 |
|
333 | 264 |
top open |
594 | 265 |
[exEnd] |
120 | 266 |
|
122 | 267 |
|
120 | 268 |
have part of it preselected: |
594 | 269 |
[exBegin] |
333 | 270 |
|top field| |
120 | 271 |
|
333 | 272 |
top := StandardSystemView new. |
273 |
top extent:200@100. |
|
120 | 274 |
|
333 | 275 |
field := EditField origin:(0.0 @ 0.0) in:top. |
276 |
field width:1.0. |
|
120 | 277 |
|
333 | 278 |
field editValue:'hello world'. |
279 |
field selectFromCharacterPosition:1 to:5. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
280 |
|
333 | 281 |
top open |
594 | 282 |
[exEnd] |
120 | 283 |
|
122 | 284 |
|
125 | 285 |
set a size limit: |
594 | 286 |
[exBegin] |
333 | 287 |
|top field| |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
288 |
|
333 | 289 |
top := StandardSystemView new. |
290 |
top extent:200@100. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
291 |
|
333 | 292 |
field := EditField origin:(0.0 @ 0.0) in:top. |
293 |
field width:1.0. |
|
294 |
field editValue:'hello'. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
295 |
|
333 | 296 |
field maxChars:8. |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
297 |
|
333 | 298 |
top open |
594 | 299 |
[exEnd] |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
300 |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
301 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
302 |
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
|
303 |
notice: you may prefer a constant-pitch font (such as courier): |
594 | 304 |
[exBegin] |
333 | 305 |
|top field| |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
306 |
|
333 | 307 |
top := StandardSystemView new. |
308 |
top extent:200@100. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
309 |
|
333 | 310 |
field := EditField origin:(0.0 @ 0.0) in:top. |
311 |
field innerWidth:(field font widthOf:'00000000'). |
|
312 |
field editValue:'12345678'. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
313 |
|
333 | 314 |
field maxChars:8. |
315 |
field autoScroll:false. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
316 |
|
333 | 317 |
top open |
594 | 318 |
[exEnd] |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
319 |
|
125 | 320 |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
321 |
enable / disable: |
594 | 322 |
[exBegin] |
333 | 323 |
|top panel check field ena| |
324 |
||
325 |
top := StandardSystemView new. |
|
326 |
top extent:200@100. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
327 |
|
333 | 328 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top. |
329 |
panel borderWidth:0. |
|
330 |
panel horizontalLayout:#left. |
|
331 |
panel horizontalInset:View viewSpacing. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
332 |
|
333 | 333 |
check := CheckBox label:'enable' in:panel. |
334 |
check turnOn. |
|
335 |
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
|
336 |
|
333 | 337 |
panel add:(View new height:30; borderWidth:0). |
125 | 338 |
|
333 | 339 |
field := EditField in:panel. |
340 |
field width:1.0. |
|
341 |
field editValue:'hello'. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
342 |
|
333 | 343 |
top open |
594 | 344 |
[exEnd] |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
345 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
346 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
347 |
enable / disable using a channel: |
594 | 348 |
[exBegin] |
333 | 349 |
|top panel check field ena| |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
350 |
|
333 | 351 |
top := StandardSystemView new. |
352 |
top extent:200@100. |
|
125 | 353 |
|
333 | 354 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top. |
355 |
panel borderWidth:0. |
|
356 |
panel horizontalLayout:#left. |
|
357 |
panel horizontalInset:View viewSpacing. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
358 |
|
333 | 359 |
ena := true asValue. |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
360 |
|
333 | 361 |
check := CheckBox label:'enable' in:panel. |
362 |
check model:ena. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
363 |
|
333 | 364 |
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
|
365 |
|
333 | 366 |
field := EditField in:panel. |
367 |
field enableChannel:ena. |
|
368 |
field width:1.0. |
|
369 |
field editValue:'hello'. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
370 |
|
333 | 371 |
top open |
594 | 372 |
[exEnd] |
125 | 373 |
|
374 |
||
121 | 375 |
use a converter: |
125 | 376 |
- numbers (default to 0): |
594 | 377 |
[exBegin] |
378 |
|top field spacing| |
|
121 | 379 |
|
333 | 380 |
top := StandardSystemView new. |
381 |
top extent:200@100. |
|
121 | 382 |
|
594 | 383 |
spacing := View viewSpacing. |
384 |
||
385 |
field := EditField origin:0.0 @ spacing in:top. |
|
333 | 386 |
field width:1.0. |
594 | 387 |
field horizontalInset:spacing. |
121 | 388 |
|
333 | 389 |
field converter:(PrintConverter new initForNumber). |
390 |
field editValue:1234. |
|
655 | 391 |
field acceptAction:[:value | Transcript showCR:value]. |
333 | 392 |
field crAction:[field accept. top destroy]. |
393 |
top open. |
|
594 | 394 |
[exEnd] |
121 | 395 |
|
396 |
- dates: |
|
594 | 397 |
[exBegin] |
398 |
|top field spacing| |
|
121 | 399 |
|
333 | 400 |
top := StandardSystemView new. |
401 |
top extent:200@100. |
|
121 | 402 |
|
594 | 403 |
spacing := View viewSpacing. |
404 |
||
405 |
field := EditField origin:0.0 @ spacing in:top. |
|
333 | 406 |
field width:1.0. |
594 | 407 |
field horizontalInset:spacing. |
121 | 408 |
|
333 | 409 |
field converter:(PrintConverter new initForDate). |
410 |
field editValue:Date today. |
|
655 | 411 |
field acceptAction:[:value | Transcript showCR:value class name , ' ' , value printString]. |
333 | 412 |
field crAction:[field accept. top destroy]. |
413 |
top open. |
|
594 | 414 |
[exEnd] |
121 | 415 |
|
122 | 416 |
|
125 | 417 |
setting immediateAccept, makes the field update with every key: |
418 |
||
419 |
- immediate accept numbers, defaulting to nil: |
|
594 | 420 |
[exBegin] |
421 |
|top field spacing| |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
422 |
|
333 | 423 |
top := StandardSystemView new. |
424 |
top extent:200@100. |
|
121 | 425 |
|
594 | 426 |
spacing := View viewSpacing. |
427 |
||
428 |
field := EditField origin:0.0 @ spacing in:top. |
|
333 | 429 |
field width:1.0. |
594 | 430 |
field horizontalInset:spacing. |
121 | 431 |
|
333 | 432 |
field converter:(PrintConverter new initForNumberOrNil). |
433 |
field immediateAccept:true. |
|
434 |
field editValue:1234. |
|
655 | 435 |
field acceptAction:[:value | Transcript showCR:value]. |
333 | 436 |
field crAction:[field accept. top destroy]. |
437 |
top open. |
|
594 | 438 |
[exEnd] |
121 | 439 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
440 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
441 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
442 |
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
|
443 |
(i.e. actually: to the group): |
594 | 444 |
[exBegin] |
333 | 445 |
|top field1 field2 field3 group| |
121 | 446 |
|
122 | 447 |
|
333 | 448 |
top := StandardSystemView new. |
449 |
top extent:200@100. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
450 |
|
333 | 451 |
field1 := EditField origin:(0.0 @ 0.0) in:top. |
452 |
field1 width:1.0. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
453 |
|
333 | 454 |
field2 := EditField origin:(0.0 @ 0.0) in:top. |
455 |
field2 width:0.5. |
|
456 |
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
|
457 |
|
333 | 458 |
field3 := EditField origin:(0.5 @ 0.0) in:top. |
459 |
field3 width:0.5. |
|
460 |
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
|
461 |
|
333 | 462 |
group := EnterFieldGroup new. |
463 |
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
|
464 |
|
333 | 465 |
top delegate:(KeyboardForwarder to:group). |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
466 |
|
333 | 467 |
top open. |
594 | 468 |
[exEnd] |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
469 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
470 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
471 |
in addition: tell the group to close when the last field is left: |
594 | 472 |
[exBegin] |
333 | 473 |
|top field1 field2 field3 group| |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
474 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
475 |
|
333 | 476 |
top := StandardSystemView new. |
477 |
top extent:200@100. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
478 |
|
333 | 479 |
field1 := EditField origin:(0.0 @ 0.0) in:top. |
480 |
field1 width:1.0. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
481 |
|
333 | 482 |
field2 := EditField origin:(0.0 @ 0.0) in:top. |
483 |
field2 width:0.5. |
|
484 |
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
|
485 |
|
333 | 486 |
field3 := EditField origin:(0.5 @ 0.0) in:top. |
487 |
field3 width:0.5. |
|
488 |
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
|
489 |
|
333 | 490 |
group := EnterFieldGroup new. |
491 |
group add:field1; add:field2; add:field3. |
|
492 |
group leaveAction:[top destroy]. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
493 |
|
333 | 494 |
top delegate:(KeyboardForwarder to:group). |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
495 |
|
333 | 496 |
top open. |
594 | 497 |
[exEnd] |
127 | 498 |
|
499 |
||
120 | 500 |
use a model: |
501 |
(see changing model value in inspector when return is pressed in the field) |
|
594 | 502 |
[exBegin] |
333 | 503 |
|top field model| |
120 | 504 |
|
333 | 505 |
model := 'hello world' asValue. |
120 | 506 |
|
333 | 507 |
top := StandardSystemView new. |
508 |
top extent:200@100. |
|
120 | 509 |
|
333 | 510 |
field := EditField origin:(0.0 @ 0.0) in:top. |
511 |
field width:1.0. |
|
512 |
field model:model. |
|
513 |
field acceptOnReturn:true. |
|
120 | 514 |
|
333 | 515 |
top open. |
516 |
model inspect. |
|
594 | 517 |
[exEnd] |
121 | 518 |
|
122 | 519 |
|
892 | 520 |
like above, but also accept the value, when the focus is changed |
894 | 521 |
(i.e. out of the input field): |
892 | 522 |
(see changing model value in inspector) |
523 |
[exBegin] |
|
524 |
|top field model| |
|
525 |
||
526 |
model := 'hello world' asValue. |
|
527 |
||
528 |
top := StandardSystemView new. |
|
529 |
top extent:200@100. |
|
530 |
||
531 |
field := EditField origin:(0.0 @ 0.0) in:top. |
|
532 |
field width:1.0. |
|
533 |
field model:model. |
|
534 |
field acceptOnLostFocus:true. |
|
535 |
||
536 |
top open. |
|
894 | 537 |
InspectorView openOn:model monitor:'value'. |
892 | 538 |
[exEnd] |
539 |
||
540 |
||
127 | 541 |
two views on the same model (each accepts on return): |
594 | 542 |
[exBegin] |
333 | 543 |
|top1 top2 field1 field2 model| |
121 | 544 |
|
333 | 545 |
model := 'hello world' asValue. |
121 | 546 |
|
333 | 547 |
top1 := StandardSystemView new. |
548 |
top1 extent:200@100. |
|
549 |
field1 := EditField origin:(0.0 @ 0.0) in:top1. |
|
550 |
field1 width:1.0. |
|
551 |
field1 model:model. |
|
552 |
field1 acceptOnReturn:true. |
|
553 |
top1 open. |
|
121 | 554 |
|
333 | 555 |
top2 := StandardSystemView new. |
556 |
top2 extent:200@100. |
|
557 |
field2 := EditField origin:(0.0 @ 0.0) in:top2. |
|
558 |
field2 width:1.0. |
|
559 |
field2 model:model. |
|
560 |
field2 acceptOnReturn:true. |
|
561 |
top2 open. |
|
594 | 562 |
[exEnd] |
121 | 563 |
|
127 | 564 |
two views on the same model (no accept on return): |
594 | 565 |
[exBegin] |
333 | 566 |
|top1 top2 field1 field2 model| |
127 | 567 |
|
333 | 568 |
model := 'hello world' asValue. |
127 | 569 |
|
333 | 570 |
top1 := StandardSystemView new. |
571 |
top1 extent:200@100. |
|
572 |
field1 := EditField origin:(0.0 @ 0.0) in:top1. |
|
573 |
field1 width:1.0. |
|
574 |
field1 model:model; acceptOnReturn:false. |
|
575 |
top1 open. |
|
127 | 576 |
|
333 | 577 |
top2 := StandardSystemView new. |
578 |
top2 extent:200@100. |
|
579 |
field2 := EditField origin:(0.0 @ 0.0) in:top2. |
|
580 |
field2 width:1.0. |
|
581 |
field2 model:model; acceptOnReturn:false. |
|
582 |
top2 open. |
|
594 | 583 |
[exEnd] |
127 | 584 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
585 |
with immediate accept (every key updates the model): |
594 | 586 |
[exBegin] |
333 | 587 |
|top1 top2 field1 field2 model| |
125 | 588 |
|
333 | 589 |
model := 'hello world' asValue. |
125 | 590 |
|
333 | 591 |
top1 := StandardSystemView new. |
592 |
top1 extent:200@100. |
|
593 |
field1 := EditField origin:(0.0 @ 0.0) in:top1. |
|
594 |
field1 width:1.0. |
|
595 |
field1 model:model; immediateAccept:true. |
|
596 |
top1 open. |
|
125 | 597 |
|
333 | 598 |
top2 := StandardSystemView new. |
599 |
top2 extent:200@100. |
|
600 |
field2 := EditField origin:(0.0 @ 0.0) in:top2. |
|
601 |
field2 width:1.0. |
|
602 |
field2 model:model; immediateAccept:true. |
|
603 |
top2 open. |
|
594 | 604 |
[exEnd] |
122 | 605 |
|
121 | 606 |
just an example; a checkBox and an editField on the same model: |
594 | 607 |
[exBegin] |
333 | 608 |
|top1 top2 field1 box model| |
121 | 609 |
|
333 | 610 |
model := false asValue. |
121 | 611 |
|
333 | 612 |
top1 := StandardSystemView new. |
613 |
top1 extent:200@100. |
|
614 |
field1 := EditField origin:(0.0 @ 0.0) in:top1. |
|
615 |
field1 width:1.0. |
|
616 |
field1 converter:(PrintConverter new initForYesNo). |
|
617 |
field1 model:model. |
|
618 |
top1 open. |
|
121 | 619 |
|
333 | 620 |
top2 := StandardSystemView new. |
621 |
top2 extent:200@100. |
|
622 |
box := CheckBox on:model. |
|
623 |
box label:'on/off'. |
|
624 |
top2 add:box. |
|
625 |
top2 open. |
|
121 | 626 |
|
333 | 627 |
model inspect. |
594 | 628 |
[exEnd] |
125 | 629 |
|
630 |
||
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
631 |
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
|
632 |
(the fields are connected by a group to allow tabbing) |
594 | 633 |
[exBegin] |
634 |
|top panel group field1 field2 field3 box |
|
635 |
v1 v2 v3 spacing| |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
636 |
|
333 | 637 |
v1 := true asValue. |
638 |
v2 := 'some string' asValue. |
|
639 |
v3 := 1.2 asValue. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
640 |
|
333 | 641 |
top := StandardSystemView new. |
642 |
top extent:200@100. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
643 |
|
333 | 644 |
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
|
645 |
|
594 | 646 |
spacing := View viewSpacing. |
647 |
||
333 | 648 |
field1 := EditField new. |
649 |
field1 width:1.0. |
|
594 | 650 |
field1 horizontalInset:spacing. |
333 | 651 |
field1 converter:(PrintConverter new initForYesNo). |
652 |
field1 model:v1. |
|
653 |
panel add:field1. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
654 |
|
333 | 655 |
field2 := EditField new. |
656 |
field2 width:1.0. |
|
594 | 657 |
field2 horizontalInset:spacing. |
333 | 658 |
field2 model:v2. |
659 |
panel add:field2. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
660 |
|
333 | 661 |
field3 := EditField new. |
662 |
field3 width:1.0. |
|
594 | 663 |
field3 horizontalInset:spacing. |
333 | 664 |
field3 converter:(PrintConverter new initForNumber). |
665 |
field3 model:v3. |
|
666 |
panel add:field3. |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
667 |
|
333 | 668 |
group := EnterFieldGroup new. |
669 |
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
|
670 |
|
333 | 671 |
top openModal. |
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
672 |
|
655 | 673 |
Transcript showCR:v1 value. |
674 |
Transcript showCR:v2 value. |
|
675 |
Transcript showCR:v3 value. |
|
594 | 676 |
[exEnd] |
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
677 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
678 |
|
125 | 679 |
connecting fields: |
680 |
update field2 wehenever field1 is changed. |
|
681 |
(normally, the processing below (xChanged) is done in your application |
|
682 |
class, or in a complex model. For the demonstration below, we use |
|
683 |
a Plug to simulate the protocol.) |
|
594 | 684 |
[exBegin] |
333 | 685 |
|application top field1 field2 value1 value2| |
125 | 686 |
|
333 | 687 |
application := Plug new. |
688 |
application respondTo:#value1Changed |
|
689 |
with:[value2 value:(value1 value isNil ifTrue:[nil] |
|
690 |
ifFalse:[value1 value squared])]. |
|
125 | 691 |
|
333 | 692 |
value1 := 1 asValue. |
693 |
value2 := 1 asValue. |
|
125 | 694 |
|
333 | 695 |
top := Dialog new. |
696 |
top extent:200@200. |
|
125 | 697 |
|
333 | 698 |
(top addTextLabel:'some number:') layout:#left. |
699 |
top addVerticalSpace. |
|
125 | 700 |
|
333 | 701 |
(top addInputFieldOn:value1 tabable:false) |
702 |
converter:(PrintConverter new initForNumberOrNil); |
|
703 |
immediateAccept:true. |
|
704 |
top addVerticalSpace. |
|
125 | 705 |
|
333 | 706 |
(top addTextLabel:'squared:') layout:#left. |
707 |
top addVerticalSpace. |
|
708 |
(top addInputFieldOn:value2 tabable:false) |
|
709 |
converter:(PrintConverter new initForNumberOrNil). |
|
125 | 710 |
|
333 | 711 |
value1 onChangeSend:#value1Changed to:application. |
125 | 712 |
|
333 | 713 |
top openModeless. |
594 | 714 |
[exEnd] |
125 | 715 |
|
716 |
||
717 |
two-way connect: |
|
718 |
each field updates the other (notice, that we have to turn off |
|
719 |
onChange: notification, to avoid an endless notification cycle) |
|
594 | 720 |
[exBegin] |
333 | 721 |
|application top field1 field2 value1 value2| |
125 | 722 |
|
333 | 723 |
application := Plug new. |
724 |
application respondTo:#value1Changed |
|
725 |
with:[value2 retractInterestsFor:application. |
|
726 |
value2 value:(value1 value isNil ifTrue:[nil] |
|
727 |
ifFalse:[value1 value squared]). |
|
728 |
value2 onChangeSend:#value2Changed to:application. |
|
729 |
]. |
|
730 |
application respondTo:#value2Changed |
|
731 |
with:[value1 retractInterestsFor:application. |
|
732 |
value1 value:(value2 value isNil ifTrue:[nil] |
|
733 |
ifFalse:[value2 value sqrt]). |
|
734 |
value1 onChangeSend:#value1Changed to:application. |
|
735 |
]. |
|
125 | 736 |
|
333 | 737 |
value1 := 1 asValue. |
738 |
value2 := 1 asValue. |
|
125 | 739 |
|
333 | 740 |
top := Dialog new. |
741 |
top extent:200@200. |
|
125 | 742 |
|
333 | 743 |
(top addTextLabel:'some number:') layout:#left. |
744 |
top addVerticalSpace. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
745 |
|
333 | 746 |
(top addInputFieldOn:value1 tabable:false) |
747 |
converter:(PrintConverter new initForNumberOrNil); |
|
748 |
immediateAccept:true. |
|
749 |
top addVerticalSpace. |
|
125 | 750 |
|
333 | 751 |
(top addTextLabel:'squared:') layout:#left. |
752 |
top addVerticalSpace. |
|
753 |
(top addInputFieldOn:value2 tabable:false) |
|
754 |
converter:(PrintConverter new initForNumberOrNil); |
|
755 |
immediateAccept:true. |
|
125 | 756 |
|
333 | 757 |
value1 onChangeSend:#value1Changed to:application. |
758 |
value2 onChangeSend:#value2Changed to:application. |
|
125 | 759 |
|
333 | 760 |
top openModeless. |
594 | 761 |
[exEnd] |
120 | 762 |
" |
19 | 763 |
! ! |
0 | 764 |
|
892 | 765 |
!EditField class methodsFor:'defaults'! |
0 | 766 |
|
125 | 767 |
defaultLeaveKeys |
128 | 768 |
"return the set of keys which are taken as leave-keys. |
769 |
If the field is in an enterFieldGroup, all leave keys will be |
|
770 |
forwarded to the group and possible step to the next/previous field. |
|
771 |
Also, if acceptOnLeave is true, leave keys will store the current |
|
772 |
value into their model (if any)" |
|
773 |
||
125 | 774 |
^ #(Return CursorUp CursorDown Next Previous Accept) |
775 |
! |
|
776 |
||
192 | 777 |
defaultNumberOfLines |
778 |
"the number of lines in the field" |
|
779 |
||
780 |
^ 1 |
|
781 |
! |
|
782 |
||
59 | 783 |
updateStyleCache |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
784 |
"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
|
785 |
|
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
786 |
<resource: #style (#editFieldForegroundColor #editFieldBackgroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
787 |
#editFieldSelectionForegroundColor #editFieldSelectionBackgroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
788 |
#editFieldFont)> |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
789 |
|
60 | 790 |
DefaultForegroundColor := StyleSheet colorAt:'editFieldForegroundColor' default:Black. |
791 |
DefaultBackgroundColor := StyleSheet colorAt:'editFieldBackgroundColor' default:White. |
|
792 |
DefaultSelectionForegroundColor := StyleSheet colorAt:'editFieldSelectionForegroundColor' default:DefaultBackgroundColor. |
|
793 |
DefaultSelectionBackgroundColor := StyleSheet colorAt:'editFieldSelectionBackgroundColor' default:DefaultForegroundColor. |
|
794 |
DefaultFont := StyleSheet fontAt:'editFieldFont' default:nil. |
|
59 | 795 |
|
796 |
" |
|
60 | 797 |
self updateStyleCache |
59 | 798 |
" |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
799 |
|
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
800 |
"Modified: 1.3.1996 / 13:45:43 / cg" |
0 | 801 |
! ! |
802 |
||
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
803 |
!EditField methodsFor:'accepting'! |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
804 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
805 |
accept |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
806 |
"" |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
807 |
|val string| |
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 |
super accept. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
810 |
converter notNil ifTrue:[ |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
811 |
val := self editValue. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
812 |
string := converter printStringFor:val. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
813 |
string ~= self contents ifTrue:[ |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
814 |
self contents:string. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
815 |
self flash |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
816 |
] |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
817 |
]. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
818 |
! ! |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
819 |
|
192 | 820 |
!EditField methodsFor:'accessing-behavior'! |
125 | 821 |
|
192 | 822 |
acceptOnLeave:aBoolean |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
823 |
"set/clear the acceptOnLeave flag. The default is false. |
892 | 824 |
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
|
825 |
string into the valueHolder (if any). |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
826 |
(actually, the set of keys can be specified with #leaveKeys:)" |
125 | 827 |
|
192 | 828 |
acceptOnLeave := aBoolean |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
829 |
|
892 | 830 |
"Modified: 11.12.1996 / 16:47:25 / cg" |
831 |
! |
|
832 |
||
833 |
acceptOnLostFocus:aBoolean |
|
834 |
"set/clear the acceptOnLostFocus flag. The default is false. |
|
835 |
If true, a lost focus (via mouse-pointer motion etc.) accepts my |
|
836 |
string into the valueHolder (if any)." |
|
837 |
||
838 |
acceptOnLostFocus := aBoolean |
|
839 |
||
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
840 |
"Modified: 16.12.1995 / 16:26:45 / cg" |
892 | 841 |
"Created: 11.12.1996 / 16:48:00 / cg" |
192 | 842 |
! |
843 |
||
844 |
acceptOnReturn:aBoolean |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
845 |
"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
|
846 |
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
|
847 |
string into the valueHolder (if any)." |
192 | 848 |
|
849 |
acceptOnReturn := aBoolean |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
850 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
851 |
"Modified: 16.12.1995 / 16:25:34 / cg" |
125 | 852 |
! |
853 |
||
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
854 |
acceptOnTab:aBoolean |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
855 |
"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
|
856 |
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
|
857 |
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
|
858 |
(i.e. inserted into the contents)." |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
859 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
860 |
acceptOnTab := aBoolean |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
861 |
|
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
862 |
"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
|
863 |
! |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
864 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
865 |
autoScroll:aBoolean |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
866 |
"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
|
867 |
to make the cursor visible." |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
868 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
869 |
autoScrollHorizontally := aBoolean |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
870 |
! |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
871 |
|
325 | 872 |
clickAction:aBlock |
873 |
"define an action to be evaluated when being clicked upon" |
|
874 |
||
875 |
clickAction := aBlock |
|
876 |
! |
|
877 |
||
192 | 878 |
crAction:aBlock |
879 |
"define an action to be evaluated when the return key is pressed." |
|
880 |
||
881 |
crAction := aBlock |
|
882 |
! |
|
125 | 883 |
|
192 | 884 |
cursorMovementWhenUpdating:aSymbol |
885 |
"define what should be done with the cursor, when I update |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
886 |
my contents from the model. Allowed arguments are: |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
887 |
#keep / nil -> stay where it was |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
888 |
#endOfLine -> position cursor after the string |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
889 |
#beginOfLine -> position cursor to the beginning |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
890 |
The default is #endOfLine. |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
891 |
This may be useful for fields which get new values assigned from |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
892 |
the program (i.e. not from the user)" |
125 | 893 |
|
192 | 894 |
cursorMovementWhenUpdating := aSymbol |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
895 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
896 |
"Modified: 16.12.1995 / 16:27:55 / cg" |
192 | 897 |
! |
898 |
||
899 |
disable |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
900 |
"disable the field; hide the cursor and ignore input" |
192 | 901 |
|
902 |
enabled ifTrue:[ |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
903 |
enabled := false. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
904 |
self hideCursor |
125 | 905 |
] |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
906 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
907 |
"Modified: 16.12.1995 / 16:28:05 / cg" |
125 | 908 |
! |
909 |
||
192 | 910 |
enable |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
911 |
"enable the field; show the cursor and allow input" |
127 | 912 |
|
192 | 913 |
enabled ifFalse:[ |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
914 |
enabled := true. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
915 |
super showCursor |
192 | 916 |
] |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
917 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
918 |
"Modified: 16.12.1995 / 16:28:09 / cg" |
127 | 919 |
! |
920 |
||
192 | 921 |
entryCompletionBlock:aOneArgBlock |
922 |
"define an action to be evaluated when Tab (NameCompletion) is pressed. |
|
923 |
The block gets the current contents as argument." |
|
924 |
||
925 |
entryCompletionBlock := aOneArgBlock |
|
125 | 926 |
! |
927 |
||
192 | 928 |
immediateAccept:aBoolean |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
929 |
"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
|
930 |
If true, every pressed key immediately accepts my |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
931 |
string into the valueHolder (if any)." |
155 | 932 |
|
192 | 933 |
immediateAccept := aBoolean |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
934 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
935 |
"Modified: 16.12.1995 / 16:25:57 / cg" |
192 | 936 |
! |
155 | 937 |
|
192 | 938 |
leaveAction:aBlock |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
939 |
"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
|
940 |
(actually, the set of keys can be specified with #leaveKeys:)" |
192 | 941 |
|
942 |
leaveAction := aBlock |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
943 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
944 |
"Modified: 16.12.1995 / 16:26:36 / cg" |
155 | 945 |
! |
946 |
||
192 | 947 |
leaveKeys:aCollectionOfKeySymbols |
948 |
"define the set of keys which are interpreted as leaveKeys. |
|
949 |
I.e. those that make the field inactive and accept (if acceptOnLeave is true). |
|
950 |
The default is a set of #CursorUp, #CursorDown, #Next, #Prior and #Return." |
|
155 | 951 |
|
192 | 952 |
leaveKeys := aCollectionOfKeySymbols |
953 |
! |
|
155 | 954 |
|
594 | 955 |
makeTabable |
956 |
"arrange for Tab to accept & leave the field |
|
957 |
If the field is part of a group, the next field gets the |
|
958 |
input focus" |
|
959 |
||
960 |
leaveKeys isNil ifTrue:[ |
|
961 |
leaveKeys := self class defaultLeaveKeys |
|
962 |
]. |
|
963 |
leaveKeys := leaveKeys copyWith:#Tab |
|
964 |
||
965 |
"Created: 27.4.1996 / 17:09:48 / cg" |
|
966 |
! |
|
967 |
||
192 | 968 |
tabAction:aBlock |
969 |
"define an action to be evaluated when the tabulator key is pressed." |
|
155 | 970 |
|
192 | 971 |
tabAction := aBlock |
594 | 972 |
! |
973 |
||
974 |
tabKey:aKeySymbol |
|
975 |
"arrange for aKeySymbol to accept & leave the field |
|
976 |
If the field is part of a group, the next field gets the |
|
977 |
input focus" |
|
978 |
||
979 |
leaveKeys isNil ifTrue:[ |
|
980 |
leaveKeys := self class defaultLeaveKeys |
|
981 |
]. |
|
982 |
leaveKeys := leaveKeys copyWith:#Tab |
|
983 |
||
984 |
"Created: 27.4.1996 / 17:08:54 / cg" |
|
187 | 985 |
! ! |
125 | 986 |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
987 |
!EditField methodsFor:'accessing-channels'! |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
988 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
989 |
enableChannel |
601 | 990 |
"return a valueHolder for enable/disable" |
991 |
||
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
992 |
^ enableChannel |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
993 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
994 |
"Modified: 6.9.1995 / 13:43:33 / claus" |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
995 |
"Created: 16.12.1995 / 16:29:05 / cg" |
601 | 996 |
"Modified: 30.4.1996 / 15:09:09 / cg" |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
997 |
! |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
998 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
999 |
enableChannel:aValueHolder |
601 | 1000 |
"set the valueHolder, which holds the enable boolean value" |
1001 |
||
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1002 |
|wasEnabled| |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1003 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1004 |
enableChannel notNil ifTrue:[ |
601 | 1005 |
wasEnabled := enableChannel value. |
1006 |
enableChannel retractInterestsFor:self. |
|
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1007 |
] ifFalse:[ |
601 | 1008 |
wasEnabled := enabled |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1009 |
]. |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1010 |
enableChannel := aValueHolder. |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1011 |
aValueHolder onChangeSend:#enableStateChange to:self. |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1012 |
enableChannel value ~~ wasEnabled ifTrue:[ |
601 | 1013 |
self enableStateChange |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1014 |
] |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1015 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1016 |
"Created: 16.12.1995 / 16:35:32 / cg" |
601 | 1017 |
"Modified: 30.4.1996 / 15:10:03 / cg" |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1018 |
! ! |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1019 |
|
187 | 1020 |
!EditField methodsFor:'accessing-contents'! |
125 | 1021 |
|
187 | 1022 |
contents |
1023 |
"return contents as a string |
|
1024 |
- redefined since EditFields hold only one line of text. |
|
1025 |
In your application, please use #editValue; |
|
1026 |
it uses a converter (if any) and is compatible to ST-80." |
|
1027 |
||
1028 |
list isNil ifTrue:[^ '']. |
|
1029 |
(list size == 0) ifTrue:[^ '']. |
|
1030 |
^ list at:1 |
|
1031 |
! |
|
1032 |
||
125 | 1033 |
contents:someText |
1034 |
"set the contents from a string |
|
1035 |
- redefined to place the cursor to the end. |
|
1036 |
In your application, please use #editValue:; |
|
1037 |
it uses a converter (if any) and is compatible to ST-80." |
|
1038 |
||
187 | 1039 |
|newCol| |
1040 |
||
1041 |
newCol := cursorCol. |
|
1042 |
||
125 | 1043 |
super contents:someText. |
1044 |
||
187 | 1045 |
cursorMovementWhenUpdating == #endOfLine ifTrue:[ |
1046 |
newCol := (someText size + 1). |
|
1047 |
] ifFalse:[ |
|
1048 |
cursorMovementWhenUpdating == #beginOfLine ifTrue:[ |
|
1049 |
newCol := 1 |
|
1050 |
] ifFalse:[ |
|
1051 |
"/ default: stay where it was |
|
1052 |
] |
|
1053 |
]. |
|
125 | 1054 |
|
187 | 1055 |
self cursorCol:newCol. |
125 | 1056 |
! |
1057 |
||
192 | 1058 |
converter |
1059 |
"return the converter (if any)." |
|
1060 |
||
1061 |
^ converter |
|
1062 |
! |
|
1063 |
||
1064 |
converter:aConverter |
|
1065 |
"set the converter. If non-nil, |
|
1066 |
the converter is applied to the text to convert from the string |
|
1067 |
representation to the actual object value and vice versa. |
|
1068 |
The default converter is nil, meaning no-conversion |
|
1069 |
(i.e. the edited object is the string itself." |
|
1070 |
||
1071 |
converter := aConverter |
|
1072 |
! |
|
1073 |
||
125 | 1074 |
editValue |
1075 |
"if the field edits a string, this is a name alias for #contents. |
|
1076 |
Otherwise, if there is a converter, return the edited string |
|
1077 |
converted to an appropriate object." |
|
1078 |
||
1079 |
|string| |
|
1080 |
||
1081 |
string := self contents. |
|
279 | 1082 |
string isNil ifTrue:[string := '']. |
125 | 1083 |
converter isNil ifTrue:[^ string]. |
1084 |
^ converter readValueFrom:string |
|
1085 |
! |
|
0 | 1086 |
|
125 | 1087 |
editValue:aStringOrObject |
1088 |
"set the contents. If there is a converter, use it to convert |
|
1089 |
the object into a printed representation. |
|
1090 |
Otherwise, the argument is supposed to be a string like object, |
|
1091 |
and used directly (i.e. this is equivalent to sending #contents:)." |
|
1092 |
||
1093 |
self editValue:aStringOrObject selected:false |
|
0 | 1094 |
! |
1095 |
||
125 | 1096 |
editValue:aStringOrObject selected:aBoolean |
1097 |
"set the contents. If there is a converter, use it to convert |
|
1098 |
the object into a printed representation. |
|
1099 |
Otherwise, the argument is supposed to be a string like object, |
|
187 | 1100 |
and used directly (i.e. this is equivalent to sending #initialText:selected:)." |
125 | 1101 |
|
1102 |
|string| |
|
1103 |
||
1104 |
converter notNil ifTrue:[ |
|
1105 |
string := converter printStringFor:aStringOrObject |
|
1106 |
] ifFalse:[ |
|
1107 |
string := aStringOrObject. |
|
1108 |
]. |
|
1109 |
self contents:string. |
|
1110 |
aBoolean ifTrue:[ |
|
1111 |
self selectFromLine:1 col:1 toLine:1 col:string size |
|
1112 |
] |
|
1113 |
! |
|
1114 |
||
192 | 1115 |
initialText:aString |
1116 |
"set the initialText and select it" |
|
1117 |
||
1118 |
self initialText:aString selected:true |
|
1119 |
! |
|
1120 |
||
187 | 1121 |
initialText:aString selected:aBoolean |
1122 |
"set the initialText and select it if aBoolean is true" |
|
1123 |
||
1124 |
|len s| |
|
125 | 1125 |
|
187 | 1126 |
leftOffset := 0. |
1127 |
(s := aString) notNil ifTrue:[ |
|
1128 |
s := s asString |
|
1129 |
]. |
|
1130 |
self contents:s. |
|
1131 |
aBoolean ifTrue:[ |
|
1132 |
(len := s size) ~~ 0 ifTrue:[ |
|
1133 |
self selectFromLine:1 col:1 toLine:1 col:len |
|
1134 |
] |
|
1135 |
] |
|
1136 |
! |
|
1137 |
||
192 | 1138 |
list:someText |
1139 |
"low level access to the underlying contents' list. |
|
1140 |
Redefined to force text to 1 line, and notify dependents |
|
1141 |
of any changed extent-wishes (for automatic box resizing)." |
|
1142 |
||
1143 |
|l oldWidth| |
|
187 | 1144 |
|
192 | 1145 |
l := someText. |
1146 |
l size > 1 ifTrue:[ |
|
1147 |
l := OrderedCollection with:(l at:1) |
|
1148 |
]. |
|
1149 |
oldWidth := self widthOfContents. |
|
1150 |
super list:l. |
|
1151 |
self widthOfContents ~~ oldWidth ifTrue:[ |
|
1152 |
self changed:#preferredExtent |
|
1153 |
] |
|
187 | 1154 |
! |
1155 |
||
1156 |
stringValue |
|
1157 |
"alias for #contents - for compatibility with ST-80's InputField" |
|
1158 |
||
1159 |
^ self contents |
|
1160 |
! ! |
|
1161 |
||
1162 |
!EditField methodsFor:'accessing-look'! |
|
125 | 1163 |
|
155 | 1164 |
maxChars |
1165 |
"return the maximum number of characters that are allowed in |
|
1166 |
the field. |
|
1167 |
A limit of nil means: unlimited. This is the default." |
|
1168 |
||
1169 |
^ lengthLimit |
|
1170 |
||
1171 |
"Modified: 6.9.1995 / 13:43:33 / claus" |
|
1172 |
! |
|
1173 |
||
125 | 1174 |
maxChars:aNumberOrNil |
1175 |
"set the maximum number of characters that are allowed in |
|
1176 |
the field. Additional input will be ignored by the field. |
|
1177 |
A limit of nil 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
|
1178 |
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
|
1179 |
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
|
1180 |
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
|
1181 |
|
125 | 1182 |
This method has been renamed from #lengthLimit: for ST-80 |
1183 |
compatibility." |
|
1184 |
||
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1185 |
lengthLimit := aNumberOrNil. |
187 | 1186 |
! |
1187 |
||
192 | 1188 |
passwordCharacter |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1189 |
"return the passwordCharacter; |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1190 |
If nonNil, that one is replacing typed input |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1191 |
(for secret input)" |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1192 |
|
192 | 1193 |
^ passwordCharacter |
0 | 1194 |
|
192 | 1195 |
"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
|
1196 |
"Modified: 16.12.1995 / 16:24:25 / cg" |
125 | 1197 |
! |
1198 |
||
192 | 1199 |
passwordCharacter:aCharacter |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1200 |
"set the passwordCharacter; |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1201 |
If nonNil, that one is replacing typed input |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1202 |
(for secret input)" |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1203 |
|
192 | 1204 |
passwordCharacter := aCharacter |
97 | 1205 |
|
192 | 1206 |
"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
|
1207 |
"Modified: 16.12.1995 / 16:24:33 / cg" |
38 | 1208 |
! ! |
1209 |
||
0 | 1210 |
!EditField methodsFor:'cursor drawing'! |
1211 |
||
155 | 1212 |
drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg |
1213 |
startVisLineNr to:endVisLineNr do:[:visLine | |
|
1214 |
self drawVisibleLine:visLine with:fg and:bg |
|
1215 |
] |
|
1216 |
||
1217 |
"Modified: 6.9.1995 / 12:24:29 / claus" |
|
1218 |
! |
|
1219 |
||
0 | 1220 |
showCursor |
1221 |
"make cursor visible if currently invisible - but only if this |
|
1222 |
EditField is enabled" |
|
1223 |
||
1224 |
enabled ifTrue:[super showCursor] |
|
1225 |
! ! |
|
1226 |
||
1227 |
!EditField methodsFor:'cursor movement'! |
|
1228 |
||
1229 |
cursorDown |
|
1230 |
"catch cursor movement" |
|
1231 |
||
1232 |
(cursorVisibleLine == nLinesShown) ifFalse:[ |
|
59 | 1233 |
super cursorDown |
0 | 1234 |
] |
192 | 1235 |
! |
1236 |
||
1237 |
cursorLine:line col:col |
|
1238 |
"catch cursor movement" |
|
1239 |
||
1240 |
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
|
1241 |
! |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1242 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1243 |
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
|
1244 |
"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
|
1245 |
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
|
1246 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1247 |
|sz| |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1248 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1249 |
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
|
1250 |
lengthLimit notNil ifTrue:[ |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1251 |
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
|
1252 |
]. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1253 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1254 |
col <= sz ifTrue:[ |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1255 |
^ col |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1256 |
]. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1257 |
^ 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
|
1258 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1259 |
"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
|
1260 |
"Modified: 22.5.1996 / 18:19:04 / cg" |
192 | 1261 |
! ! |
1262 |
||
1263 |
!EditField methodsFor:'editing'! |
|
1264 |
||
1265 |
paste:someText |
|
1266 |
"redefined to force text to 1 line" |
|
1267 |
||
1268 |
super paste:someText. |
|
1269 |
list size > 1 ifTrue:[ |
|
1270 |
self deleteFromLine:2 toLine:(list size) |
|
1271 |
] |
|
0 | 1272 |
! ! |
1273 |
||
70 | 1274 |
!EditField methodsFor:'event handling'! |
19 | 1275 |
|
192 | 1276 |
buttonPress:button x:x y:y |
1277 |
"enable myself on mouse click" |
|
1278 |
||
673
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1279 |
|prevFocus| |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1280 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1281 |
enabled ifFalse:[^ self]. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1282 |
|
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1283 |
prevFocus := hasKeyboardFocus. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1284 |
clickAction notNil ifTrue:[ |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1285 |
clickAction value:self |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1286 |
]. |
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1287 |
hasKeyboardFocus ~~ prevFocus ifTrue:[ |
333 | 1288 |
^ self |
1289 |
]. |
|
1290 |
||
316
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1291 |
super buttonPress:button x:x y:y |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1292 |
|
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1293 |
"/ enabled ifFalse:[ |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1294 |
"/ enabled := true. |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1295 |
"/ super buttonPress:button x:x y:y. |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1296 |
"/ enableAction notNil ifTrue:[ |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1297 |
"/ enableAction value |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1298 |
"/ ] |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1299 |
"/ ] ifTrue:[ |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1300 |
"/ super buttonPress:button x:x y:y |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1301 |
"/ ] |
333 | 1302 |
|
673
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1303 |
"Modified: 22.5.1996 / 15:02:45 / cg" |
192 | 1304 |
! |
1305 |
||
1306 |
canHandle:aKey |
|
1307 |
"return true, if the receiver would like to handle aKey |
|
1308 |
(usually from another view, when the receiver is part of |
|
1309 |
a more complex dialog box). |
|
1310 |
We do return true here, since the editfield will handle |
|
1311 |
all keys. |
|
1312 |
OBSOLETE: dont use this anymore - its a leftover for the tableWidget" |
|
1313 |
||
1314 |
^ true |
|
1315 |
! |
|
1316 |
||
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1317 |
enableStateChange |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1318 |
enableChannel value ifTrue:[ |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1319 |
self enable |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1320 |
] ifFalse:[ |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1321 |
self disable |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1322 |
]. |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1323 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1324 |
"Created: 16.12.1995 / 16:35:39 / cg" |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1325 |
"Modified: 16.12.1995 / 16:36:13 / cg" |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1326 |
! |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1327 |
|
192 | 1328 |
focusIn |
1329 |
"got the explicit focus" |
|
1330 |
||
316
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1331 |
"/ enabled ifFalse:[ |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1332 |
"/ enabled := true. |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1333 |
"/ super focusIn. |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1334 |
"/ enableAction notNil ifTrue:[ |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1335 |
"/ enableAction value |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1336 |
"/ ] |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1337 |
"/ ] ifTrue:[ |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1338 |
"/ super focusIn |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1339 |
"/ ]. |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1340 |
^ super focusIn |
192 | 1341 |
! |
1342 |
||
892 | 1343 |
hasKeyboardFocus:aBoolean |
1344 |
aBoolean ifFalse:[ |
|
1345 |
acceptOnLostFocus ifTrue:[ |
|
1346 |
self accept. |
|
1347 |
]. |
|
1348 |
]. |
|
1349 |
super hasKeyboardFocus:aBoolean |
|
1350 |
||
1351 |
"Created: 11.12.1996 / 16:57:50 / cg" |
|
1352 |
"Modified: 11.12.1996 / 16:58:09 / cg" |
|
1353 |
! |
|
1354 |
||
125 | 1355 |
keyPress:key x:x y:y |
1356 |
"if keyHandler is defined, pass input; otherwise check for leave |
|
1357 |
keys" |
|
1358 |
||
490 | 1359 |
<resource: #keyboard (#Tab #Return #Find #FindNext #FindPrev |
922 | 1360 |
#DeleteLine #GotoLine #EndOfLine #EndOfText |
1361 |
#CursorDown #CursorUp)> |
|
132 | 1362 |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1363 |
|leave xCol newOffset newWidth s| |
125 | 1364 |
|
1365 |
enabled ifFalse:[ |
|
325 | 1366 |
^ self |
125 | 1367 |
]. |
1368 |
||
1369 |
(key == #DeleteLine) ifTrue:[ |
|
325 | 1370 |
Smalltalk at:#CopyBuffer put:(self contents). |
1371 |
self contents:''. ^ self |
|
125 | 1372 |
]. |
19 | 1373 |
|
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
1374 |
leave := leaveKeys includes:key. |
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
1375 |
|
125 | 1376 |
(key == #Tab) ifTrue:[ |
964
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1377 |
tabAction notNil ifTrue:[ |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1378 |
"/ tab-hook. |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1379 |
acceptOnTab ifTrue:[ |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1380 |
self accept. |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1381 |
]. |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1382 |
tabAction value. |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1383 |
^ self |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1384 |
]. |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1385 |
|
325 | 1386 |
entryCompletionBlock notNil ifTrue:[ |
1387 |
s := self contents. |
|
1388 |
s isNil ifTrue:[ |
|
1389 |
s := '' |
|
1390 |
] ifFalse:[ |
|
1391 |
s := s asString |
|
1392 |
]. |
|
1393 |
entryCompletionBlock value:s. ^ self |
|
1394 |
] ifFalse:[ |
|
1395 |
acceptOnTab ifTrue:[ |
|
480 | 1396 |
self accept. |
325 | 1397 |
] |
1398 |
]. |
|
594 | 1399 |
leave ifFalse:[ |
737
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1400 |
"/ 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
|
1401 |
^ super keyPress:#FocusNext x:x y:y |
594 | 1402 |
] |
125 | 1403 |
]. |
480 | 1404 |
|
125 | 1405 |
(key == #Return) ifTrue:[ |
964
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1406 |
crAction notNil ifTrue:[ |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1407 |
"/ cr-hook. |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1408 |
acceptOnReturn ifTrue:[ |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1409 |
self accept. |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1410 |
]. |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1411 |
crAction value. |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1412 |
^ self |
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1413 |
]. |
737
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1414 |
leave ifFalse:[ |
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1415 |
"/ 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
|
1416 |
^ super keyPress:#FocusNext x:x y:y |
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1417 |
] |
125 | 1418 |
]. |
480 | 1419 |
|
125 | 1420 |
leave ifTrue:[ |
325 | 1421 |
((key == #Return and:[acceptOnReturn]) |
480 | 1422 |
or:[key ~~ #Return and:[acceptOnLeave]]) ifTrue:[ |
325 | 1423 |
self accept. |
1424 |
]. |
|
279 | 1425 |
|
325 | 1426 |
leaveAction notNil ifTrue:[ |
1427 |
^ leaveAction value:key |
|
1428 |
]. |
|
125 | 1429 |
|
611
87637cf3931b
Handle keypress:key x:nil y:nil correctly (means recursion).
Stefan Vogel <sv@exept.de>
parents:
601
diff
changeset
|
1430 |
(x notNil and:[x >= 0]) ifTrue:[ |
325 | 1431 |
" |
737
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1432 |
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
|
1433 |
let superview know about the key that caused us to leave (maybe RETURN, DOWN, UP etc.... |
325 | 1434 |
" |
1435 |
(superView notNil and:[superView canHandle:key from:self]) ifTrue:[ |
|
1436 |
superView keyPress:key x:x y:y. |
|
1437 |
]. |
|
1438 |
]. |
|
737
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1439 |
|
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1440 |
"/ 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
|
1441 |
"/ 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
|
1442 |
key == #CursorDown ifTrue:[ |
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1443 |
"/ 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
|
1444 |
^ super keyPress:#FocusNext x:x y:y |
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1445 |
]. |
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1446 |
key == #CursorUp ifTrue:[ |
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1447 |
"/ 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
|
1448 |
^ super keyPress:#FocusPrevious x:x y:y |
911a168ef967
handle leave from EditField without a group as a focus-stepping
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
1449 |
]. |
325 | 1450 |
^ self |
19 | 1451 |
]. |
121 | 1452 |
|
125 | 1453 |
" |
1454 |
ignore some keys (if not a leaveKey) ... |
|
1455 |
" |
|
1456 |
(key == #Find) ifTrue:[^self]. |
|
1457 |
(key == #FindNext) ifTrue:[^self]. |
|
1458 |
(key == #FindPrev) ifTrue:[^self]. |
|
1459 |
(key == #GotoLine) ifTrue:[^self]. |
|
1460 |
||
1461 |
" |
|
1462 |
a normal key - let superclass's method insert it |
|
1463 |
" |
|
1464 |
super keyPress:key x:x y:y. |
|
1465 |
||
1466 |
" |
|
1467 |
for end-of-text, also move to end-of-line |
|
1468 |
" |
|
1469 |
key == #EndOfText ifTrue:[ |
|
325 | 1470 |
super keyPress:#EndOfLine x:x y:y. |
125 | 1471 |
]. |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1472 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1473 |
self resizeOrScroll. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1474 |
|
611
87637cf3931b
Handle keypress:key x:nil y:nil correctly (means recursion).
Stefan Vogel <sv@exept.de>
parents:
601
diff
changeset
|
1475 |
"Modified: 2.5.1996 / 17:24:16 / stefan" |
964
73525cfd8fa2
dont forget to accept, when only (cr- and tab-) actions are defined
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
1476 |
"Modified: 22.1.1997 / 02:08:35 / cg" |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1477 |
! |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1478 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1479 |
resizeOrScroll |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1480 |
"helper for keyPress. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1481 |
Extracted for easier subclass redefinition." |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1482 |
|
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1483 |
|xCol newOffset newWidth| |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1484 |
|
125 | 1485 |
newWidth := self widthOfContents. |
1486 |
||
1487 |
" |
|
1488 |
should (& can) we resize ? |
|
1489 |
" |
|
1490 |
xCol := (self xOfCol:cursorCol inVisibleLine:cursorLine) - leftOffset. |
|
1491 |
(xCol > (width * (5/6))) ifTrue:[ |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1492 |
self changed:#preferredExtent |
125 | 1493 |
] ifFalse:[ |
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1494 |
newWidth < (width * (1/6)) ifTrue:[ |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1495 |
self changed:#preferredExtent |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1496 |
] |
125 | 1497 |
]. |
1498 |
||
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1499 |
autoScrollHorizontally ifTrue:[ |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1500 |
" |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1501 |
did someone react (i.e. has my extent changed) ? |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1502 |
(if not, we scroll horizontally) |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1503 |
" |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1504 |
xCol := (self xOfCol:cursorCol inVisibleLine:cursorLine) - leftOffset. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1505 |
(xCol > (width * (5/6))) ifTrue:[ |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1506 |
newOffset := leftOffset + (width // 2). |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1507 |
] ifFalse:[ |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1508 |
(xCol < (width * (1/6))) ifTrue:[ |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1509 |
newOffset := 0 max: leftOffset - (width // 2). |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1510 |
] ifFalse:[ |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1511 |
newOffset := leftOffset |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1512 |
] |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1513 |
]. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1514 |
newOffset ~~ leftOffset ifTrue:[ |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1515 |
self scrollHorizontalTo:newOffset. |
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1516 |
] |
125 | 1517 |
]. |
316
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1518 |
! |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1519 |
|
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1520 |
showFocus:explicit |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1521 |
"/ giving me the focus is loke clicking on me |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1522 |
"/ (tell my enterFieldGroup .... |
1e27aa926710
fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents:
309
diff
changeset
|
1523 |
|
343
a7b6fbfdc453
oops - explicit focusChange was broken
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
1524 |
(enabled or:[explicit]) ifTrue:[ |
333 | 1525 |
clickAction notNil ifTrue:[clickAction value:self]. |
1526 |
self showCursor. |
|
1527 |
super showFocus:explicit |
|
1528 |
] |
|
1529 |
||
343
a7b6fbfdc453
oops - explicit focusChange was broken
Claus Gittinger <cg@exept.de>
parents:
333
diff
changeset
|
1530 |
"Modified: 9.2.1996 / 20:49:48 / cg" |
784
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1531 |
! |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1532 |
|
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1533 |
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
|
1534 |
"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
|
1535 |
|
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1536 |
|xCol newOffset| |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1537 |
|
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1538 |
leftOffset ~~ 0 ifTrue:[ |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1539 |
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
|
1540 |
(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
|
1541 |
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
|
1542 |
]. |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1543 |
]. |
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1544 |
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
|
1545 |
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
|
1546 |
|
4161490a4b6d
scroll to origin, if size changes and all text fits into the view.
Claus Gittinger <cg@exept.de>
parents:
737
diff
changeset
|
1547 |
"Modified: 10.7.1996 / 10:59:37 / cg" |
192 | 1548 |
! ! |
1549 |
||
1550 |
!EditField methodsFor:'initialization'! |
|
1551 |
||
1552 |
editMenu |
|
725 | 1553 |
<resource: #keyboard ( #Accept #Copy #Cut #Paste ) > |
1554 |
||
506
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1555 |
|labels selectors shorties m| |
192 | 1556 |
|
1557 |
labels := #( |
|
333 | 1558 |
'copy' |
1559 |
'cut' |
|
1560 |
'paste' |
|
1561 |
). |
|
192 | 1562 |
|
506
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1563 |
selectors := #( |
333 | 1564 |
copySelection |
1565 |
cut |
|
1566 |
paste |
|
1567 |
). |
|
192 | 1568 |
|
506
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1569 |
shorties := #( |
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1570 |
#Copy |
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1571 |
#Cut |
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1572 |
#Paste |
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1573 |
). |
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1574 |
|
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1575 |
(acceptAction notNil |
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1576 |
or:[model notNil and:[changeMsg notNil]]) ifTrue:[ |
677
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1577 |
immediateAccept ifFalse:[ |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1578 |
labels := labels , #( |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1579 |
'-' |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1580 |
'accept' |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1581 |
). |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1582 |
selectors := selectors , #( |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1583 |
nil |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1584 |
#accept |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1585 |
). |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1586 |
shorties := shorties , #( |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1587 |
nil |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1588 |
#Accept |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1589 |
). |
5cacd1adea6a
no <accept> menu if immediateAccept is on
Claus Gittinger <cg@exept.de>
parents:
673
diff
changeset
|
1590 |
]. |
506
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1591 |
]. |
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1592 |
|
192 | 1593 |
m := PopUpMenu |
506
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1594 |
labels:(resources array:labels) |
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1595 |
selectors:selectors |
3273d75c3526
added accelerators; no Accept if there is no acceptAction/model
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
1596 |
accelerators:shorties. |
192 | 1597 |
|
1598 |
self hasSelection ifFalse:[ |
|
333 | 1599 |
m disableAll:#(copySelection cut) |
1600 |
]. |
|
1601 |
enabled ifFalse:[ |
|
1602 |
m disableAll:#(cut paste accept) |
|
192 | 1603 |
]. |
1604 |
||
1605 |
^ m |
|
333 | 1606 |
|
725 | 1607 |
"Modified: 29.5.1996 / 17:34:38 / cg" |
19 | 1608 |
! |
0 | 1609 |
|
192 | 1610 |
initStyle |
967 | 1611 |
"setup viewStyle specifics" |
1612 |
||
192 | 1613 |
super initStyle. |
1614 |
||
392
81343306d796
eliminated all DefaultFont classVars (are now classINSTvars)
Claus Gittinger <cg@exept.de>
parents:
343
diff
changeset
|
1615 |
"/ DefaultFont notNil ifTrue:[font := DefaultFont on:device] |
81343306d796
eliminated all DefaultFont classVars (are now classINSTvars)
Claus Gittinger <cg@exept.de>
parents:
343
diff
changeset
|
1616 |
|
192 | 1617 |
DefaultBackgroundColor notNil ifTrue:[ |
967 | 1618 |
bgColor := DefaultBackgroundColor on:device. |
1619 |
self viewBackground:bgColor. |
|
192 | 1620 |
]. |
1621 |
fgColor := DefaultForegroundColor. |
|
1622 |
selectionFgColor := DefaultSelectionForegroundColor. |
|
1623 |
selectionBgColor := DefaultSelectionBackgroundColor. |
|
967 | 1624 |
|
1625 |
"Modified: 22.1.1997 / 11:57:10 / cg" |
|
192 | 1626 |
! |
0 | 1627 |
|
192 | 1628 |
initialize |
1629 |
super initialize. |
|
832 | 1630 |
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
|
1631 |
|
192 | 1632 |
enabled := true. |
1633 |
fixedSize := true. |
|
290
f539121393b1
innerWidth:/innerHeight support; much more docu in editField
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
1634 |
autoScrollHorizontally := true. |
192 | 1635 |
nFullLinesShown := 1. |
1636 |
nLinesShown := 1. |
|
673
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1637 |
trimBlankLines := false. |
192 | 1638 |
immediateAccept := false. |
298
932fa5ca44f8
added more control over tab-key behavior (acceptOnTab:); added more examples & docu
ah
parents:
290
diff
changeset
|
1639 |
acceptOnLeave := acceptOnReturn := acceptOnTab := true. |
192 | 1640 |
cursorShown := true. |
673
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1641 |
|
594 | 1642 |
leaveKeys isNil ifTrue:[ |
1643 |
leaveKeys := self class defaultLeaveKeys. |
|
1644 |
]. |
|
192 | 1645 |
cursorMovementWhenUpdating := #endOfLine |
594 | 1646 |
|
673
e5a4bcfc960e
use new cursorValidation (now positions at end-of-input when clicked)
Claus Gittinger <cg@exept.de>
parents:
667
diff
changeset
|
1647 |
"Modified: 22.5.1996 / 15:37:16 / cg" |
192 | 1648 |
! ! |
1649 |
||
1650 |
!EditField methodsFor:'private'! |
|
1651 |
||
1652 |
argForChangeMessage |
|
1653 |
"redefined to send use converted value (if I have one)" |
|
1654 |
||
1655 |
^ self editValue |
|
1656 |
! |
|
1657 |
||
1658 |
getListFromModel |
|
1659 |
"redefined to aquire the text via the aspectMsg - not the listMsg, |
|
1660 |
and to ignore updates resulting from my own change." |
|
1661 |
||
1662 |
" |
|
1663 |
ignore updates from my own change |
|
1664 |
" |
|
1665 |
lockUpdates ifTrue:[ |
|
1666 |
lockUpdates := false. |
|
1667 |
^ self |
|
1668 |
]. |
|
1669 |
||
1670 |
(model notNil and:[aspectMsg notNil]) ifTrue:[ |
|
1671 |
self editValue:(model perform:aspectMsg). |
|
0 | 1672 |
] |
1673 |
! |
|
1674 |
||
192 | 1675 |
startAutoScrollDown:y |
1676 |
"no vertical scrolling in editfields" |
|
1677 |
||
1678 |
^ self |
|
1679 |
! |
|
1680 |
||
1681 |
startAutoScrollUp:y |
|
1682 |
"no vertical scrolling in editfields" |
|
1683 |
||
1684 |
^ self |
|
1685 |
! |
|
0 | 1686 |
|
192 | 1687 |
textChanged |
1688 |
"this is sent by mySelf (somewhere in a superclass) whenever |
|
1689 |
my contents has changed. |
|
1690 |
A good place to add immediateAccept functionality and check for the |
|
1691 |
lengthLimit." |
|
1692 |
||
1693 |
|string c| |
|
1694 |
||
1695 |
super textChanged. |
|
1696 |
string := self contents. |
|
1697 |
lengthLimit notNil ifTrue:[ |
|
1698 |
string size > lengthLimit ifTrue:[ |
|
1699 |
c := cursorCol. |
|
1700 |
self contents:(string copyTo:lengthLimit). |
|
1701 |
self flash. |
|
1702 |
self cursorCol:c. |
|
125 | 1703 |
] |
0 | 1704 |
]. |
192 | 1705 |
immediateAccept ifTrue:[ |
1706 |
self accept |
|
1707 |
] |
|
105 | 1708 |
! |
1709 |
||
192 | 1710 |
visibleAt:visLineNr |
1711 |
"return the string at lineNr for display. |
|
1712 |
If there is a password character, return a string consisting of those only." |
|
1713 |
||
1714 |
|s| |
|
105 | 1715 |
|
192 | 1716 |
s := super visibleAt:visLineNr. |
1717 |
passwordCharacter notNil ifTrue:[ |
|
1718 |
^ String new:(s size) withAll:passwordCharacter |
|
1719 |
]. |
|
1720 |
^ s |
|
1721 |
||
1722 |
"Modified: 6.9.1995 / 12:25:06 / claus" |
|
0 | 1723 |
! ! |
125 | 1724 |
|
192 | 1725 |
!EditField methodsFor:'queries'! |
1726 |
||
561 | 1727 |
isInputField |
1728 |
"return true, if the receiver is some kind of input view, |
|
1729 |
i.e. it should (can) be part of an enterGroup. |
|
1730 |
Return true here" |
|
1731 |
||
1732 |
^ true |
|
1733 |
||
1734 |
"Created: 4.3.1996 / 11:32:34 / cg" |
|
1735 |
! |
|
1736 |
||
192 | 1737 |
preferredExtent |
1738 |
"return the preferred extent of this view. |
|
1739 |
That is the width of the string plus some extra, |
|
1740 |
but not wider than half of the screen" |
|
1741 |
||
1742 |
|string w f| |
|
125 | 1743 |
|
800 | 1744 |
"/ If I have an explicit preferredExtent .. |
1745 |
||
714
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
677
diff
changeset
|
1746 |
preferredExtent notNil ifTrue:[ |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
677
diff
changeset
|
1747 |
^ preferredExtent |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
677
diff
changeset
|
1748 |
]. |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
677
diff
changeset
|
1749 |
|
192 | 1750 |
string := self contents. |
1751 |
(string isNil or:[string isBlank]) ifTrue:[ |
|
667
d02f6bba8fc5
use fonts maxHeight in prefExtent (A-Umlaut)
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
1752 |
string := ' ' "/ just any string is ok ^ super preferredExtent |
192 | 1753 |
]. |
1754 |
f := font on:device. |
|
1755 |
w := ((f widthOf:string) * 1.5) rounded. |
|
1756 |
w := w min:(device width // 2). |
|
231 | 1757 |
"/ ^ w @ (f height * 1.5) rounded |
667
d02f6bba8fc5
use fonts maxHeight in prefExtent (A-Umlaut)
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
1758 |
|
d02f6bba8fc5
use fonts maxHeight in prefExtent (A-Umlaut)
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
1759 |
^ w @ (f maxHeight + f descent + (margin * 2)) rounded |
192 | 1760 |
|
1761 |
"Modified: 6.9.1995 / 19:24:06 / claus" |
|
800 | 1762 |
"Modified: 19.7.1996 / 20:43:56 / cg" |
192 | 1763 |
! |
1764 |
||
1765 |
specClass |
|
1766 |
self class == EditField ifTrue:[^ InputFieldSpec]. |
|
1767 |
^ nil |
|
125 | 1768 |
|
192 | 1769 |
"Modified: 5.9.1995 / 17:28:27 / claus" |
325 | 1770 |
! |
1771 |
||
1772 |
tabMeansNextField |
|
1773 |
"return true, if Tab character should shift focus to the next field" |
|
1774 |
||
1775 |
"if I have a completionBlock, I want my Tabs ..." |
|
1776 |
||
1777 |
^ entryCompletionBlock isNil |
|
1778 |
||
1779 |
"Created: 7.2.1996 / 19:16:38 / cg" |
|
192 | 1780 |
! ! |
1781 |
||
1782 |
!EditField methodsFor:'realization'! |
|
1783 |
||
1784 |
realize |
|
1785 |
"scroll back to beginning when realized" |
|
1786 |
leftOffset := 0. |
|
1787 |
super realize |
|
125 | 1788 |
! ! |
192 | 1789 |
|
1790 |
!EditField methodsFor:'scrolling'! |
|
1791 |
||
1792 |
makeColVisible:col inLine:line |
|
1793 |
"dont scroll for the cursor, if its behond the text and a lengthLimit |
|
1794 |
is present." |
|
1795 |
||
1796 |
lengthLimit notNil ifTrue:[ |
|
1797 |
(col == cursorCol and:[col > lengthLimit]) ifTrue:[ |
|
1798 |
^ super makeColVisible:lengthLimit inLine:line |
|
1799 |
] |
|
1800 |
]. |
|
1801 |
^ super makeColVisible:col inLine:line |
|
1802 |
||
1803 |
"Modified: 6.9.1995 / 13:57:53 / claus" |
|
1804 |
! ! |
|
1805 |
||
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1806 |
!EditField methodsFor:'selections'! |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1807 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1808 |
validateNewSelection |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1809 |
"make certain that only one line is ever selected" |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1810 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1811 |
selectionEndLine > 1 ifTrue:[ |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1812 |
selectionEndLine := 2. selectionEndCol := 0 |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1813 |
]. |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1814 |
! ! |
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1815 |
|
892 | 1816 |
!EditField class methodsFor:'documentation'! |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1817 |
|
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1818 |
version |
967 | 1819 |
^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.75 1997-01-22 17:19:05 cg Exp $' |
261
afcea54bd74e
added channel-enable (needs overall cleanup)
Claus Gittinger <cg@exept.de>
parents:
258
diff
changeset
|
1820 |
! ! |