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


C++ CWndListBox::ResetContent方法代码示例

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


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

示例1: OnInitialUpdate

void CWndSelectCh::OnInitialUpdate() 
{ 
	CWndNeuz::OnInitialUpdate(); 
	
	// 여기에 코딩하세요
#ifdef __CASH_AREA
	CWndListBox* pWndListBox = (CWndListBox*)GetDlgItem( WIDC_LB_CHANNEL );
#else
	CWndListBox* pWndListBox = (CWndListBox*)GetDlgItem( WIDC_LISTBOX1 );
#endif
	pWndListBox->ResetContent();
	CString strTitle;
	for(int i=0; i < m_nChCount; ++i)
	{
		strTitle.Format( "%s	%d", prj.GetText(TID_GAME_CHAR_SERVERNAME), i+1);
		pWndListBox->AddString(strTitle);
	}

#ifdef __CASH_AREA
	pWndListBox = (CWndListBox*)GetDlgItem( WIDC_LB_WORLD );
	pWndListBox->ResetContent();
	pWndListBox->AddString( m_str );
#endif

	// 윈도를 중앙으로 옮기는 부분.
	CRect rectRoot = m_pWndRoot->GetLayoutRect();
	CRect rectWindow = GetWindowRect();
	CPoint point( rectRoot.right - rectWindow.Width(), 110 );
	Move( point );
	MoveParentCenter();
} 
开发者ID:domz1,项目名称:SourceFlyFF,代码行数:31,代码来源:WndSelectCh.cpp

示例2: OnDraw

void CWndVendorMessage::OnDraw( C2DRender* p2DRender ) 
{ 
	CWndListBox* pWndList = (CWndListBox*)GetDlgItem( WIDC_LISTBOX1 ); 
	
	pWndList->ResetContent();

	for( int i = 0 ; i < g_Chatting.GetChattingMember(); ++i )
	{
		pWndList->AddString( g_Chatting.m_szName[i] );
	}
} 
开发者ID:careysky,项目名称:FlyFF,代码行数:11,代码来源:WndVendor.cpp

示例3: OnChildNotify

BOOL CWndAdminCreateItem::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	ItemProp* pItemProp;
	CWndListBox* pListBox = (CWndListBox*)GetDlgItem( WIDC_CONTROL1 );
	if( nID == WIDC_ITEM_KIND || nID == WIDC_ITEM_SEX || nID == WIDC_ITEM_JOB || nID == WIDC_LEVEL )
	{
		if( message == WNM_SELCHANGE || message == EN_CHANGE )
		{
			DWORD dwLevel = 0;
			CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_LEVEL );
			CString string = pWndEdit->GetString();
			dwLevel = atoi( string );
			CWndComboBox* pWndItemKind = (CWndComboBox*)GetDlgItem( WIDC_ITEM_KIND );
			CWndComboBox* pWndItemSex = (CWndComboBox*)GetDlgItem( WIDC_ITEM_SEX );
			CWndComboBox* pWndItemJob = (CWndComboBox*)GetDlgItem( WIDC_ITEM_JOB );
			pListBox->ResetContent();
			for( int i = 0; i < prj.m_aPropItem.GetSize(); i++ )
			{
				ItemProp* pItemProp =  prj.GetItemProp( i );
				DWORD dwKind = pWndItemKind->GetItemData( pWndItemKind->GetCurSel() );
				DWORD dwSex = pWndItemSex->GetItemData( pWndItemSex->GetCurSel() );
				DWORD dwJob = pWndItemJob->GetItemData( pWndItemJob->GetCurSel() );
				if( pItemProp && ( pItemProp->dwItemKind2 == dwKind || dwKind == NULL_ID ) &&
					 ( pItemProp->dwItemSex == dwSex || dwSex == SEX_SEXLESS ) )
				{
					if( pItemProp->dwLimitLevel1 >= dwLevel && ( pItemProp->dwItemJob == dwJob || dwJob == -1 ) )
					{
						if( GetLanguage() != LANG_KOR && pItemProp->nVer >= 7 && pItemProp->bCharged == TRUE )
							continue;
						int nIndex = pListBox->AddString( MakeName( pItemProp ) );
						pListBox->SetItemDataPtr( nIndex, pItemProp );
					}
				}
			}
		}
	}
	else
	if( nID == WIDC_OK || ( nID == WIDC_CONTROL1 && message == WNM_DBLCLK ) )
	{
		CString string;
		CWndText* pWndItemName = (CWndText*)GetDlgItem( WIDC_ITEM_NAME );
		CWndText* pWndItemNum = (CWndText*)GetDlgItem( WIDC_ITEM_NUM );
		DWORD dwNum;
		if( pWndItemNum->m_string.GetLength() ) 
		{
			dwNum = _ttoi(pWndItemNum->m_string);
		}
		else 
		{
			dwNum = 1;
		}
		
		dwNum = ( dwNum == 0? 1:dwNum );
		if( pWndItemName->m_string.GetLength() ) 
		{
			CString str2;
			str2 = pWndItemName->m_string;
			string.Format( "/ci %s %d",str2, dwNum);

			ParsingCommand( string.LockBuffer(), g_pPlayer );
			string.UnlockBuffer();
		}
		else 
		{
			int nIndex = pListBox->GetCurSel();
			if( nIndex != -1 ) 	
			{
				pItemProp = (ItemProp*)pListBox->GetItemDataPtr( nIndex );
				if( pItemProp )	
				{
					string.Format( "/ci \"%s\" %d", pItemProp->szName, dwNum);
					ParsingCommand( string.LockBuffer(), g_pPlayer );
					string.UnlockBuffer();
				}
			}
		}
	//	nID = WTBID_CLOSE;
	}
	else
	if( nID == WIDC_CANCEL || nID == WTBID_CLOSE )
	{
		nID = WTBID_CLOSE;
		Destroy( TRUE );
		return TRUE;
	}
	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
} 
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:87,代码来源:WndAdminCreateItem.cpp


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