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


C++ CWndListBox类代码示例

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


在下文中一共展示了CWndListBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: AddMemberParty

//=========================NghiaLP--20140204--PARTY============================
//Nhan vao Button de thuc hien
void CEventHandler::AddMemberParty(CWndControl* sender, CMainDlg* parent)
{
	CWndDlg* dlgCtrlContainer = parent->m_controlDlg;
	CCharacter* m_char = parent->m_clsCurChar;
	if(m_char==NULL)
		return;
	CWndListBox * lstMember = static_cast<CWndListBox*> (dlgCtrlContainer->GetControl(L"lstMemberParty"));
	if(lstMember->GetCount()>=6){
		m_char->ShowMessage(L"Party da du thanh vien");
		return;
	}

	CWndTextBox * txtAddMember = static_cast<CWndTextBox*> (dlgCtrlContainer->GetControl(L"txtAddMember"));
	
	CString sMemName = txtAddMember->GetText();
	if(sMemName==L"")
		return;
	txtAddMember->SetText(L"");
	std::vector<CString>::iterator item;
	for(item=  m_char->m_vMemberParty.begin(); item != m_char->m_vMemberParty.end(); item ++){
		if(item->Trim() == sMemName){
			m_char->ShowMessage(L"Thanh vien nay da co trong danh sach");
			return;
			
		}
	}
	//INV_PARTY swMem;
	//swMem._nameMember = m_char->m_swNameMember;
	m_char->m_vMemberParty.push_back(sMemName);
	lstMember->AddItem(sMemName);
	
	//m_char->m_swNameMember = L"";
	

} 
开发者ID:zidane168,项目名称:AutoPlay,代码行数:37,代码来源:EventHandler.cpp

示例3: _update_auto_login

void _update_auto_login( const DWORD dwDelta )
{
    static BYTE bySEQ = 0;

    if( bySEQ > 2 )
        return;

    if( 0 == bySEQ )
    {
        CWndLogin* pWndLogin	= (CWndLogin*)g_WndMng.GetWndBase( APP_LOGIN );
        if( pWndLogin )
        {
#ifdef __CON_AUTO_LOGIN
            pWndLogin->SetAccountAndPassword( g_Console._strAccount, g_Console._StrPassword );
#endif
            pWndLogin->OnChildNotify( 0, WIDC_OK, 0 );

            bySEQ = 1;
            g_WndMng.PutString( "<WARNING!!!>자동로그인이 진행중입니다, 월드진입까지 키보드 만지지 마세요 ", NULL, 0xffff0000 );
        }
    }
    else if( 1 == bySEQ )
    {
        CWndSelectServer* pWndSelectServer = (CWndSelectServer*)g_WndMng.GetWndBase( APP_SELECT_SERVER );
        if( pWndSelectServer )
        {
            CWndListBox* pWndList	= (CWndListBox*)pWndSelectServer->GetDlgItem( WIDC_CONTROL0 );
            pWndList->SetCurSel( g_Console._nServer - 1 );

            pWndSelectServer->OnChildNotify( 0, WIDC_NEXT, 0 );
            bySEQ = 2;

            CString strTemp;
            strTemp.Format( "<WARNING!!!>자동로그인 SERVER INDEX: %d ", g_Console._nServer );
            g_WndMng.PutString( strTemp, NULL, 0xffff0000 );
        }
    }
    else if( 2 == bySEQ )
    {
        CWndSelectChar* pWnd	= (CWndSelectChar *)g_WndMng.GetWndBase( APP_SELECT_CHAR );
        if( pWnd )
        {
            pWnd->m_nSelectCharacter = g_Console._nCharacter - 1;

            pWnd->OnChildNotify( 0, WIDC_ACCEPT, 0 );
            bySEQ = 3;

            CString strTemp;
            strTemp.Format( "<WARNING!!!>자동로그인 CHARACTER INDEX: %d ", g_Console._nCharacter );
            g_WndMng.PutString( strTemp, NULL, 0xffff0000 );

            g_WndMng.PutString( "GOOD LUCK", NULL, 0xff0000ff );
        }
    }

}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:56,代码来源:ConsoleFunc.cpp

示例4: RemoveAllMonsterCoor

