started OnMouseEnter and OnMouseLeave

git-svn-id: trunk@2503 -
This commit is contained in:
mattias 2002-08-17 23:41:25 +00:00
parent db65741e11
commit c8030a05a7

View File

@ -1,3 +1,5 @@
// included by buttons.pp
{****************************************************************************** {******************************************************************************
TSpeedButton TSpeedButton
****************************************************************************** ******************************************************************************
@ -486,7 +488,6 @@ var
NewState: TButtonState; NewState: TButtonState;
begin begin
inherited MouseMove(Shift, X, Y); inherited MouseMove(Shift, X, Y);
if csDesigning in ComponentState then exit; if csDesigning in ComponentState then exit;
if FDragging if FDragging
@ -513,12 +514,9 @@ begin
end; end;
end end
else begin else begin
Assert(False,'Trace:FDragging is False'); {if not FMouseInControl then begin
if not FMouseInControl
then begin
Assert(False,'Trace:FMouseInControl is false');
UpdateTracking; UpdateTracking;
end; end;}
end; end;
end; end;
@ -548,7 +546,7 @@ begin
SetDown(not FDown); SetDown(not FDown);
if FDown then Repaint; if FDown then Repaint;
end; end;
UpdateTracking; //UpdateTracking;
end; end;
inherited MouseUp(Button, Shift, X, Y); inherited MouseUp(Button, Shift, X, Y);
end; end;
@ -621,8 +619,8 @@ procedure TSpeedButton.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
UpdateTracking; //UpdateTracking;
Repaint; Invalidate;
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -634,14 +632,13 @@ end;
procedure TSpeedButton.CMMouseEnter(var Message :TLMessage); procedure TSpeedButton.CMMouseEnter(var Message :TLMessage);
begin begin
inherited CMMouseEnter(Message); inherited CMMouseEnter(Message);
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;
RePaint; Invalidate;
end; end;
end; end;
@ -654,10 +651,9 @@ end;
procedure TSpeedButton.CMMouseLeave(var Message :TLMessage); procedure TSpeedButton.CMMouseLeave(var Message :TLMessage);
begin begin
inherited CMMouseLeave(Message); inherited CMMouseLeave(Message);
if csDesigning in ComponentState then exit; if csDesigning in ComponentState then exit;
if FMouseInControl if FMouseInControl
and Enabled and not FDragging and Enabled and not FDragging
then begin then begin
FMouseInControl := False; FMouseInControl := False;
@ -671,9 +667,15 @@ end;
{$C-} {$C-}
{$ENDIF} {$ENDIF}
// included by buttons.pp
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.31 2002/11/21 18:49:53 mattias
started OnMouseEnter and OnMouseLeave
Revision 1.30 2002/09/27 20:52:23 lazarus Revision 1.30 2002/09/27 20:52:23 lazarus
MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com> MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com>