From a8d393c4b5a231da48340a4faf51dfddc2ce95bf Mon Sep 17 00:00:00 2001 From: unodgs Date: Sun, 25 Aug 2013 12:06:58 +0000 Subject: [PATCH] GridCtrl: Fixed live cursor not disappearing when mouse moves outside control view, fixed live cursor not changing row when mouse enters child control git-svn-id: svn://ultimatepp.org/upp/trunk@6268 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/GridCtrl/GridCtrl.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/uppsrc/GridCtrl/GridCtrl.cpp b/uppsrc/GridCtrl/GridCtrl.cpp index f55c75509..8d8fe8deb 100644 --- a/uppsrc/GridCtrl/GridCtrl.cpp +++ b/uppsrc/GridCtrl/GridCtrl.cpp @@ -2472,6 +2472,18 @@ void GridCtrl::ChildAction(Ctrl *child, int event) WhenCtrlAction(); } } + + if(event == MOUSEMOVE) + { + if(live_cursor) + { + Point p = GetMouseViewPos(); + if(IsMouseBody(p)) + SetCursor0(p, CU_MOUSE | CU_HIGHLIGHT); + else + SetCursor0(-1, -1, CU_HIGHLIGHT); + } + } } void GridCtrl::ChildMouseEvent(Ctrl *child, int event, Point p, int zdelta, dword keyflags) @@ -3410,7 +3422,7 @@ GridCtrl::CurState GridCtrl::SetCursor0(Point p, int opt, int dirx, int diry) else tmpcur = p; - if(dirx == 0 && diry == 0 && !IsValidCursor(tmpcur)) + if(!highlight && dirx == 0 && diry == 0 && !IsValidCursor(tmpcur)) { cs.valid = false; return cs; @@ -5710,7 +5722,7 @@ void GridCtrl::SwapDown(int cnt) void GridCtrl::MouseLeave() { - if(live_cursor) + if(live_cursor && !HasMouseDeep()) SetCursor0(-1, -1, CU_HIGHLIGHT); UpdateHighlighting(GS_BORDER, Point(0, 0)); oldSplitCol = -1;