Class TPxMask (unit dnPxMask)

Inherits from

TPersistent

* Base class for handling Paradox masks

Constructors


constructor create(aOwner : TComponent);

** TPxMask


Functions

procedure CheckResetKey(var Key : char);


procedure CheckSyntax(var aMask : string);

* raises EPxMaskError, if aMask contains syntaxerrors

procedure Clear;


function Cleared: boolean;


function FormatErrorText(Ident: cardinal): string;


procedure HookKeyPress(var Key: Char);

* To be called from Owner's KeyPress

procedure HookWndProc(var Message: TMessage);

* Replaces Owner's WndProc

function isMasked : boolean;

* true if PxMask <> ''

procedure LoadMask;


procedure PrepareReset;


procedure Reset;


procedure SetCaret;

call FOwner's inherited WndProc

procedure Validate(var value : string);

* Checks value with func PxMaskValidate

procedure ValidateEdit;


procedure Assign(Source: TPersistent);


function CanEditModify: boolean;


procedure DefaultHandler(var Message);

40h

procedure DoReset(Preparing: boolean);


function GetEditHandle: THandle;

* Used internally: TCustomEdit --> result = Owner.

procedure InputError;

* raises EDBEditError, if Prop RaiseInputError = true, gets ErrorText via FormatErrorText(vePxMaskIllegalChar

function MaskLoaded : boolean;


procedure SetModified(value: boolean);


procedure ValidateError(Incomplete : boolean);

* raises EPxMaskError

procedure ValidChanged(EditControl: TWinControl);


procedure CheckEditText;


function GetEditControl: TWinControl;


function GetMaxLen: integer;


function GetModified : boolean;


function GetText: string;


function GetTextLen: integer;


function MaskStored : boolean;


function PropsStored: boolean;


procedure SetAutoFill(value: boolean);


procedure SetAutoValidate(value: boolean);


procedure SetErrMsg(const value: string);


procedure SetErrorPos(value : integer);


procedure SetMask(const value : string);


procedure SetRaiseInputError(value: boolean);


procedure SetText(const value: string);


Properties

property AutoFill : boolean


property AutoValidate : boolean


property ErrorMessage : string

* Custom error message

property Mask : string


property RaiseInputError : boolean


property EditControl : TWinControl


property EditHandle : THandle


property EditMaxLen : integer


property EditModified : boolean


property EditText : string


property EditTextLen : integer


property ErrorPos : integer

* Position of last Error after any validation

property Owner : TComponent


Events

Variables

FState : TPxMaskState;


FAutoFill : boolean;


FAutoValidate : boolean;


FErrMsg : string;


FErrPos : integer;


FMask : string;


FOwner : TComponent;


FRaiseInputError : boolean;



Constructors


constructor create(aOwner : TComponent);

** TPxMask


Functions


procedure CheckResetKey(var Key : char);


procedure CheckSyntax(var aMask : string);

* raises EPxMaskError, if aMask contains syntaxerrors


procedure Clear;


function Cleared: boolean;


function FormatErrorText(Ident: cardinal): string;


procedure HookKeyPress(var Key: Char);

* To be called from Owner's KeyPress


procedure HookWndProc(var Message: TMessage);

* Replaces Owner's WndProc


function isMasked : boolean;

* true if PxMask <> ''


procedure LoadMask;


procedure PrepareReset;


procedure Reset;


procedure SetCaret;

call FOwner's inherited WndProc


procedure Validate(var value : string);

* Checks value with func PxMaskValidate


procedure ValidateEdit;


procedure Assign(Source: TPersistent);


function CanEditModify: boolean;


procedure DefaultHandler(var Message);

40h


procedure DoReset(Preparing: boolean);


function GetEditHandle: THandle;

* Used internally: TCustomEdit --> result = Owner.Handle TCustomComboBox --> result = Owner.EditHandle TCustomGrid --> result = Owner.InplaceEditor.Handle


procedure InputError;

* raises EDBEditError, if Prop RaiseInputError = true, gets ErrorText via FormatErrorText(vePxMaskIllegalChar


function MaskLoaded : boolean;


procedure SetModified(value: boolean);


procedure ValidateError(Incomplete : boolean);

* raises EPxMaskError


procedure ValidChanged(EditControl: TWinControl);


procedure CheckEditText;


function GetEditControl: TWinControl;


function GetMaxLen: integer;


function GetModified : boolean;


function GetText: string;


function GetTextLen: integer;


function MaskStored : boolean;


function PropsStored: boolean;


procedure SetAutoFill(value: boolean);


procedure SetAutoValidate(value: boolean);


procedure SetErrMsg(const value: string);


procedure SetErrorPos(value : integer);


procedure SetMask(const value : string);


procedure SetRaiseInputError(value: boolean);


procedure SetText(const value: string);


Properties


property AutoFill : boolean


property AutoValidate : boolean


property ErrorMessage : string

* Custom error message


property Mask : string


property RaiseInputError : boolean


property EditControl : TWinControl


property EditHandle : THandle


property EditMaxLen : integer


property EditModified : boolean


property EditText : string


property EditTextLen : integer


property ErrorPos : integer

* Position of last Error after any validation


property Owner : TComponent


Events


Variables


FState : TPxMaskState;


FAutoFill : boolean;


FAutoValidate : boolean;


FErrMsg : string;


FErrPos : integer;


FMask : string;


FOwner : TComponent;


FRaiseInputError : boolean;