EnterFieldGroup.st
author Claus Gittinger <cg@exept.de>
Thu, 25 Apr 1996 18:33:37 +0200
changeset 581 4d48caecf4a0
parent 466 e878bd3b227e
child 589 4644afc9f0ae
permissions -rw-r--r--
documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     1
"
5
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1992 by Claus Gittinger
69
2b72a20e61c2 *** empty log message ***
claus
parents: 59
diff changeset
     3
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     4
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    11
"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    12
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
    13
Object subclass:#EnterFieldGroup
278
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
    14
	instanceVariableNames:'fields currentField leaveAction wrap'
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
    15
	classVariableNames:''
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
    16
	poolDictionaries:''
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
    17
	category:'Interface-Support'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    18
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    19
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    20
!EnterFieldGroup class methodsFor:'documentation'!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    21
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    22
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    23
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    24
 COPYRIGHT (c) 1992 by Claus Gittinger
69
2b72a20e61c2 *** empty log message ***
claus
parents: 59
diff changeset
    25
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    26
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    27
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    28
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    30
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    31
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    32
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    33
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    34
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    35
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    36
documentation
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    37
"
130
claus
parents: 126
diff changeset
    38
    EnterFieldGroup controls the interaction between EnterFields
claus
parents: 126
diff changeset
    39
    enabling the next/prev field when a field is left. 
121
claus
parents: 69
diff changeset
    40
    Instances of this class keep track of which field of the group is the 
claus
parents: 69
diff changeset
    41
    currentField (i.e. the one getting keyboard input) and forwards input
claus
parents: 69
diff changeset
    42
    to the active field (having the inputField delegate its input to me).
claus
parents: 69
diff changeset
    43
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    44
    The block accessable as leaveAction is evaluated when the last
121
claus
parents: 69
diff changeset
    45
    field of the group is left (by cursor-down or cr). 
claus
parents: 69
diff changeset
    46
    Usually this block triggers accept on the fields and/or performs some
claus
parents: 69
diff changeset
    47
    followup processing and closes  the topview (for example: in a dialog).
122
claus
parents: 121
diff changeset
    48
claus
parents: 121
diff changeset
    49
    EnterFieldGroups can be used as a delegate (of the topView) to forward
claus
parents: 121
diff changeset
    50
    input (entered into the topView) to the currently active field.
claus
parents: 121
diff changeset
    51
claus
parents: 121
diff changeset
    52
    Stepping to previous field is via CursorUp/PreviousField,
claus
parents: 121
diff changeset
    53
    to next field via CursorDown/NextField/Tab.
claus
parents: 121
diff changeset
    54
    Notice, that by default, the editField takes the tab-character as
claus
parents: 121
diff changeset
    55
    a normal character. To step using tab, you have to add the Tab key to the
claus
parents: 121
diff changeset
    56
    fields leaveKeys.
claus
parents: 121
diff changeset
    57
581
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    58
    [Instance variables:]
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    59
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    60
        fields          <Collection of EditField>       the fields of the group
122
claus
parents: 121
diff changeset
    61
581
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    62
        currentField    <EditField>                     the active field
122
claus
parents: 121
diff changeset
    63
581
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    64
        leaveAction     <nil|Block>                     action to perform, when the
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    65
                                                        last field is left by a non-wrap
122
claus
parents: 121
diff changeset
    66
581
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    67
        wrap            <Boolean>                       if true, non-return next-keys wrap
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    68
                                                        back to the first field.
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    69
                                                        If false (the default), next in
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    70
                                                        the last field is taken as return.
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    71
                                                        This is ignored, if no leaveAction was 
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    72
                                                        defined.
122
claus
parents: 121
diff changeset
    73
581
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    74
    [author:]
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    75
        Claus Gittinger
121
claus
parents: 69
diff changeset
    76
"
claus
parents: 69
diff changeset
    77
!
claus
parents: 69
diff changeset
    78
claus
parents: 69
diff changeset
    79
examples 
claus
parents: 69
diff changeset
    80
"
122
claus
parents: 121
diff changeset
    81
    without a group - user has to enter mouse into the next field to activate it;
