?? expanel.pas
字號:
unit Expanel;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, ExtCtrls;
type
TExPanel = class(TPanel)
private
{ Private-Deklarationen }
FSpacingLeft: Integer;
FSpacingTop: Integer;
FSpacingRight: Integer;
FSpacingBottom: Integer;
Procedure SetSpacingLeft( value: Integer );
Procedure SetSpacingTop( value: Integer );
Procedure SetSpacingRight( value: Integer );
Procedure SetSpacingBottom( value: Integer );
protected
{ Protected-Deklarationen }
procedure AlignControls(AControl: TControl; var Rect: TRect); override;
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent); override;
published
{ Published-Deklarationen }
property SpacingLeft:Integer read FSpacingLeft write SetSpacingLeft default 8;
property SpacingTop:Integer read FSpacingTop write SetSpacingTop default 8;
property SpacingRight:Integer read FSpacingRight write SetSpacingRight default 8;
property SpacingBottom:Integer read FSpacingBottom write SetSpacingBottom default 8;
end;
procedure Register;
implementation
constructor TExPanel.Create(AOwner: TComponent);
Begin
inherited Create( aOwner );
FSpacingLeft := 8;
FSpacingTop := 8;
FSpacingRight := 8;
FSpacingBottom := 8;
ControlStyle := ControlStyle - [csSetCaption];
End;
Procedure TExPanel.SetSpacingLeft( value: Integer );
Begin
If FSpacingLeft <> value Then Begin
FSpacingLeft := value;
Realign;
Invalidate;
End;
End;
Procedure TExPanel.SetSpacingTop( value: Integer );
Begin
If FSpacingTop <> value Then Begin
FSpacingTop := value;
Realign;
Invalidate;
End;
End;
Procedure TExPanel.SetSpacingRight( value: Integer );
Begin
If FSpacingRight <> value Then Begin
FSpacingRight := value;
Realign;
Invalidate;
End;
End;
Procedure TExPanel.SetSpacingBottom( value: Integer );
Begin
If FSpacingBottom <> value Then Begin
FSpacingBottom := value;
Realign;
Invalidate;
End;
End;
procedure TExPanel.AlignControls(AControl: TControl; var Rect: TRect);
Begin
With Rect Do Begin
Left := Left + FSpacingLeft;
Top := Top + FSpacingTop;
Right := Right - FSpacingRight;
Bottom := Bottom - FSpacingBottom;
End;
inherited AlignControls( AControl, Rect );
End;
procedure Register;
begin
RegisterComponents('PBGoodies', [TExPanel]);
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -