Hi, all.
In revision 5612, the debuggergdb plugin, OnValueTooltip() will be disabled when a context menu is open.
void DebuggerGDB::OnValueTooltip(CodeBlocksEvent& event){
...
if(ed->IsContextMenuOpened())
{
return;
}
...
I think this can also be applied to code Completion plugin
void CodeCompletion::OnValueTooltip(CodeBlocksEvent& event)
(http://img10.imageshack.us/img10/2783/contextmenu.png)
By ollydbg (http://profile.imageshack.us/user/ollydbg) at 2009-06-16
Any comments?
A convinent way is that when a context menu is open, the editor stop sending Tooltip event.
Any comments?
I've tested this and it works (and makes sense) IMHO. I have put it on my list of changes to CC.
I've done it as follows (shown is just the appropriate code snippet in void CodeCompletion::OnValueTooltip(CodeBlocksEvent& event) as I cannot provide a patch easily):
OLD:
EditorBase* base = event.GetEditor();
cbEditor* ed = base && base->IsBuiltinEditor() ? static_cast<cbEditor*>(base) : 0;
if (!ed)
return;
if (ed->GetControl()->CallTipActive())
ed->GetControl()->CallTipCancel();
NEW:
EditorBase* base = event.GetEditor();
cbEditor* ed = base && base->IsBuiltinEditor() ? static_cast<cbEditor*>(base) : 0;
if (!ed || ed->IsContextMenuOpened())
return;
if (ed->GetControl()->CallTipActive())
ed->GetControl()->CallTipCancel();
I'm thinking that we can disable on cbEditor class
void cbEditor::OnEditorDwellStart(wxScintillaEvent& event)
{
cbStyledTextCtrl* control = GetControl();
int pos = control->PositionFromPoint(wxPoint(event.GetX(), event.GetY()));
int style = control->GetStyleAt(pos);
NotifyPlugins(cbEVT_EDITOR_TOOLTIP, style, wxEmptyString, event.GetX(), event.GetY());
OnScintillaEvent(event);
}
When Dwell starts, we should first check
IsContextMenuOpened()
Am I right?
I tested, and these code works fine. :D
void cbEditor::OnEditorDwellStart(wxScintillaEvent& event)
{
cbStyledTextCtrl* control = GetControl();
int pos = control->PositionFromPoint(wxPoint(event.GetX(), event.GetY()));
int style = control->GetStyleAt(pos);
if(IsContextMenuOpened()==false)
NotifyPlugins(cbEVT_EDITOR_TOOLTIP, style, wxEmptyString, event.GetX(), event.GetY());
OnScintillaEvent(event);
}
Any comments?
Are you aware, that we use exactly the same code in debuggergdb.cpp and codecompletion.cpp OnValueTooltip():
if(ed->GetControl()->CallTipActive())
{
ed->GetControl()->CallTipCancel();
}
That means the it's not clear which function wins and supresses the other.
Are you aware, that we use exactly the same code in debuggergdb.cpp and codecompletion.cpp OnValueTooltip():
if(ed->GetControl()->CallTipActive())
{
ed->GetControl()->CallTipCancel();
}
That means the it's not clear which function wins and supresses t
Oh, Yes, When I'm debugging, there is only "tip" from debuggergdb.
Seems the "tip" from code completion always be canceled. :D
@oBFusCATed
Thanks for the hint. :D
Edit:
// get rid of other calltips (if any) [for example the code completion one, at this time we
// want the debugger value call/tool-tip to win and be shown]
if(ed->GetControl()->CallTipActive())
{
ed->GetControl()->CallTipCancel();
}
This code in debuggergdb was added in r5614.
I think we should find another way to disable CC's tip when debugging.