home *** CD-ROM | disk | FTP | other *** search
/ Kompuutteri K-CD 2002 #1 / K-CD_2002-01.iso / Delphi / INSTALL / program files / Borland / Delphi6 / Doc / Mask.int < prev    next >
Encoding:
Text File  |  2001-05-22  |  3.3 KB  |  117 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Visual Component Library         }
  5. {                                                       }
  6. {  Copyright (c) 1995-2001 Borland Software Corporation }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit Mask;
  11.  
  12. {$R-,T-,H+,X+}
  13.  
  14. interface
  15.  
  16. uses Windows, SysUtils, Classes, StdCtrls, Controls, Messages,
  17.   Forms, Graphics, Menus, MaskUtils;
  18.  
  19. type
  20. { TCustomMaskEdit }
  21.  
  22.   EDBEditError = class(Exception);
  23.   TMaskedState = set of (msMasked, msReEnter, msDBSetText);
  24.  
  25.   TCustomMaskEdit = class(TCustomEdit)
  26.   protected
  27.     procedure ReformatText(const NewMask: string);
  28.     procedure GetSel(var SelStart: Integer; var SelStop: Integer);
  29.     procedure SetSel(SelStart: Integer; SelStop: Integer);
  30.     procedure SetCursor(Pos: Integer);
  31.     procedure KeyDown(var Key: Word; Shift: TShiftState); override;
  32.     procedure KeyUp(var Key: Word; Shift: TShiftState); override;
  33.     procedure KeyPress(var Key: Char); override;
  34.     function EditCanModify: Boolean; virtual;
  35.     procedure Reset; virtual;
  36.     function GetFirstEditChar: Integer;
  37.     function GetLastEditChar: Integer;
  38.     function GetNextEditChar(Offset: Integer): Integer;
  39.     function GetPriorEditChar(Offset: Integer): Integer;
  40.     function GetMaxChars: Integer;
  41.     function Validate(const Value: string; var Pos: Integer): Boolean; virtual;
  42.     procedure ValidateError; virtual;
  43.     procedure CheckCursor;
  44.     property EditMask: TEditMask;
  45.     property MaskState: TMaskedState;
  46.     property MaxLength: Integer default 0;
  47.   public
  48.     constructor Create(AOwner: TComponent); override;
  49.     procedure ValidateEdit; virtual;
  50.     procedure Clear; override;
  51.     function GetTextLen: Integer;
  52.     property IsMasked: Boolean;
  53.     property EditText: string;
  54.     property Text: TMaskedText;
  55.   end;
  56.  
  57. { TMaskEdit }
  58.  
  59.   TMaskEdit = class(TCustomMaskEdit)
  60.   published
  61.     property Anchors;
  62.     property AutoSelect;
  63.     property AutoSize;
  64.     property BevelEdges;
  65.     property BevelInner;
  66.     property BevelOuter;
  67.     property BevelKind;
  68.     property BevelWidth;
  69.     property BiDiMode;
  70.     property BorderStyle;
  71.     property CharCase;
  72.     property Color;
  73.     property Constraints;
  74.     property Ctl3D;
  75.     property DragCursor;
  76.     property DragKind;
  77.     property DragMode;
  78.     property Enabled;
  79.     property EditMask;
  80.     property Font;
  81.     property ImeMode;
  82.     property ImeName;
  83.     property MaxLength;
  84.     property ParentBiDiMode;
  85.     property ParentColor;
  86.     property ParentCtl3D;
  87.     property ParentFont;
  88.     property ParentShowHint;
  89.     property PasswordChar;
  90.     property PopupMenu;
  91.     property ReadOnly;
  92.     property ShowHint;
  93.     property TabOrder;
  94.     property TabStop;
  95.     property Text;
  96.     property Visible;
  97.     property OnChange;
  98.     property OnClick;
  99.     property OnDblClick;
  100.     property OnDragDrop;
  101.     property OnDragOver;
  102.     property OnEndDock;
  103.     property OnEndDrag;
  104.     property OnEnter;
  105.     property OnExit;
  106.     property OnKeyDown;
  107.     property OnKeyPress;
  108.     property OnKeyUp;
  109.     property OnMouseDown;
  110.     property OnMouseMove;
  111.     property OnMouseUp;
  112.     property OnStartDock;
  113.     property OnStartDrag;
  114.   end;
  115.  
  116. implementation
  117.