mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 03:16:10 +02:00
added TBitBtn.Margin
git-svn-id: trunk@5315 -
This commit is contained in:
parent
aeff605972
commit
38f2d182a4
@ -143,12 +143,14 @@ type
|
|||||||
FButtonGlyph: TButtonGlyph;
|
FButtonGlyph: TButtonGlyph;
|
||||||
FKind: TBitBtnKind;
|
FKind: TBitBtnKind;
|
||||||
FLayout: TButtonLayout;
|
FLayout: TButtonLayout;
|
||||||
|
FMargin: integer;
|
||||||
FSpacing: Integer;
|
FSpacing: Integer;
|
||||||
Function GetGlyph: TBitmap;
|
Function GetGlyph: TBitmap;
|
||||||
Function IsGlyphStored: Boolean;
|
Function IsGlyphStored: Boolean;
|
||||||
Procedure SetGlyph(AValue: TBitmap);
|
Procedure SetGlyph(AValue: TBitmap);
|
||||||
Procedure SetKind(AValue: TBitBtnKind);
|
Procedure SetKind(AValue: TBitBtnKind);
|
||||||
Procedure SetLayout(AValue: TButtonLayout);
|
Procedure SetLayout(AValue: TButtonLayout);
|
||||||
|
procedure SetMargin(const AValue: integer);
|
||||||
Procedure SetSpacing(AValue: Integer);
|
Procedure SetSpacing(AValue: Integer);
|
||||||
procedure RealizeKind;
|
procedure RealizeKind;
|
||||||
|
|
||||||
@ -170,6 +172,7 @@ type
|
|||||||
property Glyph: TBitmap read GetGlyph write SetGlyph stored IsGlyphStored;
|
property Glyph: TBitmap read GetGlyph write SetGlyph stored IsGlyphStored;
|
||||||
property Kind: TBitBtnKind read FKind write SetKind default bkCustom;
|
property Kind: TBitBtnKind read FKind write SetKind default bkCustom;
|
||||||
property Layout: TButtonLayout read FLayout write SetLayout default blGlyphLeft;
|
property Layout: TButtonLayout read FLayout write SetLayout default blGlyphLeft;
|
||||||
|
property Margin: integer read FMargin write SetMargin default -1;
|
||||||
property ModalResult;
|
property ModalResult;
|
||||||
property OnChangeBounds;
|
property OnChangeBounds;
|
||||||
property OnClick;
|
property OnClick;
|
||||||
@ -327,6 +330,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.62 2004/03/17 13:10:01 mattias
|
||||||
|
added TBitBtn.Margin
|
||||||
|
|
||||||
Revision 1.61 2004/02/27 00:42:41 marc
|
Revision 1.61 2004/02/27 00:42:41 marc
|
||||||
* Interface CreateComponent splitup
|
* Interface CreateComponent splitup
|
||||||
* Implemented CreateButtonHandle on GTK interface
|
* Implemented CreateButtonHandle on GTK interface
|
||||||
|
@ -25,10 +25,11 @@ begin
|
|||||||
FKind := bkCustom;
|
FKind := bkCustom;
|
||||||
FLayout := blGlyphLeft;
|
FLayout := blGlyphLeft;
|
||||||
FSpacing := 3;
|
FSpacing := 3;
|
||||||
|
fMargin:=-1;
|
||||||
FButtonGlyph := TButtonGlyph.Create;
|
FButtonGlyph := TButtonGlyph.Create;
|
||||||
FButtonGlyph.OnChange := @GlyphChanged;
|
FButtonGlyph.OnChange := @GlyphChanged;
|
||||||
Align := alNone;
|
Align := alNone;
|
||||||
SetInitialBounds(1,1,75,25);
|
SetInitialBounds(0,0,75,25);
|
||||||
RealizeKind;
|
RealizeKind;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -125,6 +126,15 @@ Begin
|
|||||||
CNSendMessage(LM_LAYOUTCHANGED,Self,nil);
|
CNSendMessage(LM_LAYOUTCHANGED,Self,nil);
|
||||||
end;
|
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);
|
Procedure TBitBtn.SetSpacing(AValue: Integer);
|
||||||
Begin
|
Begin
|
||||||
if (FSpacing = AValue) or (AValue < 0) then Exit;
|
if (FSpacing = AValue) or (AValue < 0) then Exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user