EnterFieldGroup.st
author Claus Gittinger <cg@exept.de>
Thu, 09 Nov 2017 20:09:30 +0100
changeset 6225 0122e4e6c587
parent 5959 b27a22e16282
permissions -rw-r--r--
#FEATURE by cg class: GenericToolbarIconLibrary class added: #hideFilter16x16Icon
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
"
3457
2684f36d5021 focus handling: focusSequence removed
ca
parents: 2144
diff changeset
    12
"{ Package: 'stx:libwidg' }"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    13
5574
mawalch
parents: 5062
diff changeset
    14
"{ NameSpace: Smalltalk }"
mawalch
parents: 5062
diff changeset
    15
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
    16
Object subclass:#EnterFieldGroup
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    17
	instanceVariableNames:'fields currentField leaveAction wrap leaveOnTabLast'
278
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
    18
	classVariableNames:''
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
    19
	poolDictionaries:''
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
    20
	category:'Interface-Support'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    21
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    22
1355
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
    23
!EnterFieldGroup class methodsFor:'documentation'!
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    24
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    25
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    26
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    27
 COPYRIGHT (c) 1992 by Claus Gittinger
69
2b72a20e61c2 *** empty log message ***
claus
parents: 59
diff changeset
    28
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    29
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    30
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    31
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    33
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    34
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    35
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    36
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    37
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    39
documentation
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
    40
"
130
claus
parents: 126
diff changeset
    41
    EnterFieldGroup controls the interaction between EnterFields
claus
parents: 126
diff changeset
    42
    enabling the next/prev field when a field is left. 
121
claus
parents: 69
diff changeset
    43
    Instances of this class keep track of which field of the group is the 
claus
parents: 69
diff changeset
    44
    currentField (i.e. the one getting keyboard input) and forwards input
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    45
    to that one.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    46
    This is done by arranging for all of my fields to delegate their
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    47
    input to me, which is then forwarded to the active field).
121
claus
parents: 69
diff changeset
    48
5574
mawalch
parents: 5062
diff changeset
    49
    The block accessible as leaveAction is evaluated when the last
121
claus
parents: 69
diff changeset
    50
    field of the group is left (by cursor-down or cr). 
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    51
    Usually this block triggers accept on the fields (if they did not already)
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    52
    and/or performs some followup processing and possibly closes the topview 
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    53
    (for example: in a dialog).
122
claus
parents: 121
diff changeset
    54
claus
parents: 121
diff changeset
    55
    EnterFieldGroups can be used as a delegate (of the topView) to forward
claus
parents: 121
diff changeset
    56
    input (entered into the topView) to the currently active field.
claus
parents: 121
diff changeset
    57
claus
parents: 121
diff changeset
    58
    Stepping to previous field is via CursorUp/PreviousField,
claus
parents: 121
diff changeset
    59
    to next field via CursorDown/NextField/Tab.
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    60
    By default, tabbing via #Tab is disabled - to enable it, send the field
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    61
    a #makeTabable or #makeAllTabable to the group.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    62
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    63
    All of this here is low level stuff, providing a lot of freedom in
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    64
    which keys are handled and how they perform.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    65
    Normally, these are not required for most users - the DialogBox sets up
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    66
    things correctly for most cases.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    67
122
claus
parents: 121
diff changeset
    68
581
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    69
    [Instance variables:]
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    70
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    71
        fields          <Collection of EditField>       the fields of the group
122
claus
parents: 121
diff changeset
    72
581
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    73
        currentField    <EditField>                     the active field
122
claus
parents: 121
diff changeset
    74
581
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    75
        leaveAction     <nil|Block>                     action to perform, when the
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    76
                                                        last field is left by a non-wrap
122
claus
parents: 121
diff changeset
    77
581
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    78
        wrap            <Boolean>                       if true, non-return next-keys wrap
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    79
                                                        back to the first field.
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    80
                                                        If false (the default), next in
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    81
                                                        the last field is taken as return.
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    82
                                                        This is ignored, if no leaveAction was 
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    83
                                                        defined.
122
claus
parents: 121
diff changeset
    84
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    85
        leaveOnTabLast  <Boolean>                       if true, tabbing out of the last
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    86
                                                        field leaves the group.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    87
                                                        The default is false.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    88
581
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    89
    [author:]
4d48caecf4a0 documentation
Claus Gittinger <cg@exept.de>
parents: 466
diff changeset
    90
        Claus Gittinger
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    91
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    92
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    93
    [see also:]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    94
        DialogBox
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
    95
        EditField
121
claus
parents: 69
diff changeset
    96
"
claus
parents: 69
diff changeset
    97
!
claus
parents: 69
diff changeset
    98
