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