Merged revision(s) 52410 #ba927319a4, 52417 #e657f17f12 from trunk:

IDE, SourceEditor: fixed hints. Mouse can move into hint area. Issue #0030077 / broken by revision 49872 #d5bd14f7ac
........
ide: Normalize path delims of resource items
........

git-svn-id: branches/fixes_1_6@52459 -
This commit is contained in:
maxim 2016-06-08 22:19:18 +00:00
parent 681dde5529
commit 7575d3db56
2 changed files with 25 additions and 22 deletions

View File

@ -194,6 +194,7 @@ begin
if not IDEMacros.SubstituteMacros(Result) then
debugln(['TResourceItem.GetRealFileName failed FileName="', FileName, '"']);
Result := TrimFilename(Result);
ForcePathDelims(Result);
if not FilenameIsAbsolute(Result) then
Result := TrimFilename(AppendPathDelim(ProjectDirectory) + Result);
end;

View File

@ -2003,32 +2003,34 @@ begin
FAutoHideHintTimer.Enabled := False;
if HintIsVisible then begin
Cur := Mouse.CursorPos; // Desktop coordinates
if not IsRectEmpty(FScreenRect) then
hw := CurHintWindow;
OkX := ( (FAutoHintMousePos.x <= hw.Left) and
(Cur.x > FAutoHintMousePos.x) and (Cur.x <= hw.Left + hw.Width)
) or
( (FAutoHintMousePos.x >= hw.Left + hw.Width) and
(Cur.x < FAutoHintMousePos.x) and (Cur.x >= hw.Left)
) or
( (Cur.x >= hw.Left) and (Cur.x <= hw.Left + hw.Width) );
OkY := ( (FAutoHintMousePos.y <= hw.Top) and
(Cur.y > FAutoHintMousePos.y) and (Cur.y <= hw.Top + hw.Height)
) or
( (FAutoHintMousePos.y >= hw.Top + hw.Height) and
(Cur.y < FAutoHintMousePos.y) and (Cur.y >= hw.Top)
) or
( (Cur.y >= hw.Top) and (Cur.y <= hw.Top + hw.Height) );
// Update FAutoHintMousePos, if outside the HintWin, and new CurPos is closer to HintWin
if OkX then FAutoHintMousePos.x := Cur.x;
if OkY then FAutoHintMousePos.y := Cur.y;
if (not IsRectEmpty(FScreenRect)) and PtInRect(FScreenRect, Cur) then
begin
if PtInRect(FScreenRect, Cur) then
// Do not close, if mouse still over the same word, that triggered the hint
Exit;
end else
begin
hw := CurHintWindow;
Cur := Mouse.CursorPos; // Desktop coordinates
OkX := ( (FAutoHintMousePos.x <= hw.Left) and
(Cur.x > FAutoHintMousePos.x) and (Cur.x <= hw.Left + hw.Width)
) or
( (FAutoHintMousePos.x >= hw.Left + hw.Width) and
(Cur.x < FAutoHintMousePos.x) and (Cur.x >= hw.Left)
) or
( (Cur.x >= hw.Left) and (Cur.x <= hw.Left + hw.Width) );
OkY := ( (FAutoHintMousePos.y <= hw.Top) and
(Cur.y > FAutoHintMousePos.y) and (Cur.y <= hw.Top + hw.Height)
) or
( (FAutoHintMousePos.y >= hw.Top + hw.Height) and
(Cur.y < FAutoHintMousePos.y) and (Cur.y >= hw.Top)
) or
( (Cur.y >= hw.Top) and (Cur.y <= hw.Top + hw.Height) );
if OkX then FAutoHintMousePos.x := Cur.x;
if OkY then FAutoHintMousePos.y := Cur.y;
// Do not close if mouse moves towards the hint. Allow mouse to enter hint
OkX := OkX or
( (FAutoHintMousePos.x <= hw.Left + MaxJitter) and
(Cur.x > FAutoHintMousePos.x - MaxJitter) and (Cur.x <= hw.Left + hw.Width + MaxJitter)