TEditEnhOptions Type

Unit
CustomEditEnh

Declaration

TEditEnhOptions = set of (
    eeoAllowEmptyExit,
    eeoAutoExit,
    eeoBeepOnBadChar,
    eeoBeepOnValidateErr,
    eeoBeepOnTruncateErr,
    eeoBtnGlyphStretch,
    eeoBtnProportional,
    eeoExceptions,
    eeoWordWrap
    );

Description
Set of options to control the behaviour of TCustomEditEnh and its derivatives.

eeoAllowEmptyExit If a mask is defined then this setting controls whether a user is permitted to exit the control while it is empty. The default VCL mask edit will not permit exiting a masked control if anything has been input previously - which can be inappropriate. By default I permit the user to leave the control if all input has been cleared.

eeoAutoExit If masked and the user has entered data into all available positions the cursor will automatically be jumped to the next control in the tab-order.

eeoBeepOnBadChar If the global variable EditEnh_BeepOverride is false then this option controls whether the control issues a beep when the user inputs an invalid character.

eeoBeepOnValidateErr If the global variable EditEnh_BeepOverride is false then this option controls whether the control issues a beep when it finds an error during validation.

eeoBeepOnTruncateErr Defaults to true, so a beep will be issued whenever an input string is truncated - when it is assigned directly to the Text property. Generally you will only want to set this to false when your control is receiving input from floating point values - in such cases the number of decimal places actually received is uncertain due to the approximations inherant to these data types. (Ultimately the beep is only issued according to the setting of eeoBeepOnBadChar, this is provided as a separate setting in order to allow the exclusion of beeps only when assigning text directly to the control and you want truncated characters to be ignored.)

eeoBtnGlyphStretch If a button is defined using a custom glyph this controls whether the glyph will be stretched/shrunk to fit the size of the button.

eeoBtnProportional If a button is defined this controls whether the glyph (or arrow drawings) are constrained to maintain their proportions.

eeoExceptions Controls whether the control will raise an exception when it recieves a validation error.

eeoWordWrap Controls whether text is allowed to word wrap. The control could be resized to display multiple lines of text. I haven't tried out this option with masking enabled.


Global Variables impacting these options and their defaults...


EditEnh_BeepOverride := true;
EditEnh_BeepOnBadChar := true;
// MB_OK = default, use $FFFFFFFF for computer beep
// See Windows API MessageBeep for other options
EditEnh_BeepOnBadCharSound := MB_OK;
EditEnh_BeepOnValidateErr := true;
EditEnh_BeepOnValidateErrSound := MB_ICONASTERISK;