void CEventHandler::RemoveAllMonsterCoor(CWndControl* sender,CMainDlg* parent){
	//Xóa tất cả tọa độ trong danh sách
	CWndDlg* dlgCtrlContainer = parent->m_controlDlg;
	CCharacter* m_char = parent->m_clsCurChar;
	CWndListBox * lstMonster = static_cast<CWndListBox*> (dlgCtrlContainer->GetControl(L"lstMonsterCoor"));
	if(m_char==NULL)
		return;
	m_char->m_lMonsters.clear();
	lstMonster->ClearItems();
}
开发者ID:zidane168,项目名称:AutoPlay,代码行数:10,代码来源:EventHandler.cpp

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

示例6: AddToList

BOOL CWndTutorial::AddToList(int nIndex)
{

	map<int, TUTORIAL_STRING>::iterator iter = m_mapTutorial.find(nIndex);

	if(iter != NULL)
	{
		CWndListBox* pWndListBox	= (CWndListBox*)GetDlgItem( WIDC_LIST1 );
		pWndListBox->AddString(iter->second.strTitle);
		return TRUE;
	}
	else
		return FALSE;

}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:15,代码来源:WndTutorial.cpp

示例7: RemoveMemberParty

void CEventHandler::RemoveMemberParty(CWndControl* sender, CMainDlg* parent)
{
	//xóa thành viên khỏi danh sách mời
	CWndDlg* dlgCtrlContainer = parent->m_controlDlg;
	CCharacter* m_char = parent->m_clsCurChar;
	if(m_char==NULL)
		return;
	CWndListBox * lstMmeber = static_cast<CWndListBox*> (dlgCtrlContainer->GetControl(L"lstMemberParty"));
	if(lstMmeber->GetSelectedIndex()==-1)
		return;
	m_char->m_vMemberParty.erase(m_char->m_vMemberParty.begin()+lstMmeber->GetSelectedIndex());
	lstMmeber->ClearItems();
	std::vector<CString>::iterator item;
	for(item=  m_char->m_vMemberParty.begin(); item != m_char->m_vMemberParty.end(); item ++){
		lstMmeber->AddItem(item->Trim());
	}
}
开发者ID:zidane168,项目名称:AutoPlay,代码行数:17,代码来源:EventHandler.cpp

示例8: RemoveMonsterCoor

void CEventHandler::RemoveMonsterCoor(CWndControl* sender,CMainDlg* parent){
	//xóa tọa độ khỏi danh sách
	CWndDlg* dlgCtrlContainer = parent->m_controlDlg;
	CCharacter* m_char = parent->m_clsCurChar;
	if(m_char==NULL)
		return;
	CWndListBox * lstMonster = static_cast<CWndListBox*> (dlgCtrlContainer->GetControl(L"lstMonsterCoor"));
	if(lstMonster->GetSelectedIndex()==-1)
		return;
	m_char->m_lMonsters.erase(m_char->m_lMonsters.begin()+lstMonster->GetSelectedIndex());
	lstMonster->ClearItems();
	std::vector<COOR>::iterator item;
	for(item=  m_char->m_lMonsters.begin(); item != m_char->m_lMonsters.end(); item ++){
		CString sCoor;
		sCoor.Format(L"%d,%d",item->_iX ,item->_iY);
		lstMonster->AddItem(sCoor);
	}
}
开发者ID:zidane168,项目名称:AutoPlay,代码行数:18,代码来源:EventHandler.cpp

示例9: AddMonsterCoor

//////////////////////////////////////Tab bãi quái //////////////////////////////////////////////////////////
void CEventHandler::AddMonsterCoor(CWndControl* sender,CMainDlg* parent){
	//Thêm tọa độ vào danh sách
	CWndDlg* dlgCtrlContainer = parent->m_controlDlg;
	CCharacter* m_char = parent->m_clsCurChar;
	if(m_char==NULL)
		return;
	CWndListBox * lstMonster = static_cast<CWndListBox*> (dlgCtrlContainer->GetControl(L"lstMonsterCoor"));
	
	COOR cCoor;
	cCoor._iX = m_char->m_iTdX;
	cCoor._iY = m_char->m_iTdY;

	m_char->m_lMonsters.push_back( cCoor);
	
	CString sCoor;
	sCoor.Format(L"%d,%d",cCoor._iX ,cCoor._iY);
	lstMonster->AddItem(sCoor);
}
开发者ID:zidane168,项目名称:AutoPlay,代码行数:19,代码来源:EventHandler.cpp

示例10: switch

