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 SetNumGlyphs(Value: integer);
procedure SetSpacing(const Value: integer); procedure SetSpacing(const Value: integer);
procedure RealSetText(const Value: TCaption); override; procedure RealSetText(const Value: TCaption); override;
procedure SetEnabled(NewEnabled: boolean); override;
procedure UpdateState(InvalidateOnChange: boolean); virtual; procedure UpdateState(InvalidateOnChange: boolean); virtual;
function GetDrawDetails: TThemedElementDetails; virtual; function GetDrawDetails: TThemedElementDetails; virtual;
property MouseInControl: Boolean read FMouseInControl; property MouseInControl: Boolean read FMouseInControl;

View File

@ -167,12 +167,6 @@ begin
end; end;
end; end;
procedure TCustomSpeedButton.SetEnabled(NewEnabled: boolean);
begin
inherited;
UpdateState(true);
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
Method: TCustomSpeedButton.SetFlat Method: TCustomSpeedButton.SetFlat
Params: Value: Params: Value:
@ -181,7 +175,8 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TCustomSpeedButton.SetFlat(const Value : boolean); procedure TCustomSpeedButton.SetFlat(const Value : boolean);
begin begin
if FFlat <> Value then begin if FFlat <> Value then
begin
FFlat := Value; FFlat := Value;
Invalidate; Invalidate;
end; end;
@ -935,7 +930,7 @@ end;
procedure TCustomSpeedButton.CMEnabledChanged(var Message: TLMEssage); procedure TCustomSpeedButton.CMEnabledChanged(var Message: TLMEssage);
Begin Begin
//Should create a new glyph based on the new state //Should create a new glyph based on the new state
Invalidate; UpdateState(true);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------