BOOL CSetBugTraqAdv::OnInitDialog() { CResizableStandAloneDialog::OnInitDialog(); ExtendFrameIntoClientArea(IDC_DWM); m_aeroControls.SubclassOkCancelHelp(this); std::vector<CBugTraqProvider> providers = CBugTraqAssociations::GetAvailableProviders(); if (providers.empty()) { AfxMessageBox(IDS_ERR_NO_AVAILABLE_BUGTRAQ_PROVIDERS); EndDialog(IDCANCEL); return TRUE; } for (std::vector<CBugTraqProvider>::const_iterator it = providers.begin(); it != providers.end(); ++it) { int index = m_cProviderCombo.AddString(it->name); m_cProviderCombo.SetItemDataPtr(index, new CBugTraqProvider(*it)); } // preselect the right provider in the combo; we can't do this above, because the // combo will sort the entries. if (m_provider_clsid == GUID_NULL) m_cProviderCombo.SetCurSel(0); for (int i = 0; i < m_cProviderCombo.GetCount(); ++i) { CBugTraqProvider *p = (CBugTraqProvider *)m_cProviderCombo.GetItemDataPtr(i); if (p->clsid == m_provider_clsid) { m_cProviderCombo.SetCurSel(i); break; } } m_tooltips.Create(this); UpdateData(FALSE); CheckHasOptions(); AddAnchor(IDC_BUGTRAQWCPATHLABEL, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_BUGTRAQPATH, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_BUGTRAQBROWSE, TOP_RIGHT); AddAnchor(IDC_BUGTRAQPROVIDERLABEL, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_BUGTRAQPROVIDERCOMBO, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_BUGTRAQPARAMETERSLABEL, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_BUGTRAQPARAMETERS, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_OPTIONS, TOP_RIGHT); AddAnchor(IDC_DWM, TOP_LEFT); AddAnchor(IDOK, BOTTOM_RIGHT); AddAnchor(IDCANCEL, BOTTOM_RIGHT); AddAnchor(IDHELP, BOTTOM_RIGHT); EnableSaveRestore(L"SetBugTraqAdvDlg"); return TRUE; }
void CSetBugTraqAdv::OnCbnSelchangeBugtraqprovidercombo() { CheckHasOptions(); }