void SwndContainerImpl::_BuildWndTreeZorder( SWindow *pWnd,UINT & iOrder ) { pWnd->m_uZorder = iOrder++; SWindow *pChild = pWnd->GetWindow(GSW_FIRSTCHILD); while(pChild) { _BuildWndTreeZorder(pChild,iOrder); pChild=pChild->GetWindow(GSW_NEXTSIBLING); } }
SWindow * SwndLayoutBuilder::GetRefSibling(SWindow *pCurWnd,int uCode) { SASSERT(uCode == GSW_NEXTSIBLING || uCode == GSW_PREVSIBLING); SWindow *pRet = pCurWnd->GetWindow(uCode); while(pRet) { if(pRet->m_bVisible || pRet->m_bDisplay) break; pRet = pRet->GetWindow(uCode); } return pRet; }
virtual void UpdateChildrenPosition() { CRect rcClient = GetClientRect(); rcClient.DeflateRect(m_rcMargin.left,m_rcMargin.top,m_rcMargin.right,m_rcMargin.bottom); SWindow *pChild = GetWindow(GSW_FIRSTCHILD); CRect rcItem = rcClient; rcItem.bottom = rcItem.top; while(pChild) { CSize szItem = pChild->GetDesiredSize(rcClient); rcItem.top = rcItem.bottom; rcItem.bottom += szItem.cy; pChild->Move(rcItem); pChild = pChild->GetWindow(GSW_NEXTSIBLING); } }