BOOL CWndTutorial::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	switch(nID)
	{
		case WIDC_LIST1: // view ctrl
			{
				CWndListBox* pWndListBox = (CWndListBox*)GetDlgItem( WIDC_LIST1 );
				int sel = pWndListBox->GetCurSel();
				map<int, TUTORIAL_STRING>::iterator iter = m_mapTutorial.find(pWndListBox->GetCurSel());
				m_strKeyword = iter->second.strTitle;
				CWndText* pWndText = (CWndText*)GetDlgItem( WIDC_TEXT2 );
				pWndText->m_string.Init( m_pFont, &pWndText->GetClientRect() );
				pWndText->m_string.SetString("");
				pWndText->m_string.AddParsingString(LPCTSTR(iter->second.strContents));
				pWndText->UpdateScrollBar();
			}
			break;
	}

	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
} 
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:21,代码来源:WndTutorial.cpp

示例11: switch

BOOL CWndSelectCh::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	int nSelect = 0;

	switch(nID)
	{
#ifdef __CASH_AREA
		case WIDC_BT_MOVE: //Ok Button
			{
				CWndListBox* pWndListBox = (CWndListBox*)GetDlgItem( WIDC_LB_CHANNEL );
				char strTemp[8];
				nSelect = pWndListBox->GetCurSel() * -1;
				_itoa(nSelect, strTemp, 10);
				g_DPlay.SendDoUseItemInput(m_nItemId, strTemp);
				Destroy();
			}
			break;
		case WIDC_BT_CANCEL: //Cancel Button
			{
				Destroy();
			}
			break;
#else
		case WIDC_LISTBOX1: // view ctrl
			{
				CWndListBox* pWndListBox = (CWndListBox*)GetDlgItem( WIDC_LISTBOX1 );
				char strTemp[8];
				nSelect = pWndListBox->GetCurSel() * -1;
				_itoa(nSelect, strTemp, 10);
				g_DPlay.SendDoUseItemInput(m_nItemId, strTemp);
				Destroy();
			}
			break;
#endif
	}

	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
} 
开发者ID:domz1,项目名称:SourceFlyFF,代码行数:38,代码来源:WndSelectCh.cpp

示例12: while

BOOL CWndTutorial::LoadTutorial(LPCTSTR lpszFileName)
{
	
	CScript			s;
	int				nIndex = 0;
	CString			strKeyword;
	TUTORIAL_STRING temp;

	if( s.Load( lpszFileName ) == FALSE )
		return FALSE;
	s.tok = 0;
	m_mapTutorial.clear();

	// {
	//	제목(문자열)
	//	내용(문자열)
	// }
	while( s.tok != FINISHED )
	{
		s.GetToken();	// {
		s.GetToken();	//
		temp.strTitle		= s.token;
		s.GetToken();
		temp.strContents	= s.token;
		m_mapTutorial.insert(map<int, TUTORIAL_STRING>::value_type(nIndex, temp));
		s.GetToken();	// }

		// 완료한 레벨까지만 추가한다
		if(g_Option.m_nTutorialLv >= nIndex + 1)
		{
			CWndListBox* pWndListBox	= (CWndListBox*)GetDlgItem( WIDC_LIST1 );
			pWndListBox->AddString( temp.strTitle );
		}
		++nIndex;
	}
	return TRUE;

}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:38,代码来源:WndTutorial.cpp

示例13: DownAward

void CEventHandler::DownAward(CWndControl* sender,CMainDlg* parent){
	CWndDlg* dlgCtrlContainer = parent->m_controlDlg;
	CWndListBox * lst = static_cast<CWndListBox*> (dlgCtrlContainer->GetControl(L"lstAward"));
	int itemSel=lst->GetSelectedIndex();
	if(itemSel>= lst->GetCount()-1 || itemSel<0)
		return;
	CCharacter* m_char = parent->m_clsCurChar;
	if(m_char==NULL)
		return;

	CString sTmp = lst->GetItem(itemSel);
	lst->SetItem(itemSel,lst->GetItem(itemSel+1));
	lst->SetItem(itemSel+1,sTmp);
	lst->SetSelectedIndex(itemSel+1);

	itemSel =itemSel+1;
	byte tmp = m_char->m_arrAward[itemSel];
	m_char->m_arrAward[itemSel]=m_char->m_arrAward[itemSel+1];
	m_char->m_arrAward[itemSel+1] = tmp;
	
}
开发者ID:zidane168,项目名称:AutoPlay,代码行数:21,代码来源:EventHandler.cpp

示例14: DownMonsterCoor

