void Scene::SetChild (Scene* scene) { #ifdef DEBUG if (childScene != nullptr) { const std::string logText = "already set child !!"; PutLog (logText); } #endif if (scene == nullptr) { #ifdef DEBUG const std::string logText = "scene is nullptr !! so, return this method."; PutLog (logText); #endif return; } if (childScene != nullptr) { DestroyChild (); } childScene = scene; }
void QuadTreeNode::DestroyAllChildren() { for(int i = 0; i < nodeChildren.size(); i++) { DestroyChild(nodeChildren[i]); } }
CRealMediaWindowlessSite::~CRealMediaWindowlessSite() { POSITION pos = m_pChildren.GetHeadPosition(); while(pos) DestroyChild(m_pChildren.GetNext(pos)); RMADestroyRegion(m_pRegion); RMADestroyRegion(m_pRegionWithoutChildren); }
void STabCtrl::OnDestroy() { for(int i=GetItemCount()-1; i>=0; i--) { DestroyChild(m_lstPages[i]); } m_lstPages.RemoveAll(); }
void STabCtrl::OnSliderFinish() { SASSERT(m_tabSlider); DestroyChild(m_tabSlider); m_tabSlider = NULL; STabPage * pPage = m_lstPages[m_nCurrentPage]; SASSERT(pPage); pPage->SetVisible(TRUE,TRUE); }
BOOL CDuiItemBox::RemoveItem(CDuiWindow * pChild) { if (DestroyChild(pChild)) { UpdateScroll(); ReLayout(); NotifyInvalidate(); return TRUE; } return FALSE; }
void STabCtrl::RemoveAllItems( void ) { for (int i = GetItemCount()-1; i >= 0; i--) { STabPage * pTab = GetItem(i); DestroyChild(pTab); m_lstPages.RemoveAt(i); } m_nCurrentPage = -1; Invalidate(); }
int main() { struct CChildDate date; InitChild(&date); date.pInit(&date, 2016, 2, 3); if (date.pJudge(&date)) printf("isLeapYear!\n"); else printf("notLeapYear!\n"); DestroyChild(&date); return 0; }
void OGR_SRSNode::StripNodes( const char * pszName ) { /* -------------------------------------------------------------------- */ /* Strip any children matching this name. */ /* -------------------------------------------------------------------- */ while( FindChild( pszName ) >= 0 ) DestroyChild( FindChild( pszName ) ); /* -------------------------------------------------------------------- */ /* Recurse */ /* -------------------------------------------------------------------- */ for( int i = 0; i < GetChildCount(); i++ ) GetChild(i)->StripNodes( pszName ); }
BOOL CDuiItemBox::RemoveItem(UINT iItem) { if(iItem>=GetItemCount()) return FALSE; CDuiWindow *pChild=m_pFirstChild; for(UINT iChild=0; iChild<iItem ; iChild++) { pChild=pChild->GetDuiWindow(GDUI_NEXTSIBLING); } DestroyChild(pChild); UpdateScroll(); ReLayout(); NotifyInvalidate(); return TRUE; }
BOOL STabCtrl::RemoveItem( int nIndex , int nSelPage/*=0*/) { STabPage * pTab = GetItem(nIndex); DestroyChild(pTab); m_lstPages.RemoveAt(nIndex); if (m_nCurrentPage == nIndex) { if(nSelPage<0) nSelPage=0; if(nSelPage>=(int)GetItemCount()) nSelPage=GetItemCount()-1; m_nCurrentPage=-1; SetCurSel(nSelPage); }else { if(m_nCurrentPage>nIndex) m_nCurrentPage--; CRect rcTitle = GetTitleRect(); InvalidateRect(rcTitle); } return TRUE; }