diff --git a/lcl/buttons.pp b/lcl/buttons.pp index bbf7339cc2..bd3619a2d1 100644 --- a/lcl/buttons.pp +++ b/lcl/buttons.pp @@ -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 diff --git a/lcl/include/bitbtn.inc b/lcl/include/bitbtn.inc index 1f81c0d19e..20f09c45af 100644 --- a/lcl/include/bitbtn.inc +++ b/lcl/include/bitbtn.inc @@ -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;