void CEventHandler::DownMonsterCoor(CWndControl* sender,CMainDlg* parent){
	//Thay đổi tọa độ trong danh sách
	CWndDlg* dlgCtrlContainer = parent->m_controlDlg;
	CWndListBox * lstMonster = static_cast<CWndListBox*> (dlgCtrlContainer->GetControl(L"lstMonsterCoor"));
	int itemSel=lstMonster->GetSelectedIndex();
	if(itemSel>= lstMonster->GetCount()-1 || itemSel<0)
		return;
	CCharacter* m_char = parent->m_clsCurChar;
	if(m_char==NULL)
		return;

	CString sTmp = lstMonster->GetItem(itemSel);
	lstMonster->SetItem(itemSel,lstMonster->GetItem(itemSel+1));
	lstMonster->SetItem(itemSel+1,sTmp);
	lstMonster->SetSelectedIndex(itemSel+1);

	
	COOR tmp = m_char->m_lMonsters[itemSel];
	m_char->m_lMonsters[itemSel]=m_char->m_lMonsters[itemSel+1];
	m_char->m_lMonsters[itemSel+1]=tmp;
	
}
开发者ID:zidane168,项目名称:AutoPlay,代码行数:22,代码来源:EventHandler.cpp

示例15: OnInitialUpdate

void CWndAdminCreateItem::OnInitialUpdate() 
{ 
	CWndNeuz::OnInitialUpdate(); 

	CWndListBox* pListBox = (CWndListBox*)GetDlgItem( WIDC_CONTROL1 );
	for( int i = 0; i < prj.m_aPropItem.GetSize(); i++ )
	{
		ItemProp* pItemProp =  prj.GetItemProp( i );
		if( pItemProp )
		{
			if( GetLanguage() != LANG_KOR && pItemProp->nVer >= 7 && pItemProp->bCharged == TRUE )
				continue;
			int nIndex = pListBox->AddString( MakeName( pItemProp ) );
			pListBox->SetItemDataPtr( nIndex, pItemProp );
		}
	}
	CWndComboBox* pWndItemKind = (CWndComboBox*)GetDlgItem( WIDC_ITEM_KIND );
	CWndComboBox* pWndItemSex = (CWndComboBox*)GetDlgItem( WIDC_ITEM_SEX );
	CWndComboBox* pWndItemJob = (CWndComboBox*)GetDlgItem( WIDC_ITEM_JOB );
	CWndEdit* pWndLevel = (CWndEdit*)GetDlgItem( WIDC_LEVEL );
	CStringArray strArray;
	CScript::GetFindIdToArray( "IK2_", &strArray );
	int nIndex = pWndItemKind->AddString( "ALL" );
	pWndItemKind->SetItemData( nIndex, NULL_ID );
	for( i = 0; i < strArray.GetSize(); i++ )
	{
		nIndex = pWndItemKind->AddString( strArray.GetAt( i ) );
		DWORD dwNum = CScript::GetDefineNum( strArray.GetAt( i ) );
		pWndItemKind->SetItemData( nIndex, dwNum );
	}
	pWndItemKind->m_wndListBox.SortListBox();
	nIndex = pWndItemKind->m_wndListBox.FindString( 0, "ALL" );
	pWndItemKind->SetCurSel( nIndex );
	strArray.RemoveAll();
	CScript::GetFindIdToArray( "SEX_", &strArray );
	for( i = 0; i < strArray.GetSize(); i++ )
	{
		nIndex = pWndItemSex->AddString( strArray.GetAt( i ) );
		DWORD dwNum = CScript::GetDefineNum( strArray.GetAt( i ) );
		pWndItemSex->SetItemData( nIndex, dwNum );
	}
	pWndItemSex->SetCurSel( 2 );

	strArray.RemoveAll();
	CScript::GetFindIdToArray( "JOB_", &strArray );
	nIndex = pWndItemJob->AddString( "ALL" );
	pWndItemJob->SetItemData( nIndex, -1 );
	for( i = 0; i < strArray.GetSize(); i++ )
	{
		nIndex = pWndItemJob->AddString( strArray.GetAt( i ) );
		DWORD dwNum = CScript::GetDefineNum( strArray.GetAt( i ) );
		pWndItemJob->SetItemData( nIndex, dwNum );
	}
	pWndItemJob->m_wndListBox.SortListBox();
	nIndex = pWndItemJob->m_wndListBox.FindString( 0, "ALL" );
	pWndItemJob->SetCurSel( nIndex );
	// 좌표 이동 

	CRect rectRoot = m_pWndRoot->GetLayoutRect();
	CRect rectWindow = GetWindowRect();
	CPoint point( rectRoot.right - rectWindow.Width(), 110 );
	Move( point );
	MoveParentCenter();
} 
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:64,代码来源:WndAdminCreateItem.cpp


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