本文整理汇总了C++中CList::GetTotal方法的典型用法代码示例。如果您正苦于以下问题:C++ CList::GetTotal方法的具体用法?C++ CList::GetTotal怎么用?C++ CList::GetTotal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CList
的用法示例。
在下文中一共展示了CList::GetTotal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateNameList
void CScreenPlayerSelect::UpdateNameList()
{
CWindow* pw;
CList* pl;
CEdit* pe;
std::string name;
int total, i;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == nullptr ) return;
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_NLIST));
if ( pl == nullptr ) return;
pe = static_cast<CEdit*>(pw->SearchControl(EVENT_INTERFACE_NEDIT));
if ( pe == nullptr ) return;
name = pe->GetText(100);
total = pl->GetTotal();
for ( i=0 ; i<total ; i++ )
{
// TODO: stricmp?
if ( name == pl->GetItemName(i) )
{
pl->SetSelect(i);
pl->ShowSelect(false);
return;
}
}
pl->SetSelect(-1);
}
示例2: IOUpdateList
void CScreenIO::IOUpdateList(bool isWrite)
{
CWindow* pw;
CList* pl;
CButton* pb;
CImage* pi;
int sel, max;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == nullptr ) return;
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_IOLIST));
if ( pl == nullptr ) return;
pi = static_cast<CImage*>(pw->SearchControl(EVENT_INTERFACE_IOIMAGE));
if ( pi == nullptr ) return;
sel = pl->GetSelect();
max = pl->GetTotal();
if (m_saveList.size() <= static_cast<unsigned int>(sel))
return;
std::string filename = m_saveList.at(sel) + "/screen.png";
if ( isWrite )
{
if ( sel < max-1 )
{
pi->SetFilenameImage(filename.c_str());
}
else
{
pi->SetFilenameImage("");
}
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_IODELETE));
if ( pb != nullptr )
{
pb->SetState(STATE_ENABLE, sel < max-1);
}
}
else
{
pi->SetFilenameImage(filename.c_str());
}
}
示例3: UpdateNameControl
void CScreenPlayerSelect::UpdateNameControl()
{
CWindow* pw;
CList* pl;
CButton* pb;
CEdit* pe;
std::string name;
int total, sel;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == nullptr ) return;
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_NLIST));
if ( pl == nullptr ) return;
pe = static_cast<CEdit*>(pw->SearchControl(EVENT_INTERFACE_NEDIT));
if ( pe == nullptr ) return;
total = pl->GetTotal();
sel = pl->GetSelect();
name = pe->GetText(100);
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_NDELETE));
if ( pb != nullptr )
{
pb->SetState(STATE_ENABLE, total>0 && sel!=-1);
}
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_NOK));
if ( pb != nullptr )
{
pb->SetState(STATE_ENABLE, !name.empty() || sel!=-1);
}
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_PERSO));
if ( pb != nullptr )
{
pb->SetState(STATE_ENABLE, !name.empty() || sel!=-1);
}
}