claus
parents: 121
diff changeset
    82
    Cursor-keys dont work:
121
claus
parents: 69
diff changeset
    83
claus
parents: 69
diff changeset
    84
	|top panel field1 field2 field3|
claus
parents: 69
diff changeset
    85
claus
parents: 69
diff changeset
    86
	top := StandardSystemView new.
claus
parents: 69
diff changeset
    87
	top extent:200@200.
claus
parents: 69
diff changeset
    88
claus
parents: 69
diff changeset
    89
	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
claus
parents: 69
diff changeset
    90
claus
parents: 69
diff changeset
    91
	panel add:(field1 := EditField extent:(1.0 @ nil)).
claus
parents: 69
diff changeset
    92
	panel add:(field2 := EditField extent:(1.0 @ nil)).
claus
parents: 69
diff changeset
    93
	panel add:(field3 := EditField extent:(1.0 @ nil)).
claus
parents: 69
diff changeset
    94
claus
parents: 69
diff changeset
    95
	top open
claus
parents: 69
diff changeset
    96
claus
parents: 69
diff changeset
    97
claus
parents: 69
diff changeset
    98
    with a group - Return-key or CursorKey enables next field:
122
claus
parents: 121
diff changeset
    99
    (but still, mouse pointer has to be moved into any of the fields,
claus
parents: 121
diff changeset
   100
     because the topView does not forward its input into the fields)
121
claus
parents: 69
diff changeset
   101
claus
parents: 69
diff changeset
   102
	|top panel group field1 field2 field3|
claus
parents: 69
diff changeset
   103
claus
parents: 69
diff changeset
   104
	top := StandardSystemView new.
claus
parents: 69
diff changeset
   105
	top extent:200@200.
claus
parents: 69
diff changeset
   106
claus
parents: 69
diff changeset
   107
	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
claus
parents: 69
diff changeset
   108
claus
parents: 69
diff changeset
   109
	panel add:(field1 := EditField extent:(1.0 @ nil)).
claus
parents: 69
diff changeset
   110
	panel add:(field2 := EditField extent:(1.0 @ nil)).
claus
parents: 69
diff changeset
   111
	panel add:(field3 := EditField extent:(1.0 @ nil)).
claus
parents: 69
diff changeset
   112
claus
parents: 69
diff changeset
   113
	group := EnterFieldGroup new.
claus
parents: 69
diff changeset
   114
	group add:field1; add:field2; add:field3.
claus
parents: 69
diff changeset
   115
claus
parents: 69
diff changeset
   116
	top open
claus
parents: 69
diff changeset
   117
claus
parents: 69
diff changeset
   118
claus
parents: 69
diff changeset
   119
122
claus
parents: 121
diff changeset
   120
    same, enables tabbing via the Tab key:
claus
parents: 121
diff changeset
   121
claus
parents: 121
diff changeset
   122
	|top panel group field1 field2 field3|
claus
parents: 121
diff changeset
   123
claus
parents: 121
diff changeset
   124
	top := StandardSystemView new.
claus
parents: 121
diff changeset
   125
	top extent:200@200.
claus
parents: 121
diff changeset
   126
claus
parents: 121
diff changeset
   127
	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
claus
parents: 121
diff changeset
   128
