void cbStyledTextCtrl::OnKillFocus(wxFocusEvent& event)
{
    // cancel auto-completion list when losing focus
    if ( AutoCompActive() )
        AutoCompCancel();

    if ( CallTipActive() )
        CallTipCancel();

    event.Skip();
}
Exemplo n.º 2
0
void DisassemblyTextCtrl::OnKillFocus(wxFocusEvent& event)
{
    // cancel auto-completion list when losing focus
    if (AutoCompActive())
    {
        AutoCompCancel();
    }
    if (CallTipActive())
    {
        CallTipCancel();
    }
    event.Skip();
} // end of OnKillFocus
Exemplo n.º 3
0
	void OnHotSpotClick(wxScintillaEvent &event) {
		AutoCompCancel();
		CallTipCancel();

		wxPoint clientPos = PointFromPosition(event.GetPosition());
		wxPoint screenPos = ClientToScreen(clientPos);
		int lineHeight = TextHeight(LineFromPosition(event.GetPosition()));

		CloseWatch();
		m_watch = new OneVariableWatchView(
			this, event.GetText(),
			wxPoint(screenPos.x - 50, screenPos.y + lineHeight), 
			wxSize(100, 400));
		m_watch->Show();
	}
Exemplo n.º 4
0
/* TextEditor::onFocusLoss
 * Called when the text editor loses focus
 *******************************************************************/
void TextEditor::onFocusLoss(wxFocusEvent& e)
{
	// Hide calltip+autocomplete box
	hideCalltip();
	AutoCompCancel();

	// Hide current line marker
	MarkerDeleteAll(1);
	MarkerDeleteAll(2);

	// Clear word matches
	SetIndicatorCurrent(8);
	IndicatorClearRange(0, GetTextLength());
	prev_word_match = "";

	e.Skip();
}
Exemplo n.º 5
0
/* TextEditor::onFocusLoss
 * Called when the text editor loses focus
 *******************************************************************/
void TextEditor::onFocusLoss(wxFocusEvent& e)
{
	CallTipCancel();
	AutoCompCancel();
}
Exemplo n.º 6
0
void ctlSQLBox::OnKillFocus(wxFocusEvent &event)
{
	AutoCompCancel();
	event.Skip();
}
Exemplo n.º 7
0
void CodeEdit::StartAutoCompletion(const wxString& token)
{

    wxASSERT(m_autoCompleteManager != NULL);

    wxString items;

    // Get the actual prefix of the thing we're trying to match for autocompletion.
    // If the token refers to a member, the prefix is the member name.

    wxString prefix;
    wxString newToken;
    bool member = false;
    bool function = false;

    if (GetLexer() == wxSTC_LEX_LUA)
    {

        int end1 = token.Find('.', true);

        if (end1 == wxNOT_FOUND)
        {
            end1 = 0;
        }
        else
        {
            // Skip the '.' character.
            ++end1;
            member = true;
        }

        int end2 = token.Find(':', true);

        if (end2 == wxNOT_FOUND)
        {
            end2 = 0;
        }
        else
        {
            // Skip the ':' character.
            ++end2;
            member = true;
        }

        int end = std::max(end1, end2);
        newToken = token.Right(token.Length() - end);
        prefix = token.Left(end - 1);

        if (end != 0 && token[end - 1] == ':')
          function = true;
    }
    else
    {
        // No autocompletion when using the default lexer.
        return;
    }

    if (!member && newToken.Length() < m_minAutoCompleteLength)
    {
        // Don't pop up the auto completion if the user hasn't typed in very
        // much yet.
        return;
    }

    wxVector<wxString> prefixes;

    m_autoCompleteManager->ParsePrefix(prefix, file, GetCurrentLine(), prefixes);
    m_autoCompleteManager->GetMatchingItems(newToken, prefixes, member, function, items);

    if (!AutoCompActive() || m_autoCompleteItems != items)
    {

        // Remember the items in the list so that we don't redisplay the list
        // with the same set of items (reduces flickering).
        m_autoCompleteItems = items;

        if (!items.IsEmpty())
        {
            // Show the autocomplete selection list.
          AutoCompShow(newToken.Length(), items);
        }
        else
        {
            // We have no matching items, so hide the autocompletion selection.
            AutoCompCancel();
        }

    }

}
Exemplo n.º 8
0
void CodeEdit::OnKillFocus(wxFocusEvent& event)
{
    AutoCompCancel();
    HideToolTip();
    event.Skip();
}