当前位置: 首页>>代码示例>>C++>>正文


C++ CListBox::GetSelCount方法代码示例

本文整理汇总了C++中CListBox::GetSelCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CListBox::GetSelCount方法的具体用法?C++ CListBox::GetSelCount怎么用?C++ CListBox::GetSelCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CListBox的用法示例。


在下文中一共展示了CListBox::GetSelCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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]);
		}
	}
}
开发者ID:KingLebron,项目名称:safmq,代码行数:14,代码来源:GroupAddDialog.cpp

示例2: 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;
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:14,代码来源:ChangeOrderDlg.cpp

示例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;
}
开发者ID:eaudeweb,项目名称:naaya,代码行数:47,代码来源:PortalAdministrativePage.cpp

示例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;
}
开发者ID:eSDK,项目名称:esdk_elte,代码行数:17,代码来源:CreatePatchGroupDlg.cpp

示例5: OnButtonUp

void CSaveMovieDialog::OnButtonUp()
{
	CListBox * pListBox = (CListBox *)GetDlgItem(IDC_LIST_BITMAP_FILENAME);
	if ( pListBox->GetSelCount() != 1 )
		return;

	if ( pListBox->GetCurSel() <= 0 )
		return;

	int sel = pListBox->GetCurSel();
	CString currentText;
	pListBox->GetText (sel, currentText );
	pListBox->InsertString(sel-1 , currentText);
	pListBox->DeleteString(sel+1);

	pListBox->SetSel(sel-1, TRUE);
}
开发者ID:AnthonyNystrom,项目名称:GenXSource,代码行数:17,代码来源:SaveMovieDialog.cpp


注:本文中的CListBox::GetSelCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。