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


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

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


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

示例1: BuildSearchList

void CDlgReplaceBox::BuildSearchList()
{
	// Build the list box
	CListBox* theListBox = (CListBox*) GetDlgItem( FINDGET_LIST );
	theListBox->ResetContent();

	// Ensure the string is in Lower case for searching
	m_search_string.MakeLower();

	CLibraryCollection::FillMatchingSymbols( theListBox, m_search_string, NULL );

	// Try and find the selected symbol in the list
	int i;
	for (i = 0; i < theListBox->GetCount(); i++)
	{
		if (theListBox->GetItemDataPtr( i ) == m_Symbol)
		{
			theListBox->SetCurSel( i );
			break;
		}
	}
	if (i == theListBox->GetCount())
	{
		m_Symbol = NULL;
		GetDlgItem( IDC_SHOW_SYMBOL )->RedrawWindow();
	}
}
开发者ID:saranyan,项目名称:tinycad_graph_matching,代码行数:27,代码来源:DlgReplaceBox.cpp

示例2: OnBnClickedSend

void CNewsHubDlg::OnBnClickedSend()
{
  CListBox* pRunningClients = (CListBox*)GetDlgItem(IDC_RUNNING_CLIENTS);

  int row = pRunningClients->GetCurSel();
  if (row == LB_ERR)
  {
    MessageBox(_T("Please select one of running clients to send message through"), _T("No client selected"), MB_OK);
    return;
  }

  CEdit* pMessage = (CEdit*)GetDlgItem(IDC_MESSAGE);
  CString message;
  pMessage->GetWindowText(message);

  ClientLoop* clientLoop = (ClientLoop*)pRunningClients->GetItemDataPtr(row);
  unsigned int messageId = clientLoop->nextMessageId();
  clientLoop->Queue()->AddMessage(messageId, std::string(CT2CA(message)));

  CListBox* pSentMessages = (CListBox*)GetDlgItem(IDC_SENT_MESSAGES);
  NewsHub::TcpClient* tcpClient = (NewsHub::TcpClient*)clientLoop->Client();
  CString str;
  str.Format(_T("(To: %s:%d msgId:%d): %s"), 
    CString(tcpClient->Host().c_str()), tcpClient->Port(), messageId, message);

  row = pSentMessages->AddString(str);

  MessageInfo* messageInfo = new MessageInfo;
  messageInfo->queue = clientLoop->Queue();
  messageInfo->messageId = messageId;
  pSentMessages->SetItemDataPtr(row, messageInfo);

  pSentMessages->SetCurSel(row);
}
开发者ID:rushad,项目名称:newshub,代码行数:34,代码来源:newshubuiDlg.cpp

示例3: OnSelchangeList

void CDlgReplaceBox::OnSelchangeList() 
{
	CListBox*	theListBox 	= (CListBox*) GetDlgItem( FINDGET_LIST );
	int			WhichItem 	= theListBox->GetCurSel();

 	if (WhichItem != LB_ERR)
	{
		m_Symbol = static_cast<CLibraryStoreSymbol *>(theListBox->GetItemDataPtr( WhichItem ));
		GetDlgItem( IDC_SHOW_SYMBOL )->RedrawWindow();
	}		
}
开发者ID:saranyan,项目名称:tinycad_graph_matching,代码行数:11,代码来源:DlgReplaceBox.cpp

示例4: OnBnClickedServerFinish

void CNewsHubDlg::OnBnClickedServerFinish()
{
  CListBox* pRunningServers = (CListBox*)GetDlgItem(IDC_RUNNING_SERVERS);
  
  int row = pRunningServers->GetCurSel();
  if (row != LB_ERR)
  {
    ServerLoop* serverLoop = (ServerLoop*)pRunningServers->GetItemDataPtr(row);
    delete serverLoop;
    pRunningServers->DeleteString(row);
  }
}
开发者ID:rushad,项目名称:newshub,代码行数:12,代码来源:newshubuiDlg.cpp

示例5: onClose

