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; FLayout: TButtonLayout;
FMargin: integer; FMargin: integer;
FMouseInControl: Boolean; FMouseInControl: Boolean;
FOnMouseEnter: TNotifyEvent;
FOnMouseExit: TNotifyEvent;
FShortcut: TShortCut; FShortcut: TShortCut;
FShowAccelChar: boolean; FShowAccelChar: boolean;
FShowCaption: boolean; FShowCaption: boolean;
@ -279,8 +277,6 @@ type
property ShowCaption: boolean read FShowCaption write SetShowCaption default true; property ShowCaption: boolean read FShowCaption write SetShowCaption default true;
property Spacing: integer read FSpacing write SetSpacing default 4; property Spacing: integer read FSpacing write SetSpacing default 4;
property Transparent: Boolean read FTransparent write SetTransparent default true; property Transparent: Boolean read FTransparent write SetTransparent default true;
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
property OnMouseExit: TNotifyEvent read FOnMouseExit write FOnMouseExit;
end; end;
@ -312,7 +308,7 @@ type
property OnDblClick; property OnDblClick;
property OnMouseDown; property OnMouseDown;
property OnMouseEnter; property OnMouseEnter;
property OnMouseExit; property OnMouseLeave;
property OnMouseMove; property OnMouseMove;
property OnMouseUp; property OnMouseUp;
property OnPaint; property OnPaint;

View File

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