EditField.st
changeset 2737 64329a4d4dd5
parent 2709 f0028ee0df76
child 2750 94531b6049a3
equal deleted inserted replaced
2736:76212cf614cc 2737:64329a4d4dd5
    52 
    52 
    53     The above underlying internal mechanism can be used for fields which
    53     The above underlying internal mechanism can be used for fields which
    54     are passive; i.e. into which text can be entered and the value (string)
    54     are passive; i.e. into which text can be entered and the value (string)
    55     is extracted actively by someone else.
    55     is extracted actively by someone else.
    56 
    56 
    57   accepting:
    57     accepting:
    58     The opposite way to use editFields is to connect them to a model
    58       The opposite way to use editFields is to connect them to a model
    59     and let the field notify changes to it.
    59       and let the field notify changes to it.
    60     This notification is called ``accepting''.
    60       This notification is called ``accepting''.
    61     Unless accepted, the models value is not updated from the editFields contents
    61       Unless accepted, the models value is not updated from the editFields contents
    62     this default is the normal operation and way things should work, since most
    62       this default is the normal operation and way things should work, since most
    63     uses of editFields are not interested in every individual change
    63       uses of editFields are not interested in every individual change
    64     (i.e. getting each keyStroke when a long number is entered).
    64       (i.e. getting each keyStroke when a long number is entered).
    65     The default behavior is to ``accept'' when either return or a cursorUp/Down
    65       The default behavior is to ``accept'' when either return or a cursorUp/Down
    66     key is pressed in a field.
    66       key is pressed in a field.
    67     However, the field can setup to accept/not accept on leave, on return
    67       However, the field can setup to accept/not accept on leave, on return
    68     or on each individual key input.
    68       or on each individual key input.
    69     See the methods #acceptOnLeave: / #acceptOnReturn: / #immediateAccept.
    69       See the methods #acceptOnLeave: / #acceptOnReturn: / #immediateAccept.
    70 
    70 
    71     In addition, the set of keys which are considered ``leaveKeys'' can be
    71       In addition, the set of keys which are considered ``leaveKeys'' can be
    72     specified by #leaveKeys: (in case you need keys other than Return, CursorUp/Down).
    72       specified by #leaveKeys: (in case you need keys other than Return, CursorUp/Down).
    73 
    73 
    74   models value vs. field contents:
    74     models value vs. field contents:
    75     Although the field internally keeps its contents as some string object,
    75       Although the field internally keeps its contents as some string object,
    76     the application may prefer to think of numbers, floats, yes/no values etc.
    76       the application may prefer to think of numbers, floats, yes/no values etc.
    77     To support this, a converter may defined, which is responsible for conversion of
    77       To support this, a converter may defined, which is responsible for conversion of
    78     strings to/from the models domain value.
    78       strings to/from the models domain value.
    79     If present (i.e. nonNil), the converter is asked to convert a string to the models
    79       If present (i.e. nonNil), the converter is asked to convert a string to the models
    80     domain with #readValueFrom:aString and vice versa, a value to a string by #printStringFor:.
    80       domain with #readValueFrom:aString and vice versa, a value to a string by #printStringFor:.
    81     The PrintConverter class already provides a number of standard conversions, see the examples.
    81       The PrintConverter class already provides a number of standard conversions, see the examples.
    82     To access a converted value directly (i.e. not via the model), use #editValue.
    82       To access a converted value directly (i.e. not via the model), use #editValue.
    83 
    83 
    84   grouping:
    84     grouping:
    85     Individual fields do not know about being included in a group. This must be arranged on the
    85       Individual fields do not know about being included in a group. This must be arranged on the
    86     outside, by placing multiple fields into an EnterFieldGroup.
    86       outside, by placing multiple fields into an EnterFieldGroup.
    87     This groupObject keeps a reference to one active field, and forwards input from any other
    87       This groupObject keeps a reference to one active field, and forwards input from any other
    88     field to the active one. Also have a look at the examples for this.
    88       field to the active one. Also have a look at the examples for this.
    89 
    89 
    90   input completion:
    90     input completion:
    91     To support input completion (i.e. filename completion, classname completion etc.),
    91       To support input completion (i.e. filename completion, classname completion etc.),
    92     a completionBlock can be defined which (if non-nil) is evaluated when the completion-key
    92       a completionBlock can be defined which (if non-nil) is evaluated when the completion-key
    93     is pressed and its value is taken as the new field-contents. 
    93       is pressed and its value is taken as the new field-contents. 
    94     The physical completion-key is the Tab key (this one cannot be defined by
    94       The physical completion-key is the Tab key (this one cannot be defined by
    95     the keyboardTranslation mechanism, since that would disable the Tab-key on regular text views.
    95       the keyboardTranslation mechanism, since that would disable the Tab-key on regular text views.
    96 
    96 
    97 
    97 
    98 
    98 
    99     [Instance variables:]
    99     [Instance variables:]
   100 
   100 
  2127 ! !
  2127 ! !
  2128 
  2128 
  2129 !EditField class methodsFor:'documentation'!
  2129 !EditField class methodsFor:'documentation'!
  2130 
  2130 
  2131 version
  2131 version
  2132     ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.165 2003-03-20 01:22:30 cg Exp $'
  2132     ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.166 2003-04-24 12:59:19 cg Exp $'
  2133 ! !
  2133 ! !