Author Topic: patch on Disable the Tooltip when debugging  (Read 6070 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5931
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
patch on Disable the Tooltip when debugging
« 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


If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline rhf

  • Multiple posting newcomer
  • *
  • Posts: 123
Re: patch on Disable the Tooltip when debugging
« Reply #1 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.
« Last Edit: May 29, 2009, 06:51:57 pm by rhf »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5931
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: patch on Disable the Tooltip when debugging
« Reply #2 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. :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5506
Re: patch on Disable the Tooltip when debugging
« Reply #3 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 ?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: patch on Disable the Tooltip when debugging
« Reply #4 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5506
Re: patch on Disable the Tooltip when debugging
« Reply #5 on: May 30, 2009, 11:31:39 pm »
done.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5931
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: patch on Disable the Tooltip when debugging
« Reply #6 on: May 31, 2009, 03:10:19 am »
Wonderful, I feel so excited that this patch has been applied. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5506
Re: patch on Disable the Tooltip when debugging
« Reply #7 on: May 31, 2009, 09:12:18 am »
keep the patches coming ;-)