mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-21 22:59:27 +02:00
lcl: added showcaption property to TSpeedButton
git-svn-id: trunk@10721 -
This commit is contained in:
parent
7acf6de61a
commit
ce908d7e72
@ -296,9 +296,11 @@ type
|
||||
FMouseInControl: Boolean;
|
||||
FShortcut: TShortCut;
|
||||
FShowAccelChar: boolean;
|
||||
FShowCaption: boolean;
|
||||
FSpacing: integer;
|
||||
FTransparent: Boolean;
|
||||
function GetGlyph: TBitmap;
|
||||
procedure SetShowCaption(const AValue: boolean);
|
||||
procedure UpdateExclusive;
|
||||
procedure SetAllowAllUp(Value: Boolean);
|
||||
procedure SetGlyph(Value: TBitmap);
|
||||
@ -353,8 +355,9 @@ type
|
||||
property Layout: TButtonLayout read FLayout write SetLayout default blGlyphLeft;
|
||||
property Margin: integer read FMargin write SetMargin default -1;
|
||||
property NumGlyphs: Integer read GetNumGlyphs write SetNumGlyphs default 1;
|
||||
property Spacing: integer read FSpacing write SetSpacing default 4;
|
||||
property ShowAccelChar: boolean read FShowAccelChar write SetShowAccelChar default true;
|
||||
property ShowCaption: boolean read FShowCaption write SetShowCaption default true;
|
||||
property Spacing: integer read FSpacing write SetSpacing default 4;
|
||||
property Transparent: Boolean read FTransparent write SetTransparent default true;
|
||||
end;
|
||||
|
||||
@ -391,6 +394,7 @@ type
|
||||
property OnPaint;
|
||||
property OnResize;
|
||||
property OnChangeBounds;
|
||||
property ShowCaption;
|
||||
property ShowHint;
|
||||
property ParentFont;
|
||||
property ParentShowHint;
|
||||
|
@ -51,6 +51,7 @@ begin
|
||||
FMargin := -1;
|
||||
FTransparent := true;
|
||||
Color := clBtnFace;
|
||||
FShowCaption := true;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -379,6 +380,13 @@ begin
|
||||
Result := FGlyph.Glyph;
|
||||
end;
|
||||
|
||||
procedure TCustomSpeedButton.SetShowCaption(const AValue: boolean);
|
||||
begin
|
||||
if FShowCaption=AValue then exit;
|
||||
FShowCaption:=AValue;
|
||||
invalidate;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCustomSpeedButton.GetNumGlyphs
|
||||
Params: none
|
||||
@ -558,7 +566,7 @@ begin
|
||||
end;
|
||||
|
||||
DrawGlyph(Canvas, PaintRect, Offset, FState, Transparent, 0);
|
||||
if Caption <> '' then
|
||||
if FShowCaption and (Caption <> '') then
|
||||
begin
|
||||
TXTStyle := Canvas.TextStyle;
|
||||
TXTStyle.Opaque := False;
|
||||
@ -759,7 +767,7 @@ var
|
||||
TXTStyle: TTextStyle;
|
||||
Flags: Cardinal;
|
||||
begin
|
||||
if Caption <> '' then
|
||||
if FShowCaption and (Caption <> '') then
|
||||
begin
|
||||
TMP := Caption;
|
||||
TXTStyle := Canvas.TextStyle;
|
||||
|
Loading…
Reference in New Issue
Block a user