LCL: TCustomSpeedbutton now uses TControl.OnMouseEnter and TControl.OnMouseLeave from Luiz (bug #9399)

git-svn-id: trunk@11775 -
This commit is contained in:
vincents 2007-08-10 11:02:39 +00:00
parent 4cca6df0e3
commit 2d643365e0
2 changed files with 3 additions and 9 deletions

View File

@ -206,8 +206,6 @@ type
FLayout: TButtonLayout;
FMargin: integer;
FMouseInControl: Boolean;
FOnMouseEnter: TNotifyEvent;
FOnMouseExit: TNotifyEvent;
FShortcut: TShortCut;
FShowAccelChar: boolean;
FShowCaption: boolean;
@ -279,8 +277,6 @@ type
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;
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
property OnMouseExit: TNotifyEvent read FOnMouseExit write FOnMouseExit;
end;
@ -312,7 +308,7 @@ type
property OnDblClick;
property OnMouseDown;
property OnMouseEnter;
property OnMouseExit;
property OnMouseLeave;
property OnMouseMove;
property OnMouseUp;
property OnPaint;

View File

@ -907,14 +907,13 @@ end;
------------------------------------------------------------------------------}
procedure TCustomSpeedButton.MouseEnter;
begin
inherited MouseEnter;
if csDesigning in ComponentState then exit;
if not FMouseInControl
and Enabled and (GetCapture = 0)
then begin
FMouseInControl := True;
UpdateState(true);
if Assigned(FOnMouseEnter) then FOnMouseEnter(Self);
inherited MouseEnter;
end;
end;
@ -926,7 +925,6 @@ end;
------------------------------------------------------------------------------}
procedure TCustomSpeedButton.MouseLeave;
begin
inherited MouseLeave;
if csDesigning in ComponentState then exit;
///DebugLn(['TCustomSpeedButton.MouseLeave ',DbgSName(Self),' FMouseInControl=',FMouseInControl,' FDragging=',FDragging]);
if FMouseInControl
@ -939,7 +937,7 @@ begin
FDragging:=false;
end;
UpdateState(true);
if Assigned(FOnMouseExit) then FOnMouseExit(Self);
inherited MouseLeave;
end;
end;
end;