The Label WidgetTable of the WidgetsThe Text Editor Wigdet
 

The Entry Field (InputField) Widget

A View of a Entry Field Widget

View Class: EditField
Spec Class: InputFieldSpec

The Entry Field Widget (called InputField in VisualWorks) is used to provide single-line text entry and edit capabilities. The user can type in any alpha-numeric characters into the entry field. If the entry string exceeds the width of the entry field, the field will automatically (horizontally) scroll to hold the edit cursor on focus.
The EditField supports selection, copy, cut and paste (both via keyboard shortcuts and via its popUpMenu.

In principle, editFields operate on a string aspect; however, a typeConverter can be specified, which performs automatic conversion of the entered string into some other object type (and also vice-versa, converts the object into a printed string representation).


The Basics Section:

ID Unique symbolic name (ID) of the entry field.  
This ID can be used by the application to access the widget via "builder » componentAt:#ID".
Group ID Unique symbolic name (ID) for the group of the entry field.  
Entry fields within a common group ID can be reached by the cursor keys.
Model Aspect selector or binding for the object which is shown (& edited) in the entry field (i.e. its model). 
It should return a 

    - String instance (only for static behavior) 
    - ValueModel* instance with a String instance 
 

Type Defines how the entry string is converted to an object (which is stored into the aspect-holder). 
Beside a number of standard typeConverters, an application may provide a specialized converter via the Converter aspect.
Converter If non-empty, this defines an aspect or binding for the typeConverter
(usually, the name of a method in the application, which returns an instance of TypeConverter).
Size Maximum number of characters which can be typed in.
Format String A format string for conversion (enabled if type = "date" or "time")

Useful examples:
%y%m%d (date)
%y-%m-%d (date)
%d%m%Y (date)
%m/%d/%y (date us format)
%D-%(monthName)-%y (date)

%h:%m:%s (time)
%h:%m:%s.%i (time + ms)
%u:%m:%s %a (time us format)

%(year)-%(month)-%(day)T%h:%m:%s.%(milli2)%(TZD) (timestamp ISO)

For a full list, see "Date>>addPrintBindingsTo:" and "Time>>addPrintBindingsTo:".
MinValue Minimum allowed value to be entered (enabled if type = "NumberInRange")
MaxValue Maximum allowed value to be entered (enabled if type = "NumberInRange")
 
 

The Details Section:

Font Defines the font style of the entry field. 
After selecting the check toggle the font style can be chosen by selecting one of the Family/Face/Style/Size buttons. If no font style is selected, the entry field takes its default font style from the style sheet.
FG-Color Defines the foreground color of the entry field. 
After selecting the check toggle the foreground color can be chosen by selecting the desired colored button. If no color  is selected, the entry field takes its default foreground color from the style sheet.
BG-Color Defines the background color of the entry field. 
After selecting the check toggle the background color can be chosen by selecting the desired colored button. If no color  is selected, the entry field takes its default background color from the style sheet.
Accept-Immediate If on, each change will be immediately sent to the model
(i.e. each keyPress will immediately force an accept)
Accept-On Return If on, the entry string will be sent to the model
when the RETURN-key is pressed.
Accept-On Tab If on, the entry string will be sent to the model
when the TAB-key is pressed.
Accept-On Leave If on, the entry string will be sent to the model
when the field is left (via RETURN, TAB or cursor keys).
Accept-On Lost Focus If on, the entry string will be sent to the model
when the field looses the keyboard focus.
AcceptChannel A valueHolder which allows forced accept by the application
(by storing a true value into the holder).
This can be done in a dialogs OK-action.
Initially Disabled Turns on/off that the entry field is initially disabled.
Initially Invisible Turns on/off that the entry field is initially invisible.
Can Tab Turns on/off that the entry field can be reached by tabbing.
Read Only Turns on/off that the entry field can be modified.

Be careful, when combining Immediate accept with a typeconverter; since the typeconverter is invoked for every key, it may be given invalid input and fail to convert the string correctly.

The recommended/normal setup is to either 'accept-on-lost-focus' or to use an acceptChannel, which is set by a dialogs OK-Button-action.  
 

The Channels Section:

Enable Aspect selector or binding for en-/disabling the entry field. 
It should return a 

    - Boolean instance** (only for static behavior) 
    - ValueModel* instance with a Boolean instance** 

A value model is used to dynamically enable/disable the entry field.

Modified Aspect selector or binding for the modified flag. 
It should return a ValueModel* instance holding a Boolean or a block, responding to #value:.

The valueHolder/block will get a true value, when the user edits the fields contents (i.e. modifies the input).

*  = ValueHolder, AspectAdaptor, BufferedValueHolder, RangeAdaptor, TriggerValue
** = true, false
 

The Help Section:

see document "Using the Help Tool"
 
 

The Layout Section:

see document "The Layout of the Widgets"
 
 


[stx-logo]
Copyright © 1998 eXept Software AG, all rights reserved