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
This commit is contained in:
unodgs 2013-08-25 12:06:58 +00:00
parent fa4caceee7
commit a8d393c4b5

View file

@ -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;