claus
parents: 69
diff changeset
    99
examples 
claus
parents: 69
diff changeset
   100
"
122
claus
parents: 121
diff changeset
   101
    without a group - user has to enter mouse into the next field to activate it;
5592
f43ace1a694a #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
   102
    Cursor-keys don't work:
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   103
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   104
        |top panel field1 field2 field3|
121
claus
parents: 69
diff changeset
   105
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   106
        top := StandardSystemView new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   107
        top extent:200@200.
121
claus
parents: 69
diff changeset
   108
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   109
        panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
121
claus
parents: 69
diff changeset
   110
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   111
        panel add:(field1 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   112
        panel add:(field2 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   113
        panel add:(field3 := EditField extent:(1.0 @ nil)).
121
claus
parents: 69
diff changeset
   114
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   115
        top open
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   116
                                                                        [exEnd]
121
claus
parents: 69
diff changeset
   117
claus
parents: 69
diff changeset
   118
claus
parents: 69
diff changeset
   119
    with a group - Return-key or CursorKey enables next field:
122
claus
parents: 121
diff changeset
   120
    (but still, mouse pointer has to be moved into any of the fields,
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   121
     because the topView does not forward its input into the fields.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   122
     Also, tabbing is not possible here)
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   123
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   124
        |top panel group field1 field2 field3|
121
claus
parents: 69
diff changeset
   125
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   126
        top := StandardSystemView new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   127
        top extent:200@200.
121
claus
parents: 69
diff changeset
   128
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   129
        panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
121
claus
parents: 69
diff changeset
   130
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   131
        panel add:(field1 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   132
        panel add:(field2 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   133
        panel add:(field3 := EditField extent:(1.0 @ nil)).
121
claus
parents: 69
diff changeset
   134
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   135
        group := EnterFieldGroup new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   136
        group add:field1; add:field2; add:field3.
121
claus
parents: 69
diff changeset
   137
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   138
        top open
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   139
                                                                        [exEnd]
121
claus
parents: 69
diff changeset
   140
claus
parents: 69
diff changeset
   141
claus
parents: 69
diff changeset
   142
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   143
    same, enables tabbing within the group via the Tab key
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   144
    (but still, the mouse pointer must be in one of the fields):
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   145
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   146
        |top panel group field1 field2 field3|
122
claus
parents: 121
diff changeset
   147
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   148
        top := StandardSystemView new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   149
        top extent:200@200.
122
claus
parents: 121
diff changeset
   150
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   151
        panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
122
claus
parents: 121
diff changeset
   152
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   153
        panel add:(field1 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   154
        panel add:(field2 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   155
        panel add:(field3 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   156
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   157
        group := EnterFieldGroup new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   158
        group add:field1; add:field2; add:field3.
122
claus
parents: 121
diff changeset
   159
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   160
        field1 makeTabable.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   161
        field2 makeTabable.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   162
        field3 makeTabable.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   163
        top open
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   164
                                                                        [exEnd]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   165
    individual makeTabable messages to the fields allows single
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   166
    fields to be sticky (i.e. explicit click is needed to get out
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   167
    of it) - this is very seldom required.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   168
    To make all fields tabable (the usual case), there is a shortCut:
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   169
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   170
        |top panel group field1 field2 field3|
122
claus
parents: 121
diff changeset
   171
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   172
        top := StandardSystemView new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   173
        top extent:200@200.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   174
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   175
        panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
122
claus
parents: 121
diff changeset
   176
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   177
        panel add:(field1 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   178
        panel add:(field2 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   179
        panel add:(field3 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   180
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   181
        group := EnterFieldGroup new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   182
        group add:field1; add:field2; add:field3.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   183
        group makeAllTabable.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   184
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   185
        top open
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   186
                                                                        [exEnd]
122
claus
parents: 121
diff changeset
   187
claus
parents: 121
diff changeset
   188
claus
parents: 121
diff changeset
   189
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   190
    use a delagation from the outerView to the group - 
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   191
    Return-key or CursorKey enables next field:
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   192
    input for topView is delegated to the group, which also behaves
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   193
    as a unit w.r.t. keyboard focus (move pointer in and out).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   194
    Again, without tabbing:
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   195
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   196
        |top panel group field1 field2 field3|
122
claus
parents: 121
diff changeset
   197
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   198
        top := StandardSystemView new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   199
        top extent:200@200.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   200
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   201
        panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
122
claus
parents: 121
diff changeset
   202
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   203
        panel add:(field1 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   204
        panel add:(field2 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   205
        panel add:(field3 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   206
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   207
        group := EnterFieldGroup new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   208
        group add:field1; add:field2; add:field3.
122
claus
parents: 121
diff changeset
   209
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   210
        top delegate:group.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   211
        top open
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   212
                                                                        [exEnd]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   213
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   214
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   215
    and, with tabbing:
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   216
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   217
        |top panel group field1 field2 field3|
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   218
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   219
        top := StandardSystemView new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   220
        top extent:200@200.
122
claus
parents: 121
diff changeset
   221
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   222
        panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   223
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   224
        panel add:(field1 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   225
        panel add:(field2 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   226
        panel add:(field3 := EditField extent:(1.0 @ nil)).
122
claus
parents: 121
diff changeset
   227
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   228
        group := EnterFieldGroup new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   229
        group add:field1; add:field2; add:field3.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   230
        group makeAllTabable.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   231
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   232
        top delegate:group.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   233
        top open
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   234
                                                                        [exEnd]
122
claus
parents: 121
diff changeset
   235
claus
parents: 121
diff changeset
   236
claus
parents: 121
diff changeset
   237
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   238
    as above, but close the box when the last field is left
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   239
    via return - notice, that tabbing still wraps around:
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   240
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   241
        |top panel group field1 field2 field3|
122
claus
parents: 121
diff changeset
   242
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   243
        top := StandardSystemView new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   244
        top extent:200@200.
122
claus
parents: 121
diff changeset
   245
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   246
        panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
122
claus
parents: 121
diff changeset
   247
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   248
        panel add:(field1 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   249
        panel add:(field2 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   250
        panel add:(field3 := EditField extent:(1.0 @ nil)).
122
claus
parents: 121
diff changeset
   251
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   252
        group := EnterFieldGroup new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   253
        group add:field1; add:field2; add:field3.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   254
        group leaveAction:[top destroy].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   255
        group makeAllTabable.
122
claus
parents: 121
diff changeset
   256
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   257
        top delegate:group.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   258
        top open
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   259
                                                                        [exEnd]
122
claus
parents: 121
diff changeset
   260
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   261
    in the next example, tabbing out of the last field
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   262
    closes the box as well:
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   263
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   264
        |top panel group field1 field2 field3|
121
claus
parents: 69
diff changeset
   265
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   266
        top := StandardSystemView new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   267
        top extent:200@200.
121
claus
parents: 69
diff changeset
   268
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   269
        panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
121
claus
parents: 69
diff changeset
   270
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   271
        panel add:(field1 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   272
        panel add:(field2 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   273
        panel add:(field3 := EditField extent:(1.0 @ nil)).
121
claus
parents: 69
diff changeset
   274
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   275
        group := EnterFieldGroup new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   276
        group add:field1; add:field2; add:field3.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   277
        group leaveAction:[top destroy].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   278
        group makeAllTabable.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   279
        group leaveOnTabLast:true.
122
claus
parents: 121
diff changeset
   280
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   281
        top delegate:group.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   282
        top open
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   283
                                                                        [exEnd]
122
claus
parents: 121
diff changeset
   284
claus
parents: 121
diff changeset
   285
claus
parents: 121
diff changeset
   286
    the next example shows that the input order is defined by the
claus
parents: 121
diff changeset
   287
    order in the group; NOT by the physical layout of the fields in the superview:
130
claus
parents: 126
diff changeset
   288
    (i.e. you can arrange your fields in multiple framedBoxes, panels or
claus
parents: 126
diff changeset
   289
     subviews - independent of the tab-stepping order)
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   290
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   291
        |top panel group field1 field2 field3|
122
claus
parents: 121
diff changeset
   292
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   293
        top := StandardSystemView label:'reverse'.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   294
        top extent:200@200.
122
claus
parents: 121
diff changeset
   295
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   296
        panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
122
claus
parents: 121
diff changeset
   297
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   298
        panel add:(field1 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   299
        panel add:(field2 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   300
        panel add:(field3 := EditField extent:(1.0 @ nil)).
122
claus
parents: 121
diff changeset
   301
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   302
        group := EnterFieldGroup new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   303
        group add:field3; add:field2; add:field1.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   304
        group leaveAction:[top destroy].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   305
        group makeAllTabable.
122
claus
parents: 121
diff changeset
   306
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   307
        top delegate:group.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   308
        top open
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   309
                                                                        [exEnd]
122
claus
parents: 121
diff changeset
   310
claus
parents: 121
diff changeset
   311
claus
parents: 121
diff changeset
   312
claus
parents: 121
diff changeset
   313
    using a single model for all fields:
claus
parents: 121
diff changeset
   314
    (here, we use a Plug to simulate a more complex model):
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   315
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   316
        |top panel group field1 field2 field3 model
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   317
         value1 value2 value3|
122
claus
parents: 121
diff changeset
   318
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   319
        top := StandardSystemView new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   320
        top extent:200@200.
122
claus
parents: 121
diff changeset
   321
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   322
        panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
122
claus
parents: 121
diff changeset
   323
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   324
        panel add:(field1 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   325
        panel add:(field2 := EditField extent:(1.0 @ nil)).
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   326
        panel add:(field3 := EditField extent:(1.0 @ nil)).
122
claus
parents: 121
diff changeset
   327
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   328
        group := EnterFieldGroup new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   329
        group add:field1; add:field2; add:field3.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   330
        group leaveAction:[top destroy].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   331
        group makeAllTabable.
122
claus
parents: 121
diff changeset
   332
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   333
        value1 := 'one'. value2 := 'two'. value3 := 'three'.
122
claus
parents: 121
diff changeset
   334
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   335
        model := Plug new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   336
        model respondTo:#value1 with:[value1].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   337
        model respondTo:#value1: with:[:arg | value1 := arg].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   338
        model respondTo:#value2 with:[value2].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   339
        model respondTo:#value2: with:[:arg | value2 := arg].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   340
        model respondTo:#value3 with:[value3].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   341
        model respondTo:#value3: with:[:arg | value3 := arg].
122
claus
parents: 121
diff changeset
   342
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   343
        field1 model:model; aspect:#value1; change:#value1:.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   344
        field2 model:model; aspect:#value2; change:#value2:.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   345
        field3 model:model; aspect:#value3; change:#value3:.
122
claus
parents: 121
diff changeset
   346
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   347
        top delegate:group.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   348
        top openModal.
122
claus
parents: 121
diff changeset
   349
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   350
        Transcript showCR:'value1: ' , value1.
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   351
        Transcript showCR:'value2: ' , value2.
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   352
        Transcript showCR:'value3: ' , value3.
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   353
                                                                        [exEnd]
122
claus
parents: 121
diff changeset
   354
claus
parents: 121
diff changeset
   355
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   356
    all of the above is done automatically for you, 
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   357
    if you add inputFields to a dialogBox.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   358
    Here, all fields use the same model, but different aspects:
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   359
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   360
        |box model
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   361
         value1 value2 value3|
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   362
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   363
        box := DialogBox new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   364
        box extent:200@200.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   365
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   366
        value1 := 'one'. value2 := 'two'. value3 := 'three'.
122
claus
parents: 121
diff changeset
   367
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   368
        model := Plug new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   369
        model respondTo:#value1 with:[value1].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   370
        model respondTo:#value1: with:[:arg | value1 := arg].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   371
        model respondTo:#value2 with:[value2].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   372
        model respondTo:#value2: with:[:arg | value2 := arg].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   373
        model respondTo:#value3 with:[value3].
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   374
        model respondTo:#value3: with:[:arg | value3 := arg].
122
claus
parents: 121
diff changeset
   375
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   376
        (box addInputFieldOn:model) aspect:#value1; change:#value1:.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   377
        box addVerticalSpace.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   378
        (box addInputFieldOn:model) aspect:#value2; change:#value2:.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   379
        box addVerticalSpace.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   380
        (box addInputFieldOn:model) aspect:#value3; change:#value3:.
122
claus
parents: 121
diff changeset
   381
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   382
        box addOkButton.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   383
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   384
        box open.
122
claus
parents: 121
diff changeset
   385
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   386
        Transcript showCR:'value1: ' , value1.
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   387
        Transcript showCR:'value2: ' , value2.
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   388
        Transcript showCR:'value3: ' , value3.
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   389
                                                                        [exEnd]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   390
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   391
    Here, the fields use different models, but the same aspect:
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   392
                                                                        [exBegin]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   393
        |box model
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   394
         valueHolder1 valueHolder2 valueHolder3|
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   395
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   396
        box := DialogBox new.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   397
        box extent:200@200.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   398
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   399
        valueHolder1 := 'one' asValue. 
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   400
        valueHolder2 := 'two' asValue. 
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   401
        valueHolder3 := 'three' asValue.
122
claus
parents: 121
diff changeset
   402
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   403
        box addInputFieldOn:valueHolder1.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   404
        box addVerticalSpace.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   405
        box addInputFieldOn:valueHolder2.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   406
        box addVerticalSpace.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   407
        box addInputFieldOn:valueHolder3.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   408
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   409
        box addOkButton.
122
claus
parents: 121
diff changeset
   410
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   411
        box open.
122
claus
parents: 121
diff changeset
   412
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   413
        Transcript showCR:'value1: ' , valueHolder1 value.
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   414
        Transcript showCR:'value2: ' , valueHolder2 value.
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   415
        Transcript showCR:'value3: ' , valueHolder3 value.
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   416
                                                                        [exEnd]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   417
"
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   418
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   419
    "Created: 27.4.1996 / 16:43:28 / cg"
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 7
diff changeset
   420
! !
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   421
278
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   422
!EnterFieldGroup methodsFor:'accessing'!
122
claus
parents: 121
diff changeset
   423
5059
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   424
currentField
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   425
    "return the field which currently has the focus"
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   426
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   427
     ^ currentField
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   428
!
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   429
278
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   430
fields
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   431
    "return a collection of the inputFields contained in the group."
122
claus
parents: 121
diff changeset
   432
278
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   433
     ^ fields
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   434
!
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   435
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   436
leaveAction:aBlock
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   437
    "set the action to perform when the last field is left.
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   438
     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
   439
     some additional processing (such as closing a dialog)."
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
    leaveAction := aBlock
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   442
!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   443
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   444
leaveOnTabLast:aBoolean
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   445
    "specifies if leaving the last field via Tab
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   446
     should leave the group or stay in the group.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   447
     (if staying, either wrap or not, depending on the setting of wrap)
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   448
     The default is to stay in the group"
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   449
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   450
    leaveOnTabLast := aBoolean
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   451
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   452
    "Created: 27.4.1996 / 17:22:30 / cg"
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   453
    "Modified: 27.4.1996 / 17:22:44 / cg"
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   454
!
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   455
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   456
makeAllTabable
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   457
    "make all fields tabable"
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   458
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   459
    fields do:[:field |
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   460
        field makeTabable
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   461
    ]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   462
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   463
    "Created: 27.4.1996 / 17:11:41 / cg"
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   464
!
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   465
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   466
wrap:aBoolean
278
7a01cd530452 cursor-down wrapping
ca
parents: 258
diff changeset
   467
    "specifies if leaving the last field via non-Return
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   468
     (i.e. Tab or Cursor-Down) should wrap back to the first, 
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   469
     or leave the group.
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   470
     The default is to not leave the group and wrap back to the first field."
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   471
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   472
    wrap := aBoolean
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   473
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   474
    "Modified: 27.4.1996 / 17:19:50 / cg"
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   475
! !
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   476
2144
8cfc21c91319 category rename
Claus Gittinger <cg@exept.de>
parents: 2028
diff changeset
   477
!EnterFieldGroup methodsFor:'adding & removing'!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   478
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   479
add:aField
1355
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   480
    "add another field to the group.
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   481
     Cursor motion out of the previous field will lead to the next
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   482
     one and vice versa."
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   483
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   484
    self add:aField before:nil
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   485
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   486
    "Modified: 18.10.1997 / 03:19:51 / cg"
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   487
!
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   488
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   489
add:aField before:anotherField
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   490
    "add another field to the group into a particular position
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   491
     within the tabbing order.
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   492
     Cursor motion out of the previous field will lead to the next
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   493
     one and vice versa."
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   494
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   495
    fields isNil ifTrue:[
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   496
        fields := OrderedCollection new
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   497
    ].
1355
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   498
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   499
    anotherField isNil ifTrue:[
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   500
        fields add:aField.
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   501
    ] ifFalse:[
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   502
        fields add:aField before:anotherField
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   503
    ].
121
claus
parents: 69
diff changeset
   504
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   505
    aField delegate:self.
121
claus
parents: 69
diff changeset
   506
    aField hideCursor.
596
bbcca426b401 dont enable/disable fields
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
   507
"/    aField disable.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   508
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   509
    "set the fields enableAction to disable active field"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   510
316
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   511
    aField clickAction:[:field |
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   512
        self makeActive:field
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   513
    ].
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   514
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   515
    "set the fields leaveAction to enable next field"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   516
1795
09b19fcb4215 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
   517
    aField leaveAction:[:field :key |
09b19fcb4215 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
   518
        self fieldLeft:field withKey:key
121
claus
parents: 69
diff changeset
   519
    ].
claus
parents: 69
diff changeset
   520
claus
parents: 69
diff changeset
   521
    fields size == 1 ifTrue:[
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   522
        "the first one"
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   523
        self makeActive:aField
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   524
    ]
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   525
1355
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   526
    "Created: 18.10.1997 / 03:06:00 / cg"
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   527
    "Modified: 18.10.1997 / 03:20:36 / cg"
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   528
!
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   529
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   530
remove:aField
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   531
    "remove a field from the group."
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   532
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   533
    fields isNil ifTrue:[^ self].
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   534
    (fields includesIdentical:aField) ifFalse:[^ self].
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   535
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   536
    fields removeIdentical:aField.
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   537
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   538
    "Created: 18.10.1997 / 02:53:29 / cg"
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   539
    "Modified: 18.10.1997 / 03:21:09 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   540
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   541
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   542
!EnterFieldGroup methodsFor:'event forwarding'!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   543
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   544
buttonPress:button x:x y:y view:aView
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   545
    "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
   546
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   547
    self makeActive:aView.
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   548
    aView buttonPress:button x:x y:y
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   549
!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   550
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   551
handlesButtonPress:button inView:aView
258
ae4b8f1a6738 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   552
    "query from event processor: am I interested in button-events ?
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   553
     yes I am (to activate the clicked-on field)."
122
claus
parents: 121
diff changeset
   554
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   555
   ^ true
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   556
!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   557
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   558
handlesKeyPress:key inView:aView
258
ae4b8f1a6738 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   559
    "query from event processor: am I interested in key-events ?
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   560
     yes I am (to forward it to the active field)."
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   561
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   562
    ^ true
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   563
!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   564
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   565
handlesKeyRelease:key inView:aView
258
ae4b8f1a6738 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   566
    "query from event processor: am I interested in key-events ?
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   567
     yes I am (to forward it to the active field)."
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   568
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   569
    ^ true
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   570
!
121
claus
parents: 69
diff changeset
   571
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   572
keyPress:key x:x y:y view:aView
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   573
    "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
   574
     (with nil coordinates to indicate that the key was pressed
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   575
      outside. However, this info is not used by any view currently)"
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   576
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   577
    currentField notNil ifTrue:[
5959
b27a22e16282 #TUNING by sr
sr
parents: 5592
diff changeset
   578
        "/ in case the currentFIeld was destroyed without telling me... (hack fix).
b27a22e16282 #TUNING by sr
sr
parents: 5592
diff changeset
   579
        currentField device notNil ifTrue:[
b27a22e16282 #TUNING by sr
sr
parents: 5592
diff changeset
   580
            currentField keyPress:key x:nil y:nil
b27a22e16282 #TUNING by sr
sr
parents: 5592
diff changeset
   581
        ]
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   582
    ]
466
e878bd3b227e delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   583
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   584
    "Modified: / 18.9.1998 / 20:00:36 / cg"
199
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   585
!
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   586
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   587
keyRelease:key x:x y:y view:aView
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   588
    "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
   589
     (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
   590
      outside. However, this info is not used by any view currently)"
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   591
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   592
    currentField notNil ifTrue:[
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   593
	currentField keyRelease:key x:-1 y:-1
b560339667cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   594
    ]
589
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   595
!
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   596
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   597
showFocus:onOrOff
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   598
    "forward focus display to the active field "
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   599
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   600
    currentField notNil ifTrue:[
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   601
        currentField showFocus:onOrOff
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   602
    ]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   603
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   604
    "Modified: 4.3.1996 / 22:18:22 / cg"
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   605
    "Created: 27.4.1996 / 16:41:38 / cg"
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   606
!
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   607
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   608
showNoFocus:onOrOff
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   609
    "forward nofocus display to the active field "
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   610
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   611
    currentField notNil ifTrue:[
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   612
        currentField showNoFocus:onOrOff
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   613
    ]
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   614
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   615
    "Modified: 4.3.1996 / 22:18:22 / cg"
4644afc9f0ae examples
Claus Gittinger <cg@exept.de>
parents: 581
diff changeset
   616
    "Created: 27.4.1996 / 16:42:07 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   617
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   618
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   619
!EnterFieldGroup methodsFor:'group control'!
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   620
1355
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   621
fieldLeft:aField withKey:key
1373
ffd73dd21ccd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
   622
    "some of my fields was left using key.
ffd73dd21ccd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
   623
     Figure out, which one to give the focus:
ffd73dd21ccd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
   624
     If there are more fields, go to that one;
ffd73dd21ccd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
   625
     otherwise, handle this like tabbing to the next component"
ffd73dd21ccd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
   626
3457
2684f36d5021 focus handling: focusSequence removed
ca
parents: 2144
diff changeset
   627
    |thisIndex action next wg explicit nFields nextField delta|
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   628
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   629
    action := key.
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   630
    nFields := fields size.
1355
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   631
    thisIndex := fields indexOf:aField.
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   632
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   633
    ((key == #CursorUp) or:[key == #PreviousField]) ifTrue:[
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   634
        delta := -1.
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   635
        (thisIndex == 1) ifTrue:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   636
            next := nFields
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   637
        ] ifFalse:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   638
            next := thisIndex - 1
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   639
        ]
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   640
    ].
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   641
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   642
    ((key == #CursorDown) 
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   643
    or:[key == #NextField
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   644
    or:[key == #Tab]]) ifTrue:[
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   645
        delta := 1.
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   646
        (thisIndex == nFields) ifTrue:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   647
            next := 1.
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   648
            wrap == false ifTrue:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   649
                action := #Return.
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   650
            ].
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   651
        ] ifFalse:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   652
            next := thisIndex + 1
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   653
        ]
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   654
    ].
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   655
    ((action == #Return)
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   656
    or:[key == #Tab and:[leaveOnTabLast == true]]) ifTrue:[
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   657
        delta := 1.
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   658
        (thisIndex == nFields) ifTrue:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   659
            leaveAction notNil ifTrue:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   660
                self makeInactive:aField.
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   661
                currentField := nil.
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   662
                leaveAction value.
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   663
                next := nil
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   664
            ] ifFalse:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   665
                next := 1
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   666
            ]
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   667
        ] ifFalse:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   668
            next := thisIndex + 1
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   669
        ]
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   670
    ].
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   671
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   672
    next notNil ifTrue:[
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   673
        "/ search for the next enabled field
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   674
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   675
        nextField := fields at:next.
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   676
        [nextField notNil 
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   677
         and:[nextField enabled not
2028
4f5c00067ee7 when checking for realized fields, ask via #reallyRealized;
Claus Gittinger <cg@exept.de>
parents: 1798
diff changeset
   678
               or:[nextField reallyRealized not]]] whileTrue:[
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   679
            next := next + delta.
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   680
            next < 1 ifTrue:[
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   681
                next := fields size.
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   682
            ] ifFalse:[
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   683
                next > fields size ifTrue:[
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   684
                    next := 1
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   685
                ]
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   686
            ].
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   687
            next == thisIndex ifTrue:[
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   688
                nextField := next := nil
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   689
            ] ifFalse:[
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   690
                nextField := fields at:next.
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   691
            ]
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   692
        ].
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   693
5062
2a9d94347cc5 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 5059
diff changeset
   694
        next isNil ifTrue:[
2a9d94347cc5 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 5059
diff changeset
   695
            (wg := currentField windowGroup) notNil ifTrue:[
4163
59799aef0498 changed: #fieldLeft:withKey:
az
parents: 3457
diff changeset
   696
                delta < 0 ifTrue:[
5062
2a9d94347cc5 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 5059
diff changeset
   697
                    wg focusPreviousFrom:aField
2a9d94347cc5 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 5059
diff changeset
   698
                ] ifFalse:[
2a9d94347cc5 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 5059
diff changeset
   699
                    wg focusNextFrom:aField.
4163
59799aef0498 changed: #fieldLeft:withKey:
az
parents: 3457
diff changeset
   700
                ].
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   701
            ].
5062
2a9d94347cc5 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 5059
diff changeset
   702
            ^ self.
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   703
        ].
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   704
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   705
        nextField := fields at:next.
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   706
        explicit := false.
4163
59799aef0498 changed: #fieldLeft:withKey:
az
parents: 3457
diff changeset
   707
        wg notNil ifTrue:[
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   708
            wg focusView == currentField ifTrue:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   709
                explicit := true.
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   710
            ]
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   711
        ].
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   712
        explicit ifTrue:[
1798
db5f59b1af9d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1795
diff changeset
   713
            wg focusView:nextField byTab:(wg focusCameByTab).
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   714
        ] ifFalse:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   715
            self makeActive:nextField 
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   716
        ]
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   717
    ]
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   718
4163
59799aef0498 changed: #fieldLeft:withKey:
az
parents: 3457
diff changeset
   719
    "Created: / 18-10-1997 / 03:03:34 / cg"
59799aef0498 changed: #fieldLeft:withKey:
az
parents: 3457
diff changeset
   720
    "Modified: / 18-09-1998 / 20:16:48 / cg"
59799aef0498 changed: #fieldLeft:withKey:
az
parents: 3457
diff changeset
   721
    "Modified: / 24-08-2010 / 16:14:17 / az"
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   722
! !
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   723
121
claus
parents: 69
diff changeset
   724
!EnterFieldGroup methodsFor:'misc'!
claus
parents: 69
diff changeset
   725
claus
parents: 69
diff changeset
   726
activateFirst
5059
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   727
    "pass control to my first field"
121
claus
parents: 69
diff changeset
   728
claus
parents: 69
diff changeset
   729
    fields notNil ifTrue:[
322
3a25112b58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
   730
        self makeActive:fields first
121
claus
parents: 69
diff changeset
   731
    ]
322
3a25112b58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
   732
3a25112b58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
   733
    "Modified: 7.2.1996 / 15:23:09 / cg"
675
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   734
!
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   735
1647
55d802bae8eb added #activateFirstIfNoCurrent
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
   736
activateFirstIfNoCurrent
5059
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   737
    "pass control to my first field, if there is no current field"
1647
55d802bae8eb added #activateFirstIfNoCurrent
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
   738
55d802bae8eb added #activateFirstIfNoCurrent
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
   739
    currentField isNil ifTrue:[
55d802bae8eb added #activateFirstIfNoCurrent
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
   740
        self activateFirst
1793
769bcc27886b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   741
    ] ifFalse:[
769bcc27886b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   742
        currentField requestFocus
1647
55d802bae8eb added #activateFirstIfNoCurrent
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
   743
    ]
55d802bae8eb added #activateFirstIfNoCurrent
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
   744
55d802bae8eb added #activateFirstIfNoCurrent
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
   745
    "Created: / 13.8.1998 / 21:22:35 / cg"
1793
769bcc27886b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   746
    "Modified: / 15.3.1999 / 08:22:18 / cg"
1647
55d802bae8eb added #activateFirstIfNoCurrent
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
   747
!
55d802bae8eb added #activateFirstIfNoCurrent
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
   748
675
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   749
activateLast
5059
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   750
    "pass control to my last field"
675
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   751
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   752
    fields notNil ifTrue:[
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   753
        self makeActive:fields last
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   754
    ]
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   755
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   756
    "Modified: 7.2.1996 / 15:23:09 / cg"
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   757
    "Created: 22.5.1996 / 19:04:05 / cg"
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   758
!
770fec28aec8 added #makeInactive
Claus Gittinger <cg@exept.de>
parents: 661
diff changeset
   759
1685
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   760
delegatesTo:aView
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   761
    ^ aView == currentField
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   762
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   763
    "Created: / 18.9.1998 / 19:57:49 / cg"
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   764
    "Modified: / 18.9.1998 / 19:58:23 / cg"
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   765
!
36c8fa86d629 skip disabled and invisible fields when stepping to next field
Claus Gittinger <cg@exept.de>
parents: 1647
diff changeset
   766
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   767
makeActive:aField
121
claus
parents: 69
diff changeset
   768
    "make a specific field the active one"
claus
parents: 69
diff changeset
   769
316
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   770
    currentField == aField ifTrue:[^ self].
1e27aa926710 fixed Tab handling in enterFieldGroups;
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   771
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   772
    currentField notNil ifTrue:[
596
bbcca426b401 dont enable/disable fields
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
   773
        currentField hideCursor.
bbcca426b401 dont enable/disable fields
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
   774
        currentField hasKeyboardFocus:false.
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   775
    ].
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   776
    currentField := aField.
121
claus
parents: 69
diff changeset
   777
    currentField showCursor.
claus
parents: 69
diff changeset
   778
    currentField hasKeyboardFocus:true.
596
bbcca426b401 dont enable/disable fields
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
   779
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   780
    "Modified: 21.5.1996 / 21:21:07 / cg"
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   781
!
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   782
5059
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   783
makeInactive
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   784
    "make the current field inActive (take its focus)"
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   785
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   786
    self makeInactive:currentField
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   787
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   788
    "Created: 22.5.1996 / 18:58:56 / cg"
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   789
    "Modified: 22.5.1996 / 19:03:44 / cg"
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   790
!
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   791
661
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   792
makeInactive:aField
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   793
    "make a specific field inActive"
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   794
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   795
    currentField == aField ifTrue:[currentField := nil].
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   796
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   797
    aField notNil ifTrue:[
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   798
        aField hideCursor.
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   799
        aField hasKeyboardFocus:false.
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   800
    ].
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   801
27057bdde205 disable last field on leave
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   802
    "Created: 21.5.1996 / 21:20:57 / cg"
121
claus
parents: 69
diff changeset
   803
! !
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   804
1355
6725ab9cc6f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   805
!EnterFieldGroup class methodsFor:'documentation'!
203
8a38b0b03233 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   806
8a38b0b03233 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   807
version
5574
mawalch
parents: 5062
diff changeset
   808
    ^ '$Header$'
4163
59799aef0498 changed: #fieldLeft:withKey:
az
parents: 3457
diff changeset
   809
!
59799aef0498 changed: #fieldLeft:withKey:
az
parents: 3457
diff changeset
   810
59799aef0498 changed: #fieldLeft:withKey:
az
parents: 3457
diff changeset
   811
version_CVS
5574
mawalch
parents: 5062
diff changeset
   812
    ^ '$Header$'
203
8a38b0b03233 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   813
! !
5059
0086d620e309 class: EnterFieldGroup
Claus Gittinger <cg@exept.de>
parents: 4163
diff changeset
   814