lcl: fix enabled handling of speedbutton (it could enter an endless loop before with repaint bugs #0008689, #0012911)

git-svn-id: trunk@18102 -
This commit is contained in:
paul 2009-01-04 11:26:04 +00:00
parent 0a9b9940a9
commit e04fd0e3a7
2 changed files with 4 additions and 10 deletions

View File

@ -288,7 +288,6 @@ type
procedure SetNumGlyphs(Value: integer);
procedure SetSpacing(const Value: integer);
procedure RealSetText(const Value: TCaption); override;
procedure SetEnabled(NewEnabled: boolean); override;
procedure UpdateState(InvalidateOnChange: boolean); virtual;
function GetDrawDetails: TThemedElementDetails; virtual;
property MouseInControl: Boolean read FMouseInControl;

View File

@ -8,7 +8,7 @@
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
@ -167,12 +167,6 @@ begin
end;
end;
procedure TCustomSpeedButton.SetEnabled(NewEnabled: boolean);
begin
inherited;
UpdateState(true);
end;
{------------------------------------------------------------------------------
Method: TCustomSpeedButton.SetFlat
Params: Value:
@ -181,7 +175,8 @@ end;
------------------------------------------------------------------------------}
procedure TCustomSpeedButton.SetFlat(const Value : boolean);
begin
if FFlat <> Value then begin
if FFlat <> Value then
begin
FFlat := Value;
Invalidate;
end;
@ -935,7 +930,7 @@ end;
procedure TCustomSpeedButton.CMEnabledChanged(var Message: TLMEssage);
Begin
//Should create a new glyph based on the new state
Invalidate;
UpdateState(true);
end;
{------------------------------------------------------------------------------