本文整理汇总了C++中CWndListBox::AddItem方法的典型用法代码示例。如果您正苦于以下问题:C++ CWndListBox::AddItem方法的具体用法?C++ CWndListBox::AddItem怎么用?C++ CWndListBox::AddItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWndListBox
的用法示例。
在下文中一共展示了CWndListBox::AddItem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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"";
}
示例2: 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());
}
}
示例3: 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);
}
}
示例4: 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);
}