EDITTEXT Statement

Summary: Syntax

EDITTEXTid, x, y, width, height [[,style]]

This statement defines an EDIT control belonging to the EDIT class. It creates a rectangular region in which the user can enter and edit text. The control displays a cursor when the user clicks the mouse in it. The user can then use the keyboard to enter text or edit the existing text. Editing keys include the BACKSPACE and DELETE keys. The user can also use the mouse to select characters to be deleted, or to select the place to insert new characters.

The id field takes a unique integer value that identifies the control.

The x and y fields take integer values that specify the x and y coordinates of the upper-left corner of the control. The horizontal units are 1/4 of the dialog base width unit; the vertical units are 1/8 of the dialog base height unit. The current dialog base units are computed from the height and width of the current system font. The GetDialogBaseUnits function returns the dialog base units in pixels. The coordinates are relative to the origin of the dialog box.

The width and height fields take integer values that specify the width and height of the control. The width units are 1/4 of the dialog base width unit; the height units are 1/8 of the dialog base height unit.

The optional style field can contain any combination (or none) of the following styles:

WS_TABSTOP

WS_GROUP

WS_VSCROLL

WS_HSCROLL

WS_DISABLED

These styles are described in the list of window styles following the description of the STYLE statement on page 171.

In addition to these styles, the style field may contain any combination (or none) of the EDIT-class styles described in the list of control styles on page 192. Styles can be combined using the bitwise inclusive OR operator. The EDIT-class styles must not conflict with each other.

Summary: Comments

The x, y, width, and height fields can use the addition operator (+) for relative positioning. For example, 15 + 6 can be used for the x field.

The default style for EDITTEXT is WS_TABSTOP, ES_LEFT, and WS_BORDER.

Keyboard use is predefined for edit controls. Predefined keys are listed in the System Application Architecture, Common User Access: Advanced Interface Design Guide.

The following example demonstrates the correct usage of the EDITTEXT
statement:

EDITTEXT 3, 10, 10, 100, 10