int TagEntry::CompareDisplayString(const TagEntryPtr& rhs) const { wxString d1, d2; d1 << GetReturnValue() << wxT(": ") << GetFullDisplayName() << wxT(":") << GetAccess(); d2 << rhs->GetReturnValue() << wxT(": ") << rhs->GetFullDisplayName() << wxT(":") << rhs->GetAccess(); return d1.Cmp(d2); }
void OpenResourceDialog::DoPopulateTags() { bool gotExactMatch(false); // Next, add the tags TagEntryPtrVector_t tags; if(m_userFilters.IsEmpty()) return; m_manager->GetTagsManager()->GetTagsByPartialNames(m_userFilters, tags); for(size_t i = 0; i < tags.size(); i++) { TagEntryPtr tag = tags.at(i); // Filter out non relevanting entries if(!m_filters.IsEmpty() && m_filters.Index(tag->GetKind()) == wxNOT_FOUND) continue; if(!MatchesFilter(tag->GetFullDisplayName())) { continue; } wxString name(tag->GetName()); // keep the fullpath wxDataViewItem item; wxString fullname; if(tag->IsMethod()) { fullname = wxString::Format(wxT("%s::%s%s"), tag->GetScope().c_str(), tag->GetName().c_str(), tag->GetSignature().c_str()); item = DoAppendLine(tag->GetName(), fullname, (tag->GetKind() == wxT("function")), new OpenResourceDialogItemData(tag->GetFile(), tag->GetLine(), tag->GetPattern(), tag->GetName(), tag->GetScope()), DoGetTagImg(tag)); } else { fullname = wxString::Format(wxT("%s::%s"), tag->GetScope().c_str(), tag->GetName().c_str()); item = DoAppendLine(tag->GetName(), fullname, false, new OpenResourceDialogItemData(tag->GetFile(), tag->GetLine(), tag->GetPattern(), tag->GetName(), tag->GetScope()), DoGetTagImg(tag)); } if((m_userFilters.GetCount() == 1) && (m_userFilters.Item(0).CmpNoCase(name) == 0) && !gotExactMatch) { gotExactMatch = true; DoSelectItem(item); } } }
void SymbolsDialog::AddSymbol(const TagEntryPtr &tag, bool sel) { //------------------------------------------------------- // Populate the columns //------------------------------------------------------- wxString line; line << tag->GetLine(); long index = AppendListCtrlRow(m_results); SetColumnText(m_results, index, 0, tag->GetFullDisplayName()); SetColumnText(m_results, index, 1, tag->GetKind()); SetColumnText(m_results, index, 2, tag->GetFile()); SetColumnText(m_results, index, 3, line); SetColumnText(m_results, index, 4, tag->GetPattern()); // list ctrl can reorder items, so use returned index to insert tag m_tags.insert(m_tags.begin()+index, tag); }