View unanswered posts | View active topics

Reply to topic  [ 2 posts ] 
MethodCallTip Placement 
Author Message

Joined: Thu Feb 02, 2012 5:59 pm
Posts: 78
Location: Alabama
Reply with quote

You mentioned how the NavigationBar extension made the Tip display too far down. I took some time to investigate and I believe the PostionControl method has been overcompensating.

The process of translating the text location to a screen coordinate then back to a point relative to the MainForm should be enough to properly position the Tip. Offsetting the Tip with the values of sci.Top and sci.Left is unnecessary.

I've tested this change with and without the NavigationBar and the Tip seems to be in the correct place both ways. Removing the offset of sci.Left resolves the same sort of issue when the EditorMiniMap is set to show on the Left side of the sci control.


Index: Controls/MethodCallTip.cs
--- Controls/MethodCallTip.cs   (revision 2218)
+++ Controls/MethodCallTip.cs   (working copy)
@@ -96,10 +96,10 @@
             // compute control location
             Point p = new Point(sci.PointXFromPosition(memberPos), sci.PointYFromPosition(memberPos));
             p = ((Form)PluginBase.MainForm).PointToClient(((Control)sci).PointToScreen(p));
-            toolTip.Left = p.X + sci.Left;
+            toolTip.Left = p.X;
             bool hasListUp = !CompletionList.Active || CompletionList.listUp;
-            if (currentLine > sci.LineFromPosition(memberPos) || !hasListUp) toolTip.Top = p.Y - toolTip.Height + sci.Top;
-            else toolTip.Top = p.Y + UITools.Manager.LineHeight(sci) + sci.Top;
+            if (currentLine > sci.LineFromPosition(memberPos) || !hasListUp) toolTip.Top = p.Y - toolTip.Height;
+            else toolTip.Top = p.Y + UITools.Manager.LineHeight(sci);
             // Keep on control area
             if (toolTip.Right > ((Form)PluginBase.MainForm).ClientRectangle.Right)

Wed Mar 21, 2012 2:37 am
Profile WWW

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
Fix committed.

Tue Mar 27, 2012 3:20 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.