Author Topic: show debugger tip under curser when ctrl key is pressed  (Read 25204 times)

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: show debugger tip under curser when ctrl key is pressed
« Reply #30 on: August 29, 2011, 04:36:02 pm »
Code
Index: plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- plugins/debuggergdb/debuggergdb.cpp (revision 6903)
+++ plugins/debuggergdb/debuggergdb.cpp (working copy)
@@ -2648,6 +2648,11 @@
     if (!Manager::Get()->GetConfigManager(_T("debugger"))->ReadBool(_T("eval_tooltip"), false))
         return;
 
+    if (!::wxGetKeyState(WXK_CONTROL))  // does not work!!!!!
+        return;
+    //if(! (::GetAsyncKeyState(VK_CONTROL)&0x80))
+    //    return;
+
     EditorBase* base = event.GetEditor();
     cbEditor* ed = base && base->IsBuiltinEditor() ? static_cast<cbEditor*>(base) : 0;
     if (!ed)
Index: sdk/wxscintilla/src/scintilla/src/Editor.cxx
===================================================================
--- sdk/wxscintilla/src/scintilla/src/Editor.cxx (revision 6903)
+++ sdk/wxscintilla/src/scintilla/src/Editor.cxx (working copy)
@@ -5379,7 +5379,10 @@
 }
 
 int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed) {
- DwellEnd(false);
+
+ if (!ctrl)
+    DwellEnd(false);
+
  int modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
         (alt ? SCI_ALT : 0);
  int msg = kmap.Find(key, modifiers);


This patch try to solve the problem, but it failed. when holding the ctrl, the tip show about 0.1 second and disappeared quickly.

any one can help me? thanks.
Good catch!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: show debugger tip under curser when ctrl key is pressed
« Reply #31 on: August 29, 2011, 04:55:21 pm »
A fix for this was committed in r7397 in the debugger's branch.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: show debugger tip under curser when ctrl key is pressed
« Reply #32 on: August 30, 2011, 08:02:47 am »
A fix for this was committed in r7397 in the debugger's branch.
would you like to do some extra enhancement? like the patch here:
hit the ctrl key to show the debug tip
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: show debugger tip under curser when ctrl key is pressed
« Reply #33 on: August 30, 2011, 09:08:18 am »
Yes, my version of this patch is to be committed in some time...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: show debugger tip under curser when ctrl key is pressed
« Reply #34 on: August 30, 2011, 10:04:33 am »
Yes, my version of this patch is to be committed in some time...
No, the rev 7397 only change one file.
But What I said is to use the full patch:
http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0022.5.patch
Such that when you hit the ctrl, the emulated dwell event is sent.
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: show debugger tip under curser when ctrl key is pressed
« Reply #35 on: August 30, 2011, 10:10:37 am »
Yes, my version of this patch is to be committed in some time...
The text in bold probably should have been: "is going to be"
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]