From de493823049bcf0f253549ab353ddf1f9bd8969f Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 20 Jul 2006 19:00:48 +0000 Subject: [PATCH] Change cursor shape from "beam" to "hand" when hovering over "mouse link" in source editor. from Alexander Klenin git-svn-id: trunk@9640 - --- components/synedit/synedit.pp | 41 +++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index f133e31684..b9eb29ca29 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -2376,20 +2376,21 @@ var Z: integer; begin inherited MouseMove(Shift, x, y); - {$IFDEF SYN_LAZARUS} - LastMouseCaret:=PixelsToRowColumn(Point(X,Y)); - {$ENDIF} if (X >= fGutterWidth) and (X < ClientWidth{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF}) and (Y >= 0) and (Y < ClientHeight{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF}) then begin - If Cursor <> crIBeam then + if Cursor <> crHandPoint then Cursor := crIBeam; - end else - If Cursor <> crDefault then - Cursor := crDefault; + end + else + Cursor := crDefault; + + {$IFDEF SYN_LAZARUS} + LastMouseCaret:=PixelsToRowColumn(Point(X,Y)); + {$ENDIF} //debugln('TCustomSynEdit.MouseMove sfWaitForDragging=',dbgs(sfWaitForDragging in fStateFlags),' MouseCapture=',dbgs(MouseCapture),' GetCaptureControl=',DbgSName(GetCaptureControl)); if MouseCapture @@ -6844,6 +6845,15 @@ end; {$IFDEF SYN_LAZARUS} procedure TCustomSynEdit.UpdateCtrlMouse; + + procedure doNotShowLink; + begin + if fLastCtrlMouseLinkY>0 then begin + Invalidate; + Cursor := crIBeam; + end; + end; + var NewY, NewX1, NewX2: integer; begin @@ -6860,19 +6870,12 @@ begin or (NewX2<>fLastCtrlMouseLinkX2) then begin Invalidate; + Cursor := crHandPoint; end; - end else begin - // there is no link -> do not show link - if fLastCtrlMouseLinkY>0 then begin - Invalidate; - end; - end; - end else begin - // do not show link - if fLastCtrlMouseLinkY>0 then begin - Invalidate; - end; - end; + end else + doNotShowLink // there is no link + end else + doNotShowLink; end; {$ENDIF}