void CNewsHubDlg::onClose()
{
  CListBox* pRunningServers = (CListBox*)GetDlgItem(IDC_RUNNING_SERVERS);
  for (int i = 0; i < pRunningServers->GetCount(); ++i)
  {
    ServerLoop* serverLoop = (ServerLoop*)pRunningServers->GetItemDataPtr(i);
    delete serverLoop;
  }

  CListBox* pRunningClients = (CListBox*)GetDlgItem(IDC_RUNNING_CLIENTS);
  for (int i = 0; i < pRunningClients->GetCount(); ++i)
  {
    ClientLoop* clientLoop = (ClientLoop*)pRunningClients->GetItemDataPtr(i);
    delete clientLoop;
  }

  CListBox* pSentMessages = (CListBox*)GetDlgItem(IDC_SENT_MESSAGES);
  for (int i = 0; i < pSentMessages->GetCount(); ++i)
  {
    MessageInfo* messageInfo = (MessageInfo*)pSentMessages->GetItemDataPtr(i);
    delete messageInfo;
  }
}
开发者ID:rushad,项目名称:newshub,代码行数:23,代码来源:newshubuiDlg.cpp

示例6: GetActiveBridge

bool CFanmotorDlg::GetActiveBridge(CString& BridgeID)
{
    CListBox* listBoxBridges = (CListBox*)GetDlgItem(IDC_BRIDGE_LISTBOX);
    listBoxBridges->SetCurSel(0);
	BridgeID = L"";
	if (listBoxBridges->GetCurSel() < 0) 
	{
		DisplayInforMessageBox((LPCWSTR)L"Error", L"Select Active BRIDGE!");
		return false;
	}
    CBridgeInfo* bridgeInfo = (CBridgeInfo*)listBoxBridges->GetItemDataPtr(listBoxBridges->GetCurSel());
	BridgeID = bridgeInfo->BridgeID;
	return true;
}
开发者ID:ChenChengCC,项目名称:test2,代码行数:14,代码来源:FanmotorDlg.cpp

示例7: MessageDelivered

void CNewsHubDlg::MessageDelivered(NewsHub::ClientQueueThreadLoop* queue, const NewsHub::Socket & socket, const unsigned int messageId, const std::string & message)
{
  CListBox* pSentMessages = (CListBox*)GetDlgItem(IDC_SENT_MESSAGES);
  for (int i = 0; i < pSentMessages->GetCount(); ++i)
  {
    MessageInfo* messageInfo = (MessageInfo*)pSentMessages->GetItemDataPtr(i);
    if ((messageInfo->queue == queue) && (messageInfo->messageId == messageId))
    {
      CString str;
      pSentMessages->GetText(i, str);
      pSentMessages->DeleteString(i);
      pSentMessages->InsertString(i, str + _T(": Delivered"));
      pSentMessages->SetItemDataPtr(i, messageInfo);
      pSentMessages->SetCurSel(i);
      break;
    }
  }
}
开发者ID:rushad,项目名称:newshub,代码行数:18,代码来源:newshubuiDlg.cpp

示例8: RemoveBridgeEvent

void CFanmotorDlg::RemoveBridgeEvent(BSTR BridgeID)
{
	int i;
	CListBox* listBoxBridges = (CListBox*)GetDlgItem(IDC_BRIDGE_LISTBOX);
	CBridgeInfo* bridgeInfo = NULL;
	
	for (i=0; i<listBoxBridges->GetCount(); i++)
	{
		bridgeInfo = (CBridgeInfo*)listBoxBridges->GetItemDataPtr(i);
		if (bridgeInfo->BridgeID == BridgeID) break;
	}
	if (i == listBoxBridges->GetCurSel())
	{
		CListBox* listBoxDevices = (CListBox*)GetDlgItem(IDC_DEVICE_LISTBOX);
		listBoxDevices->ResetContent();
//		ResetPowerSettings();
//		ResetSpeedSettings();
	}
	if ((i>=0)&&(i<=listBoxBridges->GetCount()))
	{
		delete bridgeInfo;
		listBoxBridges->DeleteString(i);
	}
}
开发者ID:ChenChengCC,项目名称:test2,代码行数:24,代码来源:FanmotorDlg.cpp


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