Working with IEntryField Parts

The following tasks are associated with using an IEntryField* part in visual composition. Tasks that are common to many parts are described in related topics.

Defining initial text for an entry field
To define initial text for the entry field, do one of the following:

Aligning text
To align text in the entry field, open the style property in the IEntryField* property sheet. Then, set one of the following styles on and set the others off:

The default style sets the leftAlign style on.

Preventing user changes
To prevent the user from entering or modifying text, open the style property in the IEntryField* property sheet and set the readOnly style to on.

Assigning text
To copy text into the entry field when the user presses a push button, do the following:
  1. Connect the IPushButton* buttonClickEvent feature to the IEntryField* text attribute.

  2. Connect the data source to the text parameter of the buttonClickEvent-to-text connection.

Copying text from an entry field
To copy the contents of the entry field as text when the user presses a push button, do the following:
  1. Connect the IPushButton* buttonClickEvent feature to an action of the target part that sets text for the part.

  2. Connect the IEntryField* text attribute to a text parameter of the buttonClickEvent-to-action connection.

Copying numeric data from an entry field

To copy the contents of the entry field as numeric data when the user presses a push button, do the following:

  1. Connect the IPushButton* buttonClickEvent feature to an action of the target part that sets the numeric value for the part.

  2. Connect the IEntryField* valueAsInt attribute or valueAsDouble attribute to a numeric parameter of the buttonClickEvent-to-action connection.


Related procedures
Common Tasks for Control Parts
Setting Part Style Properties
Setting Part Color Properties
Setting Part Font Properties
Setting Part Handlers Properties
Setting Part Framing Properties
Editing Part Labels Directly
Providing Drag and Drop Support
Working with VisualAge User Interface Parts

Related references
IEntryField
Property Settings -- IEntryField
Portability -- IEntryField