added TBitBtn.Margin

git-svn-id: trunk@5315 -
This commit is contained in:
mattias 2004-03-17 13:10:01 +00:00
parent aeff605972
commit 38f2d182a4
2 changed files with 17 additions and 1 deletions

View File

@ -143,12 +143,14 @@ type
FButtonGlyph: TButtonGlyph;
FKind: TBitBtnKind;
FLayout: TButtonLayout;
FMargin: integer;
FSpacing: Integer;
Function GetGlyph: TBitmap;
Function IsGlyphStored: Boolean;
Procedure SetGlyph(AValue: TBitmap);
Procedure SetKind(AValue: TBitBtnKind);
Procedure SetLayout(AValue: TButtonLayout);
procedure SetMargin(const AValue: integer);
Procedure SetSpacing(AValue: Integer);
procedure RealizeKind;
@ -170,6 +172,7 @@ type
property Glyph: TBitmap read GetGlyph write SetGlyph stored IsGlyphStored;
property Kind: TBitBtnKind read FKind write SetKind default bkCustom;
property Layout: TButtonLayout read FLayout write SetLayout default blGlyphLeft;
property Margin: integer read FMargin write SetMargin default -1;
property ModalResult;
property OnChangeBounds;
property OnClick;
@ -327,6 +330,9 @@ end.
{ =============================================================================
$Log$
Revision 1.62 2004/03/17 13:10:01 mattias
added TBitBtn.Margin
Revision 1.61 2004/02/27 00:42:41 marc
* Interface CreateComponent splitup
* Implemented CreateButtonHandle on GTK interface

View File

@ -25,10 +25,11 @@ begin
FKind := bkCustom;
FLayout := blGlyphLeft;
FSpacing := 3;
fMargin:=-1;
FButtonGlyph := TButtonGlyph.Create;
FButtonGlyph.OnChange := @GlyphChanged;
Align := alNone;
SetInitialBounds(1,1,75,25);
SetInitialBounds(0,0,75,25);
RealizeKind;
end;
@ -125,6 +126,15 @@ Begin
CNSendMessage(LM_LAYOUTCHANGED,Self,nil);
end;
procedure TBitBtn.SetMargin(const AValue: integer);
begin
if FMargin=AValue then exit;
FMargin:=AValue;
if HandleAllocated then
//still send the layout message because it still calls the same procedure
CNSendMessage(LM_LAYOUTCHANGED,Self,nil);
end;
Procedure TBitBtn.SetSpacing(AValue: Integer);
Begin
if (FSpacing = AValue) or (AValue < 0) then Exit;