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


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

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


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

示例1: GetFlags

int DlgGuardFlags::GetFlags()
{
	CListBox *lb;
	int new_flags = 0;
	
	lb = (CListBox*)GetDlgItem(IDC_GUARD_FLAGS);
	
	for(int i = 0; i < GuardBitCount(); i++) 
	{
		if(lb->GetSel(i))
			SET_BIT(new_flags, lb->GetItemData(i));
		else
			REMOVE_BIT(new_flags, lb->GetItemData(i));
	}

	return new_flags;
}
开发者ID:GalacticSoft,项目名称:DikuEdit,代码行数:17,代码来源:DlgGuardFlags.cpp

示例2: OnKillSocket

void CConnDlg :: OnKillSocket()
{
    CWysApp* pApp = (CWysApp*)AfxGetApp();
    INT iItem;
    CString szTemp;
    SCREENLINE sl;

    // get the current selection
    CWysWnd* pWnd = (CWysWnd*)pApp->m_pMainWnd;
    CListBox* pListBox = (CListBox*)GetDlgItem(IDC_LSTCONN);

    iItem = pListBox->GetCurSel();

    if (iItem == LB_ERR) {
        szTemp.LoadString(IDS_NOSEL);
        this->MessageBox(szTemp, NULL, MB_ICONINFORMATION);
        return;
    }

    // get the socket value
    // for currently selected item
    SOCKET hSocket;
    hSocket = (SOCKET)pListBox->GetItemData(iItem);
    if (hSocket == LB_ERR) {
        szTemp.LoadString(IDS_SOCKERRLST);
        this->MessageBox(szTemp, NULL, MB_ICONINFORMATION);
        return;
    }

    szTemp.LoadString(IDS_KILLSOCK);
    if (this->MessageBox(szTemp, "Kill Connection", MB_ICONQUESTION |
                         MB_YESNO | MB_DEFBUTTON2) == IDYES) {
        CWySock* pSock = (CWySock*)CAsyncSocket::FromHandle(hSocket);
        if (!pSock) {
            szTemp.LoadString(IDS_ERRNOSOCK);
            this->MessageBox(szTemp, NULL, MB_ICONINFORMATION);
            return;
        }

        // add item to screen list
        sl.uColor = COLOR_RED;
        szTemp.LoadString(IDS_SERVKILL);
        sl.szText.Format(szTemp, pSock->IPAddress);
        pWnd->AddListItem(&sl);

        // remove socket from array of connected sockets
        pSock->Close();
        pSock->m_hSocket	= INVALID_SOCKET;
        pSock->State		= FREE;

        //  refresh list
        OnRefresh();
    }
    return;
}
开发者ID:trieck,项目名称:source,代码行数:55,代码来源:ConnDlg.cpp

示例3: OnOK

void CLabelTypeDialog::OnOK()
{
	CListBox* pList;
	if ((pList = (CListBox*)GetDlgItem(IDC_LABEL_LIST)) != NULL)
	{
		int nCurSel = pList->GetCurSel();
		if (nCurSel != -1)
		{
			m_pChosenLabel = (CLabelData*)pList->GetItemData(nCurSel);
		}
	}
	CPmwDialogColor::OnOK();
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:13,代码来源:LABELDLG.CPP

示例4: OnOK

void CEnvelopeTypeDialog::OnOK()
{
	CListBox* pList;
	if ((pList = (CListBox*)GetDlgItem(IDC_ENVELOPE_LIST)) != NULL)
	{
		int nCurSel = pList->GetCurSel();
		if (nCurSel != -1)
		{
			m_pChosenInfo = (CLabelData*)pList->GetItemData(nCurSel);
		}
	}

	CPmwDialogColor::OnOK();
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:14,代码来源:ENVTYPE.CPP

示例5: OnSelchangeLabelList

void CLabelTypeDialog::OnSelchangeLabelList()
{
	CLabelData* pLabelData = NULL;

	CListBox* pList;
	if ((pList = (CListBox*)GetDlgItem(IDC_LABEL_LIST)) != NULL)
	{
		int nCurSel = pList->GetCurSel();
		if (nCurSel != -1)
		{
			pLabelData = (CLabelData*)pList->GetItemData(nCurSel);
		}
	}
	m_pPreview->SetLabel(pLabelData);
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:15,代码来源:LABELDLG.CPP

示例6: OnSelchangeEnvelopeList

void CEnvelopeTypeDialog::OnSelchangeEnvelopeList()
{
	m_pChosenInfo = NULL;

	CListBox* pList;
	if ((pList = (CListBox*)GetDlgItem(IDC_ENVELOPE_LIST)) != NULL)
	{
		int nCurSel = pList->GetCurSel();
		if (nCurSel != -1)
		{
			m_pChosenInfo = (CLabelData*)pList->GetItemData(nCurSel);
		}
	}
	UpdatePreview();
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:15,代码来源:ENVTYPE.CPP

示例7: OnSelchangeServerList

//**************************************************************************
void OPCServerDlg::OnSelchangeServerList()
{
   CWaitCursor wait;
   UpdateData();

   CListBox* pList = (CListBox*)GetDlgItem( IDC_SERVER_LIST );
   int index = pList->GetCurSel();
   OPCServerInfo* pServerInfo = (OPCServerInfo*)pList->GetItemData(index);
   if( pServerInfo && (DWORD)pServerInfo != LB_ERR )
   {
      m_clsid = pServerInfo->m_clsid;
      m_Server = pServerInfo->m_ProgID;
   }

   UpdateData( FALSE );
}
开发者ID:,项目名称:,代码行数:17,代码来源:

示例8: OnSelchangePhotoProjectsList

void CPhotoProjectsTypeDlg::OnSelchangePhotoProjectsList()
{

	CListBox* pList;
	if ((pList = (CListBox*)GetDlgItem(IDC_PHOTOPROJECTS_LIST)) != NULL)
	{
		int nCurSel = pList->GetCurSel();
		if (nCurSel != -1)
		{
			m_pChosenPhotoProject = (CPhotoPrjData*)pList->GetItemData(nCurSel);
		}
	}


	UpdatePreview();
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:16,代码来源:PhPrjDlg.cpp

示例9: OnOK

void CPhotoProjectsTypeDlg::OnOK()
{
	CListBox* pList;
	if ((pList = (CListBox*)GetDlgItem(IDC_PHOTOPROJECTS_LIST)) != NULL)
	{
		int nCurSel = pList->GetCurSel();
		if (nCurSel != -1)
		{
			m_pChosenPhotoProject = (CPhotoPrjData*)pList->GetItemData(nCurSel);

			int nType = nCurSel;
			m_PhotoProjectType = (PHOTO_PROJECT_TYPE)nType;
		}
	}
	CPmwDialogColor::OnOK();
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:16,代码来源:PhPrjDlg.cpp


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