本文整理汇总了C++中Attachment::delChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ Attachment::delChildren方法的具体用法?C++ Attachment::delChildren怎么用?C++ Attachment::delChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachment
的用法示例。
在下文中一共展示了Attachment::delChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClick
void EnchantsDialog::OnClick(wxCommandEvent &event)
{
if (event.GetId() == ID_ENCHANTSOK)
{
std::string sel = effectsListbox->GetStringSelection().c_str();
if (sel == "")
{
Show(false);
return;
}
if (sel==wxT("NONE") || sel==wxT("None"))
{
if (slot->GetSelection() == 0)
RHandEnchant = -1;
else
LHandEnchant = -1;
Show(false);
return;
}
for (std::map<int, EnchantsRec>::iterator it=enchants.begin(); it!=enchants.end(); ++it)
{
if (it->second.name == sel)
{
EnchantsRec enchant = it->second;
int s = slot->GetSelection();
s += 10;
if (!charControl->model)
return;
if (!slotHasModel(s))
return;
if (slot->GetSelection() == 0)
RHandEnchant = it->first;
else
LHandEnchant = it->first;
// children:
for (size_t i=0; i < charControl->charAtt->children.size(); i++)
{
if (charControl->charAtt->children[i]->slot == s)
{
Attachment *att = charControl->charAtt->children[i];
if (att->children.size() > 0)
att->delChildren();
WoWModel *m = static_cast<WoWModel*>(att->model());
if (!m)
return;
for (ssize_t k=0; k<5; k++)
{
if ((enchant.models[k] != "") && (m->attLookup[k]>=0)) {
att->addChild(enchant.models[k].c_str(), k, -1);
}
}
break;
}
}
Show(false);
return;
}
}
}
else if (event.GetId() == ID_ENCHANTSCANCEL)
{
this->Show(false);
}
}