lcl: TSpeedButton: implemented AutoSize=true

git-svn-id: trunk@34398 -
This commit is contained in:
mattias 2011-12-25 00:05:58 +00:00
parent b8da5fdca9
commit 774703c6a9
2 changed files with 11 additions and 0 deletions

View File

@ -301,6 +301,8 @@ type
function GetNumGlyphs: Integer;
procedure GlyphChanged(Sender: TObject);
function DialogChar(var Message: TLMKey): boolean; override;
procedure CalculatePreferredSize(var PreferredWidth,
PreferredHeight: integer; WithThemeSpace: Boolean); override;
procedure MeasureDraw(Draw: boolean; PaintRect: TRect;
out PreferredWidth, PreferredHeight: integer);
procedure MouseEnter; override;

View File

@ -490,6 +490,15 @@ begin
Result := inherited DialogChar(Message);
end;
procedure TCustomSpeedButton.CalculatePreferredSize(var PreferredWidth,
PreferredHeight: integer; WithThemeSpace: Boolean);
var
r: TRect;
begin
r:=Rect(0,0,0,0);
MeasureDraw(false,r,PreferredWidth,PreferredHeight);
end;
procedure TCustomSpeedButton.MeasureDraw(Draw: boolean;
PaintRect: TRect; out PreferredWidth, PreferredHeight: integer);
var