本文整理汇总了C++中CompilerPtr::SetIsDefault方法的典型用法代码示例。如果您正苦于以下问题:C++ CompilerPtr::SetIsDefault方法的具体用法?C++ CompilerPtr::SetIsDefault怎么用?C++ CompilerPtr::SetIsDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CompilerPtr
的用法示例。
在下文中一共展示了CompilerPtr::SetIsDefault方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnItemActivated
void CompilersFoundDlg::OnItemActivated(wxDataViewEvent& event)
{
CompilerPtr compiler = GetCompiler(event.GetItem());
if(compiler) {
m_defaultCompilers.erase(compiler->GetCompilerFamily());
compiler->SetIsDefault(true);
m_defaultCompilers.insert(std::make_pair(compiler->GetCompilerFamily(), compiler));
m_dataview->UnselectAll();
m_dataview->CallAfter(&wxDataViewCtrl::Refresh, true, (const wxRect*)NULL);
MSWUpdateToolchain(compiler);
}
}
示例2: CompilersFoundDlgBase
CompilersFoundDlg::CompilersFoundDlg(wxWindow* parent, const ICompilerLocator::CompilerVec_t& compilers)
: CompilersFoundDlgBase(parent)
{
m_allCompilers = compilers;
// Replace the model with a custom one
unsigned int colCount = m_dataviewModel->GetColCount();
m_dataviewModel = new MyCompilersFoundModel(this);
m_dataviewModel->SetColCount(colCount);
m_dataview->AssociateModel(m_dataviewModel.get());
// Add the categories
std::map<wxString, wxDataViewItem> categories;
for(size_t i = 0; i < compilers.size(); ++i) {
if(categories.count(compilers.at(i)->GetCompilerFamily()) == 0) {
wxVector<wxVariant> cols;
cols.push_back(compilers.at(i)->GetCompilerFamily());
wxDataViewItem item = m_dataviewModel->AppendItem(wxDataViewItem(0), cols);
categories.insert(std::make_pair(compilers.at(i)->GetCompilerFamily(), item));
}
}
for(size_t i = 0; i < compilers.size(); ++i) {
CompilerPtr compiler = compilers.at(i);
wxDataViewItem parent = categories.find(compiler->GetCompilerFamily())->second;
wxVector<wxVariant> cols;
cols.push_back(compiler->GetName());
cols.push_back(compiler->GetInstallationPath());
m_dataviewModel->AppendItem(parent, cols, new CompilersFoundDlgItemData(compiler));
if(m_defaultCompilers.count(compiler->GetCompilerFamily()) == 0) {
compiler->SetIsDefault(true); // Per family
m_defaultCompilers.insert(std::make_pair(compiler->GetCompilerFamily(), compiler));
MSWUpdateToolchain(compiler);
}
}
std::map<wxString, wxDataViewItem>::iterator iter = categories.begin();
for(; iter != categories.end(); ++iter) {
m_dataview->Expand(iter->second);
}
SetName("CompilersFoundDlg");
WindowAttrManager::Load(this);
}