claus
parents: 121
diff changeset
   129
	panel add:(field1 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   130
	panel add:(field2 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   131
	panel add:(field3 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   132
claus
parents: 121
diff changeset
   133
	group := EnterFieldGroup new.
claus
parents: 121
diff changeset
   134
	group add:field1; add:field2; add:field3.
claus
parents: 121
diff changeset
   135
claus
parents: 121
diff changeset
   136
	field1 leaveKeys:(EditField defaultLeaveKeys copyWith:#Tab).
claus
parents: 121
diff changeset
   137
	field2 leaveKeys:(EditField defaultLeaveKeys copyWith:#Tab).
claus
parents: 121
diff changeset
   138
	field3 leaveKeys:(EditField defaultLeaveKeys copyWith:#Tab).
claus
parents: 121
diff changeset
   139
	top open
claus
parents: 121
diff changeset
   140
claus
parents: 121
diff changeset
   141
claus
parents: 121
diff changeset
   142
claus
parents: 121
diff changeset
   143
    with a group - Return-key or CursorKey enables next field:
claus
parents: 121
diff changeset
   144
    input into topView is forwarded to the group:
claus
parents: 121
diff changeset
   145
claus
parents: 121
diff changeset
   146
	|top panel group field1 field2 field3|
claus
parents: 121
diff changeset
   147
claus
parents: 121
diff changeset
   148
	top := StandardSystemView new.
claus
parents: 121
diff changeset
   149
	top extent:200@200.
claus
parents: 121
diff changeset
   150
claus
parents: 121
diff changeset
   151
	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
claus
parents: 121
diff changeset
   152
claus
parents: 121
diff changeset
   153
	panel add:(field1 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   154
	panel add:(field2 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   155
	panel add:(field3 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   156
claus
parents: 121
diff changeset
   157
	group := EnterFieldGroup new.
claus
parents: 121
diff changeset
   158
	group add:field1; add:field2; add:field3.
claus
parents: 121
diff changeset
   159
claus
parents: 121
diff changeset
   160
	top delegate:group.
claus
parents: 121
diff changeset
   161
	top open
claus
parents: 121
diff changeset
   162
claus
parents: 121
diff changeset
   163
claus
parents: 121
diff changeset
   164
claus
parents: 121
diff changeset
   165
    as above, but close the box when the last field is left:
claus
parents: 121
diff changeset
   166
claus
parents: 121
diff changeset
   167
	|top panel group field1 field2 field3|
claus
parents: 121
diff changeset
   168
claus
parents: 121
diff changeset
   169
	top := StandardSystemView new.
claus
parents: 121
diff changeset
   170
	top extent:200@200.
claus
parents: 121
diff changeset
   171
claus
parents: 121
diff changeset
   172
	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
claus
parents: 121
diff changeset
   173
claus
parents: 121
diff changeset
   174
	panel add:(field1 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   175
	panel add:(field2 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   176
	panel add:(field3 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   177
claus
parents: 121
diff changeset
   178
	group := EnterFieldGroup new.
claus
parents: 121
diff changeset
   179
	group add:field1; add:field2; add:field3.
claus
parents: 121
diff changeset
   180
	group leaveAction:[top destroy].
claus
parents: 121
diff changeset
   181
claus
parents: 121
diff changeset
   182
	top delegate:group.
claus
parents: 121
diff changeset
   183
	top open
claus
parents: 121
diff changeset
   184
claus
parents: 121
diff changeset
   185
claus
parents: 121
diff changeset
   186
claus
parents: 121
diff changeset
   187
    same as above, with Tab-key stepping:
121
claus
parents: 69
diff changeset
   188
claus
parents: 69
diff changeset
   189
	|top panel group field1 field2 field3|
claus
parents: 69
diff changeset
   190
claus
parents: 69
diff changeset
   191
	top := StandardSystemView new.
claus
parents: 69
diff changeset
   192
	top extent:200@200.
claus
parents: 69
diff changeset
   193
claus
parents: 69
diff changeset
   194
	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
claus
parents: 69
diff changeset
   195
claus
parents: 69
diff changeset
   196
	panel add:(field1 := EditField extent:(1.0 @ nil)).
claus
parents: 69
diff changeset
   197
	panel add:(field2 := EditField extent:(1.0 @ nil)).
claus
parents: 69
diff changeset
   198
	panel add:(field3 := EditField extent:(1.0 @ nil)).
claus
parents: 69
diff changeset
   199
claus
parents: 69
diff changeset
   200
	group := EnterFieldGroup new.
claus
parents: 69
diff changeset
   201
	group add:field1; add:field2; add:field3.
claus
parents: 69
diff changeset
   202
	group leaveAction:[top destroy].
claus
parents: 69
diff changeset
   203
122
claus
parents: 121
diff changeset
   204
	field1 leaveKeys:(EditField defaultLeaveKeys copyWith:#Tab).
claus
parents: 121
diff changeset
   205
	field2 leaveKeys:(EditField defaultLeaveKeys copyWith:#Tab).
claus
parents: 121
diff changeset
   206
	field3 leaveKeys:(EditField defaultLeaveKeys copyWith:#Tab).
claus
parents: 121
diff changeset
   207
claus
parents: 121
diff changeset
   208
	top delegate:group.
121
claus
parents: 69
diff changeset
   209
	top open
122
claus
parents: 121
diff changeset
   210
claus
parents: 121
diff changeset
   211
claus
parents: 121
diff changeset
   212
claus
parents: 121
diff changeset
   213
    the next example shows that the input order is defined by the
claus
parents: 121
diff changeset
   214
    order in the group; NOT by the physical layout of the fields in the superview:
130
claus
parents: 126
diff changeset
   215
    (i.e. you can arrange your fields in multiple framedBoxes, panels or
claus
parents: 126
diff changeset
   216
     subviews - independent of the tab-stepping order)
122
claus
parents: 121
diff changeset
   217
claus
parents: 121
diff changeset
   218
	|top panel group field1 field2 field3|
claus
parents: 121
diff changeset
   219
claus
parents: 121
diff changeset
   220
	top := StandardSystemView new.
claus
parents: 121
diff changeset
   221
	top extent:200@200.
claus
parents: 121
diff changeset
   222
claus
parents: 121
diff changeset
   223
	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
claus
parents: 121
diff changeset
   224
claus
parents: 121
diff changeset
   225
	panel add:(field1 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   226
	panel add:(field2 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   227
	panel add:(field3 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   228
claus
parents: 121
diff changeset
   229
	group := EnterFieldGroup new.
claus
parents: 121
diff changeset
   230
	group add:field3; add:field2; add:field1.
claus
parents: 121
diff changeset
   231
	group leaveAction:[top destroy].
claus
parents: 121
diff changeset
   232
claus
parents: 121
diff changeset
   233
	top delegate:group.
claus
parents: 121
diff changeset
   234
	top open
claus
parents: 121
diff changeset
   235
claus
parents: 121
diff changeset
   236
claus
parents: 121
diff changeset
   237
claus
parents: 121
diff changeset
   238
    using a single model for all fields:
claus
parents: 121
diff changeset
   239
    (here, we use a Plug to simulate a more complex model):
claus
parents: 121
diff changeset
   240
claus
parents: 121
diff changeset
   241
	|top panel group field1 field2 field3 model
claus
parents: 121
diff changeset
   242
	 value1 value2 value3|
claus
parents: 121
diff changeset
   243
claus
parents: 121
diff changeset
   244
	top := StandardSystemView new.
claus
parents: 121
diff changeset
   245
	top extent:200@200.
claus
parents: 121
diff changeset
   246
claus
parents: 121
diff changeset
   247
	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
claus
parents: 121
diff changeset
   248
claus
parents: 121
diff changeset
   249
	panel add:(field1 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   250
	panel add:(field2 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   251
	panel add:(field3 := EditField extent:(1.0 @ nil)).
claus
parents: 121
diff changeset
   252
claus
parents: 121
diff changeset
   253
	group := EnterFieldGroup new.
claus
parents: 121
diff changeset
   254
	group add:field1; add:field2; add:field3.
claus
parents: 121
diff changeset
   255
	group leaveAction:[top destroy].
claus
parents: 121
diff changeset
   256
claus
parents: 121
diff changeset
   257
	value1 := 'one'. value2 := 'two'. value3 := 'three'.
claus
parents: 121
diff changeset
   258
claus
parents: 121
diff changeset
   259
	model := Plug new.
claus
parents: 121
diff changeset
   260
	model respondTo:#value1 with:[value1].
claus
parents: 121
diff changeset
   261
	model respondTo:#value1: with:[:arg | value1 := arg].
claus
parents: 121
diff changeset
   262
	model respondTo:#value2 with:[value2].
claus
parents: 121
diff changeset
   263
	model respondTo:#value2: with:[:arg | value2 := arg].
claus
parents: 121
diff changeset
   264
	model respondTo:#value3 with:[value3].
claus
parents: 121
diff changeset
   265
	model respondTo:#value3: with:[:arg | value3 := arg].
claus
parents: 121
diff changeset
   266
claus
parents: 121
diff changeset
   267
	field1 model:model; aspect:#value1; change:#value1:.
claus
parents: 121
diff changeset
   268
	field2 model:model; aspect:#value2; change:#value2:.
claus
parents: 121
diff changeset
   269
	field3 model:model; aspect:#value3; change:#value3:.
claus
parents: 121
diff changeset
   270
claus
parents: 121
diff changeset
   271
	top delegate:group.
claus
parents: 121
diff changeset
   272
	top openModal.
claus
parents: 121
diff changeset
   273
claus
parents: 121
diff changeset
   274
	Transcript showCr:'value1: ' , value1.
claus
parents: 121
diff changeset
   275
	Transcript showCr:'value2: ' , value2.
claus
parents: 121
diff changeset
   276
	Transcript showCr:'value3: ' , value3.
claus
parents: 121
diff changeset
   277
claus
parents: 121
diff changeset
   278
claus
parents: 121
diff changeset
   279
    the above is done automatically for you, if you add inputFields
claus
parents: 121
diff changeset
   280
    to a dialogBox:
claus
parents: 121
diff changeset
   281
claus
parents: 121
diff changeset
   282
	|box model
claus
parents: 121
diff changeset
   283
	 value1 value2 value3|
claus
parents: 121
diff changeset
   284
claus
parents: 121
diff changeset
   285
	box := DialogBox new.
claus
parents: 121
diff changeset
   286
	box extent:200@200.
claus
parents: 121
diff changeset
   287
claus
parents: 121
diff changeset
   288
	value1 := 'one'. value2 := 'two'. value3 := 'three'.
claus
parents: 121
diff changeset
   289
claus
parents: 121
diff changeset
   290
	model := Plug new.
claus
parents: 121
diff changeset
   291
	model respondTo:#value1 with:[value1].
claus
parents: 121
diff changeset
   292
	model respondTo:#value1: with:[:arg | value1 := arg].
claus
parents: 121
diff changeset
   293
	model respondTo:#value2 with:[value2].
claus
parents: 121
diff changeset
   294
	model respondTo:#value2: with:[:arg | value2 := arg].
claus
parents: 121
diff changeset
   295
	model respondTo:#value3 with:[value3].
claus
parents: 121
diff changeset
   296
	model respondTo:#value3: with:[:arg | value3 := arg].
claus
parents: 121
diff changeset
   297
claus
parents: 121
diff changeset
   298
	(box addInputFieldOn:model) aspect:#value1; change:#value1:.
claus
parents: 121
diff changeset
   299
	box addVerticalSpace.
claus
parents: 121
diff changeset
   300
	(box addInputFieldOn:model) aspect:#value2; change:#value2:.
claus
parents: 121
diff changeset
   301
	box addVerticalSpace.
claus
parents: 121
diff changeset
   302
	(box addInputFieldOn:model) aspect:#value3; change:#value3:.
claus
parents: 121
diff changeset
   303
claus
parents: 121
diff changeset
   304
	box open.
claus
parents: 121
diff changeset
   305
claus
parents: 121
diff changeset
   306
	Transcript showCr:'value1: ' , value1.
claus
parents: 121
diff changeset
   307
	Transcript showCr:'value2: ' , value2.
claus
parents: 121
diff changeset
   308
	Transcript showCr:'value3: ' , value3.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   309
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   310
! !
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   311
278
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   312
!EnterFieldGroup methodsFor:'accessing'!
122
claus
parents: 121
diff changeset
   313
278
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   314
fields
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   315
    "return a collection of the inputFields contained in the group."
122
claus
parents: 121
diff changeset
   316
278
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   317
     ^ fields
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   318
!
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   319
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   320
leaveAction:aBlock
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   321
    "set the action to perform when the last field is left.
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   322
     Usually, this is to accept the values of all fields and perform
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   323
     some additional processing (such as closing a dialog)."
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   324
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   325
    leaveAction := aBlock
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   326
!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   327
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   328
wrap:aBoolean
278
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   329
    "specifies if leaving the last field via non-Return
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   330
     should wrap back to the first, or leave the group.
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   331
     The default is to stay in the input sequence and wrap back to 
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   332
     the first field."
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   333
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   334
    wrap := aBoolean
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   335
! !
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   336
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   337
!EnterFieldGroup methodsFor:'adding / removing'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   338
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   339
add:aField
316
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   340
    |thisIndex action|
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   341
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   342
    fields isNil ifTrue:[
316
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   343
	fields := OrderedCollection new
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   344
    ].
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   345
    fields add:aField.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   346
    thisIndex := fields size.
121
claus
parents: 69
diff changeset
   347
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   348
    aField delegate:self.
121
claus
parents: 69
diff changeset
   349
    aField hideCursor.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   350
    aField disable.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   351
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   352
    "set the fields enableAction to disable active field"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   353
316
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   354
    aField clickAction:[:field |
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   355
	self makeActive:field
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   356
    ].
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   357
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   358
    "set the fields leaveAction to enable next field"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   359
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   360
    aField leaveAction:[:key |
316
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   361
	|next wg explicit nFields nextField|
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   362
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   363
"/        currentField notNil ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   364
"/            currentField disable.
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   365
"/            currentField hideCursor.
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   366
"/        ].
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   367
"/
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   368
	action := key.
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   369
	nFields := fields size.
122
claus
parents: 121
diff changeset
   370
316
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   371
	((key == #CursorUp) or:[key == #PreviousField]) ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   372
	    (thisIndex == 1) ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   373
		next := nFields
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   374
	    ] ifFalse:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   375
		next := thisIndex - 1
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   376
	    ]
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   377
	].
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   378
	((key == #CursorDown) 
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   379
	or:[key == #NextField
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   380
	or:[key == #Tab]]) ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   381
	    (thisIndex == nFields) ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   382
		next := 1.
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   383
		wrap == false ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   384
		    action := #Return.
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   385
		].
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   386
	    ] ifFalse:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   387
		next := thisIndex + 1
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   388
	    ]
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   389
	].
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   390
	(action == #Return) ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   391
	    (thisIndex == nFields) ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   392
		leaveAction notNil ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   393
		    currentField := nil.
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   394
		    leaveAction value.
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   395
		    next := nil
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   396
		] ifFalse:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   397
		    next := 1
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   398
		]
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   399
	    ] ifFalse:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   400
		next := thisIndex + 1
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   401
	    ]
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   402
	].
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   403
	next notNil ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   404
	    nextField := fields at:next.
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   405
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   406
	    explicit := false.
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   407
	    (wg := currentField windowGroup) notNil ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   408
		wg focusView == currentField ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   409
		    explicit := true.
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   410
		]
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   411
	    ].
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   412
	    explicit ifTrue:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   413
		wg focusView:nextField.
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   414
	    ] ifFalse:[
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   415
		self makeActive:nextField 
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   416
	    ]
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   417
	]
121
claus
parents: 69
diff changeset
   418
    ].
claus
parents: 69
diff changeset
   419
claus
parents: 69
diff changeset
   420
    fields size == 1 ifTrue:[
316
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   421
	"the first one"
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   422
	self makeActive:aField
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   423
    ]
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   424
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   425
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   426
!EnterFieldGroup methodsFor:'event forwarding'!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   427
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   428
buttonPress:button x:x y:y view:aView
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   429
    "clicking on a field activates it and forwards the click to it"
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   430
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   431
    self makeActive:aView.
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   432
    aView buttonPress:button x:x y:y
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   433
!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   434
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   435
buttonShiftPress:button x:x y:y view:aView
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   436
    "clicking on a field activates it and forwards the click to it"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   437
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   438
    self makeActive:aView.
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   439
    aView buttonShiftPress:button x:x y:y
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   440
!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   441
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   442
handlesButtonPress:button inView:aView
258
ae4b8f1a6738 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   443
    "query from event processor: am I interested in button-events ?
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   444
     yes I am (to activate the clicked-on field)."
122
claus
parents: 121
diff changeset
   445
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   446
   ^ true
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   447
!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   448
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   449
handlesButtonShiftPress:button inView:aView
258
ae4b8f1a6738 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   450
    "query from event processor: am I interested in button-events ?
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   451
     yes I am (to activate the clicked-on field)."
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   452
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   453
    ^ true
122
claus
parents: 121
diff changeset
   454
!
claus
parents: 121
diff changeset
   455
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   456
handlesKeyPress:key inView:aView
258
ae4b8f1a6738 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   457
    "query from event processor: am I interested in key-events ?
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   458
     yes I am (to forward it to the active field)."
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   459
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   460
    ^ true
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   461
!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   462
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   463
handlesKeyRelease:key inView:aView
258
ae4b8f1a6738 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   464
    "query from event processor: am I interested in key-events ?
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   465
     yes I am (to forward it to the active field)."
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   466
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   467
    ^ true
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   468
!
121
claus
parents: 69
diff changeset
   469
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   470
keyPress:key x:x y:y view:aView
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   471
    "key-press in any field - forward the key to the active field
466
e878bd3b227e delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   472
     (with nil coordinates to indicate that the key was pressed
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   473
      outside. However, this info is not used by any view currently)"
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   474
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   475
    currentField notNil ifTrue:[
466
e878bd3b227e delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   476
        currentField keyPress:key x:nil y:nil
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   477
    ]
466
e878bd3b227e delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   478
e878bd3b227e delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   479
    "Modified: 4.3.1996 / 22:18:22 / cg"
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   480
!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   481
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   482
keyRelease:key x:x y:y view:aView
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   483
    "key-release in any field - forward the key to the active field.
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   484
     (with -1/-1 as coordinate to indicate that the key was pressed
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   485
      outside. However, this info is not used by any view currently)"
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   486
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   487
    currentField notNil ifTrue:[
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   488
	currentField keyRelease:key x:-1 y:-1
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   489
    ]
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   490
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   491
121
claus
parents: 69
diff changeset
   492
!EnterFieldGroup methodsFor:'misc'!
claus
parents: 69
diff changeset
   493
claus
parents: 69
diff changeset
   494
activateFirst
claus
parents: 69
diff changeset
   495
    "pass controll to my first field"
claus
parents: 69
diff changeset
   496
claus
parents: 69
diff changeset
   497
    fields notNil ifTrue:[
322
3a25112b58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
   498
        self makeActive:fields first
121
claus
parents: 69
diff changeset
   499
    ]
322
3a25112b58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
   500
3a25112b58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
   501
    "Modified: 7.2.1996 / 15:23:09 / cg"
121
claus
parents: 69
diff changeset
   502
! !
claus
parents: 69
diff changeset
   503
claus
parents: 69
diff changeset
   504
!EnterFieldGroup methodsFor:'private'!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   505
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   506
makeActive:aField
121
claus
parents: 69
diff changeset
   507
    "make a specific field the active one"
claus
parents: 69
diff changeset
   508
316
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   509
    currentField == aField ifTrue:[^ self].
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   510
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   511
    currentField notNil ifTrue:[
121
claus
parents: 69
diff changeset
   512
	currentField disable.
claus
parents: 69
diff changeset
   513
	currentField hideCursor.
claus
parents: 69
diff changeset
   514
	currentField hasKeyboardFocus:false.
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   515
    ].
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   516
    currentField := aField.
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   517
    currentField enable.
121
claus
parents: 69
diff changeset
   518
    currentField showCursor.
claus
parents: 69
diff changeset
   519
    currentField hasKeyboardFocus:true.
claus
parents: 69
diff changeset
   520
! !
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   521
203
8a38b0b03233 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   522
!EnterFieldGroup class methodsFor:'documentation'!
8a38b0b03233 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   523
8a38b0b03233 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   524
version
581
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
   525
    ^ '$Header: /cvs/stx/stx/libwidg/EnterFieldGroup.st,v 1.21 1996-04-25 16:33:37 cg Exp $'
203
8a38b0b03233 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   526
! !