示例#1
0
nuiComboBox::~nuiComboBox()
{
  UnparentTree(mpChoicesTree);

  if (mpChoicesTree)
    mpChoicesTree->Release();
}
示例#2
0
void nuiComboBox::UnparentTree(nuiTreeNode* pTree)
{
  NGL_ASSERT(pTree);
  pTree->Select(false);
  pTree->Open(false);
  nuiWidgetPtr pWidget = pTree->GetElement();
  NGL_ASSERT(pWidget);
  if (pWidget->GetParent() == this)
    DelChild(pWidget);
  
  uint32 count = pTree->GetChildrenCount();
  for (uint32 i = 0; i < count; i++)
  {
    nuiTreeNode* pNode = dynamic_cast<nuiTreeNode*>(pTree->GetChild(i));
    NGL_ASSERT(pNode);
    UnparentTree(pNode);
  }
}
示例#3
0
void nuiPopupMenu::UnparentTree(nuiTreeNode* pTree)
{
  NGL_ASSERT(pTree);
  nuiWidgetPtr pWidget = pTree->GetElement();
  if (pWidget->GetParent() == this)
  {
    pTree->Select(false);
    pTree->Open(false);
    NGL_ASSERT(pWidget);
    DelChild(pWidget);
  }
  uint32 count = pTree->GetChildrenCount();
  for (uint32 i = 0; i < count; i++)
  {
    nuiTreeNode* pNode = dynamic_cast<nuiTreeNode*>(pTree->GetChild(i));
    NGL_ASSERT(pNode);
    UnparentTree(pNode);
  }
  NGL_ASSERT(mpTree);
  mPopupTreeSink.DisconnectSource(pTree->Changed);
  mPopupTreeSink.DisconnectSource(pTree->ChildAdded);
  mPopupTreeSink.DisconnectSource(pTree->ChildDeleted);
}