void OpenResourceDialog::DoPopulateList()
{
    wxString name = m_textCtrlResourceName->GetValue();
    name.Trim().Trim(false);
    if(name.IsEmpty()) return;

    Clear();

    wxWindowUpdateLocker locker(m_dataview);

    // First add the workspace files

    // Prepare the user filter
    m_userFilters.Clear();
    m_userFilters = ::wxStringTokenize(name, " \t", wxTOKEN_STRTOK);
    for(size_t i = 0; i < m_userFilters.GetCount(); ++i) {
        m_userFilters.Item(i).MakeLower();
    }

    if(m_checkBoxFiles->IsChecked()) {
        DoPopulateWorkspaceFile();
    }

    if(m_checkBoxShowSymbols->IsChecked()) {
        DoPopulateTags();
    }
}
Ejemplo n.º 2
0
void OpenResourceDialog::DoPopulateList()
{
    wxString name = m_textCtrlResourceName->GetValue();
    name.Trim().Trim(false);
    if(name.IsEmpty()) { return; }

    Clear();

    wxWindowUpdateLocker locker(m_dataview);

    // First add the workspace files
    long nLineNumber;
    wxString modFilter;
    GetLineNumberFromFilter(name, modFilter, nLineNumber);
    name.swap(modFilter);

    m_lineNumber = nLineNumber;

    // Prepare the user filter
    m_userFilters.Clear();
    m_userFilters = ::wxStringTokenize(name, " \t", wxTOKEN_STRTOK);
    for(size_t i = 0; i < m_userFilters.GetCount(); ++i) {
        m_userFilters.Item(i).MakeLower();
    }

    // Build the filter class
    if(m_checkBoxFiles->IsChecked()) { DoPopulateWorkspaceFile(); }
    if(m_checkBoxShowSymbols->IsChecked() && (nLineNumber == -1)) { DoPopulateTags(); }
}
Ejemplo n.º 3
0
void NavBar::OnEditorChanged(wxCommandEvent& e)
{
    e.Skip();
    IEditor* editor = reinterpret_cast<IEditor*>(e.GetClientData());
    if(!editor) {
        return;
    }

    const wxFileName& fn = editor->GetFileName();
    DoPopulateTags(fn);
}
Ejemplo n.º 4
0
void NavBar::OnFileSaved(clCommandEvent& e)
{
    e.Skip();

    // sanity
    if(!ManagerST::Get()->IsWorkspaceOpen()) return;

    // get the active editor
    LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
    if(!editor) return;

    // is this the current file?
    wxFileName fn(e.GetString());
    if(fn != editor->GetFileName()) {
        return;
    }

    // The save was for the active file, re-popuplate the tags in the navigation bar
    DoPopulateTags(fn);
}
Ejemplo n.º 5
0
void NavBar::UpdateScope(TagEntryPtr tag)
{
    size_t sel = m_func->GetSelection();
    if(tag && sel < m_tags.size() && *m_tags[sel] == *tag) return;

    wxWindowUpdateLocker locker(this);

    m_tags.clear();
    m_scope->Clear();
    m_func->Clear();

    if(tag) {
        m_tags.push_back(tag);
        m_scope->AppendString(tag->GetScope());
        m_func->AppendString(tag->GetDisplayName());
        m_scope->SetSelection(0);
        m_func->SetSelection(0);

        DoPopulateTags(DoGetCurFileName());
    }
}
Ejemplo n.º 6
0
void OpenResourceDialog::DoPopulateList()
{
	m_tags.clear();
	wxWindowUpdateLocker locker(this);
	wxArrayString kind;
	Clear();
	if (m_type == TYPE_WORKSPACE_FILE) {
		DoPopulateWorkspaceFile();
		return;

	} else if (m_type == TYPE_CLASS) {

		kind.Add(wxT("class"));
		kind.Add(wxT("struct"));
		kind.Add(wxT("union"));

	} else if ( m_type == TYPE_FUNCTION ) {
		kind.Add(wxT("function"));
		kind.Add(wxT("prototype"));

	} else if ( m_type == TYPE_MACRO) {
		kind.Add(wxT("macro"));

	} else if ( m_type == TYPE_TYPEDEF) {
		kind.Add(wxT("typedef"));

	} else if ( m_type == TYPE_NAMESPACE) {
		kind.Add(wxT("namespace"));

	}

	if (kind.IsEmpty() == false)
		m_manager->GetTagsManager()->GetTagsByKindLimit(m_tags, kind, 150, m_textCtrlResourceName->GetValue());

	DoPopulateTags();
}