?? scustommaskedit.pas
字號:
unit sCustomMaskEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Mask, sConst, sStyleUtil, sStyleEdits;
type
TsCustomMaskEdit = class(TCustomMaskEdit)
private
{ Private declarations }
procedure WMNCCalcSize (var Message: TWMNCCalcSize); message WM_NCCALCSIZE;
procedure WMNCPaint (var Message: TMessage); message WM_NCPAINT;
protected
{ Protected declarations }
FsStyle : TsStyle;
procedure WndProc (var Message: TMessage); override;
procedure CreateWnd; override;
public
{ Public declarations }
constructor Create(AOwner:TComponent); override;
destructor Destroy; override;
procedure Invalidate; override;
procedure AfterConstruction; override;
procedure Loaded; override;
published
{ Published declarations }
property Anchors;
property AutoSelect;
property AutoSize;
property BiDiMode;
property CharCase;
property Constraints;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property EditMask;
property Font;
property ImeMode;
property ImeName;
property MaxLength;
property ParentBiDiMode;
property ParentFont;
property ParentShowHint;
property PasswordChar;
property PopupMenu;
property ReadOnly;
property ShowHint;
property TabOrder;
property TabStop;
property Text;
property Visible;
property OnChange;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDock;
property OnStartDrag;
property sStyle: TsStyle read FsStyle write FsStyle;
end;
TsMaskEdit = class(TsCustomMaskEdit)
end;
implementation
uses sStyleSimply;
{ TsCustomMaskEdit }
constructor TsCustomMaskEdit.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FsStyle := TsStyle.Create(Self);
FsStyle.COC := COC_TsCustomMaskEdit;
BorderStyle := bsNone;
ParentFont := True;
AutoSize := False;
Ctl3D := False;
ControlStyle := ControlStyle - [csFramed];
Height := 21;
OnKeyDown := sStyle.onKeyDown;
end;
procedure TsCustomMaskEdit.CreateWnd;
begin
inherited;
end;
destructor TsCustomMaskEdit.Destroy;
begin
if Assigned(FsStyle) then FreeAndNil(FsStyle);
OnKeyDown := nil;
inherited Destroy;
end;
procedure TsCustomMaskEdit.Invalidate;
begin
Color := sStyle.GetActiveColor;
if (csDesigning in ComponentState) and Assigned(FsStyle) then begin
if not RestrictDrawing then FsStyle.BGChanged := True;
end;
if Assigned(Parent) then sStyle.redrawBorder;
inherited;
end;
procedure TsCustomMaskEdit.AfterConstruction;
begin
inherited;
sStyle.Loaded;
end;
procedure TsCustomMaskEdit.WMNCCalcSize(var Message: TWMNCCalcSize);
begin
inherited;
InflateRect(Message.CalcSize_Params^.rgrc[0], -3, -3);
end;
procedure TsCustomMaskEdit.WMNCPaint(var Message: TMessage);
begin
if (csDestroying in ComponentState) or (csLoading in ComponentState) then Exit;
Color := sStyle.GetActiveColor;
inherited;
sStyle.RedrawBorder;
end;
procedure TsCustomMaskEdit.WndProc(var Message: TMessage);
begin
if Assigned(FsStyle) then FsStyle.WndProc(Message);
if Message.Result <> 1 then inherited;
end;
procedure TsCustomMaskEdit.Loaded;
begin
inherited;
sStyle.Loaded;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -