本文整理汇总了C++中CListBox::GetSelItems方法的典型用法代码示例。如果您正苦于以下问题:C++ CListBox::GetSelItems方法的具体用法?C++ CListBox::GetSelItems怎么用?C++ CListBox::GetSelItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CListBox
的用法示例。
在下文中一共展示了CListBox::GetSelItems方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getSelected
void CChangeOrderDlg::getSelected(CompactIntArray &selected) {
CListBox *lb = getListBox();
int count = lb->GetSelCount();
int *items = new int[count];
lb->GetSelItems(count,items);
selected.clear();
for(int i = 0; i < count; i++) {
if(items[i] == lb->GetCount() - 1) {
continue; // never select the last empty String
}
selected.add(items[i]);
}
delete[] items;
}
示例2: BuildAndRemoveSelected
void CGroupAddDialog::BuildAndRemoveSelected(CListBox& lb, std::vector<std::string>& str)
{
str.clear();
int selcnt = lb.GetSelCount();
if (selcnt) {
int *sels = new int[selcnt];
lb.GetSelItems(selcnt, sels);
for(int x=selcnt -1; x >= 0; --x) {
str.push_back(lb.GetText(sels[x]));
lb.DeleteString(sels[x]);
}
}
}
示例3: OnWizardNext
LRESULT CPortalAdministrativePage::OnWizardNext()
{
CWizardData* pWizardData = ((CCHM2Dlg*)GetParent())->m_pWizardData;
CWizardToolz toolz;
CString strPortalURL, strMailServerName, strMailServerPort, strDefaultFromAddress;
int nMailServerPort, nCount;
// load data from controls
//GetDlgItem(IDC_PORTAL_URL)->GetWindowText(strPortalURL);
GetDlgItem(IDC_PORTAL_MAILSERVERNAME)->GetWindowText(strMailServerName);
GetDlgItem(IDC_PORTAL_MAILSERVERPORT)->GetWindowText(strMailServerPort);
GetDlgItem(IDC_PORTAL_DEFAULTFROMADDRESS)->GetWindowText(strDefaultFromAddress);
CListBox* lstLanguages = (CListBox*)GetDlgItem(IDC_PORTAL_LANGUAGES);
nCount = lstLanguages->GetSelCount();
pWizardData->m_arrLanguagesSel.RemoveAll();
pWizardData->m_arrLanguagesSel.SetSize(nCount);
lstLanguages->GetSelItems(nCount, pWizardData->m_arrLanguagesSel.GetData());
// verify that all fields have been filled
if (strMailServerName == "" || strMailServerPort == "" || strDefaultFromAddress == "")
{
AfxMessageBox(IDS_REQUIREDFIELDS);
return -1;
}
// convert to numbers
nMailServerPort = atoi(strMailServerPort);
// verify ports values
// check that the ports are free at the time of installation
if (nMailServerPort < 1 || nMailServerPort > 65535)
{
AfxMessageBox(CRString(IDS_MAILSERVERPORT_INVALID));
return -1;
}
// store data in wizard data
pWizardData->m_strPortalURL = strPortalURL;
pWizardData->m_strMailServerName = strMailServerName;
pWizardData->m_nMailServerPort = nMailServerPort;
pWizardData->m_strDefaultFromAddress = strDefaultFromAddress;
return 0;
}
示例4: OnBnClickedButtonDelgroup
void CCreatePatchGroupDlg::OnBnClickedButtonDelgroup()
{
// TODO: Add your control notification handler code here
CListBox* pList = (CListBox*)GetDlgItem(IDC_LIST_GROUPLIST);
int nMaxItems = pList->GetSelCount();
LPINT rgIndex = new INT[nMaxItems];
memset(rgIndex, 0, sizeof(INT)*nMaxItems);
pList->GetSelItems(nMaxItems, rgIndex);
for (int i=0; i<nMaxItems; i++)
{
pList->DeleteString(rgIndex[i]-i);
}
delete []rgIndex;
}