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


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

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


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

示例1: switch

void KG3DAnimationContainer::FillAnimationList(CListBox& ListBox, enuFillListBoxType Type)
{
    ListBox.ResetContent();
    LPCTSTR pszName = NULL;
    for(int i = 0; i < static_cast<int>(m_Clips.size()); i++)
    {

        switch(Type)
        {
        case ENUM_FILL_WITH_ANINAME:
        {
            m_Clips[i]->GetName(&pszName);
            ListBox.InsertString(i, pszName);
            ListBox.SetItemData(i, reinterpret_cast<DWORD_PTR>(m_Clips[i]));
            break;
        }
        case ENUM_FILL_WITH_FILENAME:
        {
            m_Clips[i]->GetPathName(&pszName);
            ListBox.InsertString(i, pszName);
            ListBox.SetItemData(i, reinterpret_cast<DWORD_PTR>(m_Clips[i]));
            break;
        }
        }
    }
}
开发者ID:viticm,项目名称:pap2,代码行数:26,代码来源:KG3DAnimationContainer.cpp

示例2: OnInitDialog

BOOL CExpressionTreeDlg::OnInitDialog() {
  __super::OnInitDialog();

  m_treeCtrl.substituteControl(this, IDC_TREE_EXPRESSION);

  m_layoutManager.OnInitDialog(this);
  m_layoutManager.addControl(IDC_TREE_EXPRESSION  , RELATIVE_SIZE );
  m_layoutManager.addControl(IDCLOSE              , RELATIVE_X_POS);
  m_layoutManager.addControl(IDC_CHECKEXTENDEDINFO, RELATIVE_X_POS);
  m_layoutManager.addControl(IDC_LIST_SYMBOLTABLE , RELATIVE_Y_POS | RELATIVE_WIDTH);

  m_treeCtrl.showTree(m_node, m_extendedInfo);

  const String treeFormName = m_expr.getTreeFormName();
  const String stateName    = m_expr.getStateName();
  const int    nodeCount    = m_expr.getNodeCount();

  String title = getWindowText(this);
  title += format(_T(" - %s form - state %s. %d nodes")
                 ,treeFormName.cstr()
                 ,stateName.cstr()
                 ,nodeCount
                 );
  setWindowText(this, title);

  CListBox *lb = (CListBox*)GetDlgItem(IDC_LIST_SYMBOLTABLE);
  const ExpressionVariableArray variables = m_expr.getSymbolTable().getAllVariables();
  for(size_t i = 0; i < variables.size(); i++) {
    const ExpressionVariableWithValue &v = variables[i];
    lb->InsertString(-1, v.toString().cstr());
  }
  return TRUE;
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:33,代码来源:ExpressionTreeDlg.cpp

示例3: OnEditRandom

void CChangeOrderDlg::OnEditRandom() {
  m_editList.shuffle();
  CListBox *lb = getListBox();
  lb->ResetContent();
  for(size_t i = 0; i < m_editList.size(); i++) {
    insertMediaFileIntoListBox(i,m_editList[i]);
  }
  lb->InsertString((int)m_mediaQueue.size(),EMPTYSTRING);
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:9,代码来源:ChangeOrderDlg.cpp

示例4: vPopulateListBox

/**************************************************************************************
    Function Name    :  vPopulateListBox
    Input(s)         :  CListBox& omListBox,const std::list<std::string> lstItems
    Output           :  void
    Functionality    :  Populates ListBox for the given list of string items.
    Member of        :  CExploreMsgSg
    Author(s)        :  Robin G.K.
    Date Created     :  27.10.2015
    Requirement ID   :  RS_FLX_08_09_10
***************************************************************************************/
void CExploreMsgSg::vPopulateListBox(CListBox& omListBox,const std::list<std::string> lstItems)
{
    int nIndex = 0;
    std::string strItem;
for(auto itr:lstItems)
    {
        omListBox.InsertString(nIndex++,itr.c_str());
    }
}
开发者ID:IXXAT-wucherer,项目名称:busmaster,代码行数:19,代码来源:ExploreMsgSg.cpp

示例5: insertMediaFileIntoListBox

void CChangeOrderDlg::insertMediaFileIntoListBox(size_t pos, const MediaFile &f) {
  CListBox *lb = getListBox();
  String tmp = format(_T("%-38.38s%-36.36s%-36.36s")
                     ,f.getTitle()
                     ,f.getArtist()
                     ,f.getAlbum()
                     );
  int ret = lb->InsertString((int)pos, tmp.cstr());
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:9,代码来源:ChangeOrderDlg.cpp

示例6: OnData

LRESULT CQuoteTesterDlg::OnData(WPARAM wParam,LPARAM lParam)
{
	if( wParam == 99 )
	{
		BSTR bstrData = (BSTR)lParam;

		CString strReport( bstrData);

		GetDlgItem(IDC_STATIC_TIME)->SetWindowTextW(strReport); 

		SysFreeString(bstrData);
	
		return 0;
	}
	else if( wParam == 98 )
	{
		BSTR bstrData = (BSTR)lParam;

		CString strReport( bstrData);
	
		CListBox   *pListBox   =   (CListBox *)GetDlgItem(IDC_LIST); 

		pListBox->InsertString(0,strReport);

		SysFreeString(bstrData);
	}
	else if( m_nType == wParam )
	{
		BSTR bstrData = (BSTR)lParam;

		CString strReport( bstrData);
	
		CListBox   *pListBox   =   (CListBox *)GetDlgItem(IDC_LIST); 

		pListBox->InsertString(0,strReport);

		SysFreeString(bstrData);
	
		return 0;
	}
}
开发者ID:weini2,项目名称:Capital,代码行数:41,代码来源:QuoteTesterDlg.cpp

示例7: PopulatePCJList

void CModelPropPage::PopulatePCJList(void)
{
	CListBox *pListBox = (CListBox *) GetDlgItem(IDC_LIST_PCJ);
	if (pListBox)
	{
		pListBox->ResetContent();

		for (int i = 0; i<m_PCJList.size(); i++)
		{
			pListBox->InsertString(-1, (LPCSTR) m_PCJList[i]);
		}
	}
}
开发者ID:DT85,项目名称:Assimilate,代码行数:13,代码来源:Model.cpp

示例8: _refrushList

void xTerrainVegDlg::_refrushList()
{
	CListBox * list = (CListBox *)GetDlgItem(IDC_TV_List);

	while (list->GetCount())
		list->DeleteString(0);

	for (int i = 0; i < MForest::Instance()->GetVegetationCount(); ++i)
	{
		MVegetation * veg = MForest::Instance()->GetVegetation(i);

		list->InsertString(i, veg->Name.c_str());
	}
}
开发者ID:ak4hige,项目名称:myway3d,代码行数:14,代码来源:xTerrainVegDlg.cpp

示例9: OnUpButtonClicked

void CSelectDialog::OnUpButtonClicked() {
	CListBox* chosenList = (CListBox*)GetDlgItem( IDC_CHOSENLIST );
	for ( int i=1; i<chosenList->GetCount(); i++ ) {
		if ( chosenList->GetSel( i ) ) {
			char temp[4000];
			if ( !chosenList->GetSel( i-1 ) ) {
				chosenList->GetText( i, temp );
				chosenList->InsertString( i-1, temp );
				chosenList->SetSel( i-1, TRUE );
				chosenList->DeleteString( i+1 );
			}
		}
	}
}
开发者ID:bklimt,项目名称:QueryWizard,代码行数:14,代码来源:SelectDialog.cpp

示例10: OnDownButtonClicked

void CSelectDialog::OnDownButtonClicked() {
	CListBox* chosenList = (CListBox*)GetDlgItem( IDC_CHOSENLIST );
	for ( int i=chosenList->GetCount()-2; i>=0; i-- ) {
		if ( chosenList->GetSel( i ) ) {
			if ( !chosenList->GetSel( i+1 ) ) {
				char temp[4000];
				chosenList->GetText( i+1, temp );
				chosenList->InsertString( i, temp );
				chosenList->SetSel( i+2, TRUE );
				chosenList->DeleteString( i+2 );
			}
		}
	}
}
开发者ID:bklimt,项目名称:QueryWizard,代码行数:14,代码来源:SelectDialog.cpp

示例11: OnInitDialog

BOOL CChangeOrderDlg::OnInitDialog() {
  m_accelTable = LoadAccelerators(theApp.m_hInstance,MAKEINTRESOURCE(IDR_CHANGEORDER_ACCELERATOR));

  for(size_t i = 0; i < m_mediaQueue.size(); i++) {
    insertMediaFile(i,m_mediaQueue[i]);
  }
  CListBox *lb = getListBox();
  lb->InsertString((int)m_mediaQueue.size(),EMPTYSTRING);
  __super::OnInitDialog();

  gotoToListBox();
  if(!m_mediaQueue.isEmpty()) {
    lb->SetSel(0);
  }
  return false;
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:16,代码来源:ChangeOrderDlg.cpp

示例12: OnDownButton

void CDizzyDialog::OnDownButton() 
{
	UpdateData(true);
	CListBox* pListBox = (CListBox*) GetDlgItem(IDC_INPUT_LIST);
	int iOffset = pListBox->GetCurSel();
	if ((iOffset != LB_ERR) && (iOffset != pListBox->GetCount()-1)) {
		CString strCurrent;
		pListBox->GetText(iOffset, strCurrent);
		pListBox->DeleteString(iOffset);
		iOffset++;
		pListBox->InsertString(iOffset, strCurrent);
		pListBox->SetCurSel(iOffset);
		RecalculateRotation();
	}
	UpdateData(false);
}
开发者ID:Floppy,项目名称:Vapour,代码行数:16,代码来源:DizzyDialog.cpp

示例13: OnInitDialog

BOOL DlgGuardFlags::OnInitDialog() 
{
	CDialog::OnInitDialog();
	CListBox* lb;
	
	lb = (CListBox*)GetDlgItem(IDC_GUARD_FLAGS);

	for(int i = 0; i < GuardBitCount(); i++)
	{
		lb->InsertString(i, guard_bits[i].name);
		lb->SetItemData(i, guard_bits[i].bit);
	}
	
	SetFlags();

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

示例14: 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

示例15: 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


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