DIF_MASKEDIT

Far Manager

DIF_MASKEDIT

The DIF_MASKEDIT flag allows to set a mask for a DI_FIXEDIT control. If this flag is set, Mask must contain the address of a text string with the mask.

For now, the following mask characters are supported:

'X' allows to enter any character at the given line position;
'#' allows to enter digits, spaces, and the minus sign at the given line position;
'9' allows to enter only digits at the given line position;
'A' allows to enter only letters at the given line position;
'H' allows to enter only hexadecimal digits at the given line position.

It is possible to create an infinite variety of masks, for example: "(###) #99-99-99". In this mask, parenthesis and hyphens will be static (i.e., they cannot be deleted) line elements, and it is possible to enter digits or spaces in the parenthesis (e.g., city phone code), but it is possible to enter only digits in the positions with "9" digits.

One note about the usage of the DIF_MASKEDIT flag. When you set a mask string (e.g., to "99.99.9999"), remember that processing is organized so that the edit string length is forcibly set to the mask string length.

Controls

The DIF_MASKEDIT flag is applicable to the following dialog items:

ControlDescription
DI_FIXEDIT Fixed size edit box.

Remarks

The DIF_HISTORY flag has a higher priority than the DIF_MASKEDIT flag.

See also: