Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: ollydbg on May 29, 2009, 04:38:18 pm

Title: patch on Disable the Tooltip when debugging
Post by: ollydbg on May 29, 2009, 04:38:18 pm
In this topics, people are discussing the     Usability issues.

http://forums.codeblocks.org/index.php/topic,10154.0.html

Today, When I'm reading and studying CB's source code, I found the Issue 3(I also think this is a quite annoying issue :() can easily be solved like Visual Studio's method. I have tested my patch and it works fine. :D
Quote
Issue 3: Code completion tooltip messing with debugger tooltip

If both tooltips are enabled, trying to see the value of a variable by hovering the pointer on it will display two tooltips, one on top of the other. In all my tests, the code completion tooltip was always on top of the debugger tooltip. Visual Studio solves this issue by completely disabling code completion's tooltip during a debugging session.

See the patch below.
Code
Index: debuggergdb.cpp
===================================================================
--- debuggergdb.cpp (revision 5611)
+++ debuggergdb.cpp (working copy)
@@ -2495,6 +2495,11 @@
     if (!ed)
         return;
 
+//    if (!wxGetKeyState(WXK_CONTROL))
+//        return;
+    if (ed->GetControl()->CallTipActive())
+        ed->GetControl()->CallTipCancel();
+
     int style = event.GetInt();
     if (style != wxSCI_C_DEFAULT && style != wxSCI_C_OPERATOR && style != wxSCI_C_IDENTIFIER)
         return;

By the way, I want to use "CTRL" key while mouse hovering some text to get the ValueTooltip shown.

So, I try to add the code:
Code
+//    if (!wxGetKeyState(WXK_CONTROL))
+//        return;

But it didn't works as I expect. Can you give me some suggestions?

Thanks


Title: Re: patch on Disable the Tooltip when debugging
Post by: rhf on May 29, 2009, 06:43:05 pm
(I also think this is a quite annoying issue :() can easily be solved like Visual Studio's method. I have tested my patch and it works fine. :D
ollydbg,

This problem really annoys me also, and I hope that your patch gets incorporated!

A possible alternative, which may be difficult to implement, is to use the idea in Bug ID 014686. That is, to always display the Debug tooltip below the cursor and the CC display tooltip above it - or vice versa. This way, you would not have to disable code completion's tooltip during a debugging session; but, to be honest, I'm not sure how important the CC tooltip is while debugging.
Title: Re: patch on Disable the Tooltip when debugging
Post by: ollydbg on May 30, 2009, 03:21:01 am
To achieve that, we should calculate the "area" of that tooltips.

Currently, it was a rectangle whose top left point was the mouse pointer.

I found another issue, if the calltooltip string is too long, then it can't be wrapped, and will be truncated by screen. :(
Title: Re: patch on Disable the Tooltip when debugging
Post by: killerbot on May 30, 2009, 09:22:46 am
@other devs : what do you think. It would be best both tooltips are visible, but that is going to take some more work at this time.
I prefer during a debugging session that the debug tooltip should win and the code completion one should loose.

Any objections of implementing this change ?
Title: Re: patch on Disable the Tooltip when debugging
Post by: MortenMacFly on May 30, 2009, 09:02:48 pm
Any objections of implementing this change ?
Not the control key part, but disabling the tooltip. I've already tested it (under Windows) - no objections.
Title: Re: patch on Disable the Tooltip when debugging
Post by: killerbot on May 30, 2009, 11:31:39 pm
done.
Title: Re: patch on Disable the Tooltip when debugging
Post by: ollydbg on May 31, 2009, 03:10:19 am
Wonderful, I feel so excited that this patch has been applied. :D
Title: Re: patch on Disable the Tooltip when debugging
Post by: killerbot on May 31, 2009, 09:12:18 am
keep the patches coming ;-)