Navigation: Language Reference > 8 - Controls > Control Declarations >====== ENTRY (declare a data entry control) ====== | |
ENTRY(picture) | ,AT()[,CURSOR()] [,USE()] [,LAYOUT( )] [,DISABLE] [,KEY()] [,MSG()] [,HLP()] [,SKIP][,FONT()] | |
[,IMM][,PASSWORD][,REQ][,FULL][,SCROLL][,ALRT()][,HIDE][,TIP( )][,FLAT][,TRN][,READONLY] |
[DROPID( )] | [, | INS | ] | [, | CAP | ] | [, | LEFT | ] [,COLOR( )] [,MASK] | ||
OVR | UPR | RIGHT | |||||||||
CENTER | |||||||||||
DECIMAL |
ENTRY | Places a data entry field on the WINDOW or TOOLBAR. |
picture | A display picture token that specifies the input format for the data entered into the control (PROP:Text). |
AT | Specifies the initial size and location of the control (PROP:AT). If omitted, default values are selected by the runtime library. |
CURSOR | Specifies a mouse cursor to display when the mouse is positioned over the control (PROP:CURSOR). If omitted, the WINDOW's CURSOR attribute is used, else the Windows default cursor is used. |
USE | The label of the variable that receives the value entered into the control by the user (PROP:USE). |
LAYOUT | Specifies the control's left-to-right or right-to-left display and entry orientation (PROP:LAYOUT) |
DISABLE | Specifies the control appears dimmed when the WINDOW or APPLICATION opens (PROP:DISABLE). |
KEY | Specifies an integer constant or keycode equate that immediately gives focus to the control (PROP:KEY). |
MSG | Specifies a string constant containing the text to display in the status bar when the control has focus (PROP:MSG). |
HLP | Specifies a string constant containing the help system identifier for the control (PROP:HLP). |
SKIP | Specifies the control receives input focus to enter text only with the mouse or accelerator key and does not retain focus (PROP:SKIP). |
FONT | Specifies the display font for the control (PROP:FONT). |
IMM | Specifies immediate event generation whenever the user presses any key (PROP:IMM). |
PASSWORD | Specifies non-display of the data entered (password mode) (PROP:PASSWORD). |
REQ | Specifies the control may not be left blank or zero (PROP:REQ). |
FULL | Specifies the control expands to occupy the entire size of the WINDOW for any missing AT attribute width or height parameter (PROP:FULL). |
SCROLL | Specifies the control scrolls with the window (PROP:SCROLL). |
ALRT | Specifies “hot” keys active for the control (PROP:ALRT). |
HIDE | Specifies the control does not appear when the WINDOW or APPLICATION is first opened (PROP:HIDE). UNHIDE must be used to display it. |
TIP | Specifies the text that displays as “balloon help” when the mouse cursor pauses over the control (PROP:ToolTip). |
FLAT | Specifies that the control does not have a 3D border drawn around it (PROP:FLAT). |
TRN | Specifies the control transparently displays over the background (PROP:TRN). |
READONLY | Specifies the control does not allow data entry (PROP:READONLY). |
DROPID | Specifies the control may serve as a drop target for drag-and-drop actions (PROP:DROPID). |
INS / OVR | Specifies Insert or Overwrite entry mode (PROP:INS and PROP:OVR). This is valid only on windows with the MASK attribute. |
UPR / CAP | Specifies all upper case or proper name capitalization (First Letter Of Each Word Capitalized) data entry (PROP:UPR and PROP:CAP). |
LEFT | Specifies that the data entered is left justified within the area specified by the AT attribute (PROP:LEFT). |
RIGHT | Specifies that the data entered is right justified within the area specified by the AT attribute (PROP:RIGHT). |
CENTER | Specifies that the data entered is centered within the area specified by the AT attribute (PROP:CENTER). |
DECIMAL | Specifies that the data entered is aligned on the decimal point within the area specified by the AT attribute (PROP:DECIMAL). |
COLOR | Specifies background and selected colors for the control (PROP:COLOR). |
MASK | Specifies pattern input editing mode of the ENTRY control (PROP:MASK). |
The ENTRY control places a data entry field on the WINDOW or TOOLBAR (not valid in a REPORT) at the position and size specified by its AT attribute. Data entered is formatted according to the picture, and the variable specified in the USE attribute receives the data entered when the user has completed data entry and moves on to another control. Data entry scrolls horizontally to allow the user to enter data to the full length of the variable. Therefore, the right and left arrow keys move within the data in the ENTRY control.
Standard Windows behavior (Cut, Copy, and Paste) are automatically available using CTRL+X, CTRL+C, and CTRL+V while the ENTRY control has focus. Undo is also implemented using CTRL+Z (before the user leaves the control).
An ENTRY control with the PASSWORD attribute displays asterisks when the user enters data (and Cut and Copy are disabled ). This is useful for password-type variables. An ENTRY control with the SKIP attribute is used for seldom-used data entry. Display-only data should be declared with the READONLY attribute.
The LAYOUT attribute is used with ENTRY controls to change the order that text is entered (Left-to-Right or Right-to-Left). Mixed text should always be avoided and may not display correctly (e.g. Arabic text mixed with English text).
The MASK attribute specifies pattern input editing mode of the control. This means that, as the user types in data, each character is automatically validated against the control's picture for proper input (numbers only in numeric pictures, etc.). This forces the user to enter data in the format specified by the control's display picture. If omitted, Windows free-input is allowed in the control. This is Windows' default data entry mode. Free-input means the user's data is formatted to the control's picture only after entry (on EVENT:Accepted). This allows users to enter data as they choose and it is automatically formatted to the control's picture after entry. If the user types in data in a format different from the control's picture, the libraries attempt to determine the format the user used, and convert the data to the control's display picture. For example, if the user types “January 1, 1995” into a control with a display picture of @D1, the runtime library formats the user's input to “1/1/95.” This action occurs only after the user completes data entry and moves to another control. If the runtime library cannot determine what format the user used, it will not update the USE variable and will simply generate EVENT:Rejected.
Events Generated:
EVENT:Selected | The control has received input focus. |
EVENT:Accepted | The user has completed data entry in the control. |
EVENT:Rejected | The user has entered an invalid value for the entry picture. |
EVENT:PreAlertKey | The user pressed an ALRT attribute hot key. |
EVENT:AlertKey | The user pressed an ALRT attribute hot key. |
EVENT:Drop | A successful drag-and-drop to the control. |
EVENT:NewSelection | The user entered a character (with IMM attribute only). |
Example:
MDIChild WINDOW('Child One'),AT(0,0,320,200),MDI,MAX,HVSCROLL ENTRY(@S8),AT(0,0,20,20),USE(E1) ENTRY(@S8),AT(20,0,20,20),USE(E2),KEY(F10Key) ENTRY(@S8),AT(40,0,20,20),USE(E3),MSG('Button 3') ENTRY(@S8),AT(60,0,20,20),USE(E4),HLP('Entry4Help') ENTRY(@S8),AT(80,0,20,20),USE(E5),DISABLE ENTRY(@S8),AT(100,0,20,20),USE(E6),FONT('Arial',12) ENTRY(@S8),AT(120,0,20,20),USE(E7),REQ,INS,CAP ENTRY(@S8),AT(140,0,20,20),USE(E8),SCROLL,OVR,UPR ENTRY(@S8),AT(180,0,20,20),USE(E9),CURSOR(CURSOR:Wait),IMM ENTRY(@S8),AT(200,0,20,20),USE(E10),ALRT(F10Key) ENTRY(@N8.2),AT(280,0,20,20),USE(E11),DECIMAL(10) END
See Also: