void WgPackList::_onNewSize( const WgSize& size ) { m_size = size; int newContentBreadth; if( m_bHorizontal ) newContentBreadth = size.h; else newContentBreadth = size.w; if( newContentBreadth != m_contentBreadth ) { m_contentBreadth = newContentBreadth; int ofs = 0; for( int i = 0 ; i < m_hooks.Size() ; i++ ) { WgPackListHook * pHook = m_hooks.Hook(i); WgWidget * pWidget = pHook->_widget(); if( m_bHorizontal ) { int newEntryLength = _paddedLimitedMatchingWidth(pWidget, newContentBreadth ); pHook->m_ofs = ofs; pHook->m_length = newEntryLength; ofs += newEntryLength; pWidget->_onNewSize( WgSize(newEntryLength, newContentBreadth) ); //TODO: Should be able to do a _onNewSize() that prevents child from doing a _requestRender(). } else { int newEntryLength = _paddedLimitedMatchingHeight(pWidget, newContentBreadth ); pHook->m_ofs = ofs; pHook->m_length = newEntryLength; ofs += newEntryLength; pWidget->_onNewSize( WgSize(newContentBreadth, newEntryLength) ); //TODO: Should be able to do a _onNewSize() that prevents child from doing a _requestRender(). } } m_contentLength = ofs; } _requestRender(); }