Added wxTreebook:

- added the control itself
- added protected wxBookCtrlBase::AllowNullPage() to accommodate it
- big changes to the sample to get rid of (most) ugly macros
- added XRC handler for the control
- added docs
- and wxUSE_TREEBOOK everywhere


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-10-09 18:40:36 +00:00
parent 97c58531bf
commit eca15c0d54
27 changed files with 2250 additions and 332 deletions

View File

@@ -114,14 +114,17 @@ wxSize wxBookCtrlBase::DoGetBestSize() const
const size_t nCount = m_pages.size();
for ( size_t nPage = 0; nPage < nCount; nPage++ )
{
wxWindow *pPage = m_pages[nPage];
wxSize childBestSize(pPage->GetBestSize());
const wxWindow * const pPage = m_pages[nPage];
if( pPage )
{
wxSize childBestSize(pPage->GetBestSize());
if ( childBestSize.x > bestSize.x )
bestSize.x = childBestSize.x;
if ( childBestSize.x > bestSize.x )
bestSize.x = childBestSize.x;
if ( childBestSize.y > bestSize.y )
bestSize.y = childBestSize.y;
if ( childBestSize.y > bestSize.y )
bestSize.y = childBestSize.y;
}
}
// convert display area to window area, adding the size necessary for the
@@ -142,7 +145,7 @@ wxBookCtrlBase::InsertPage(size_t nPage,
bool WXUNUSED(bSelect),
int WXUNUSED(imageId))
{
wxCHECK_MSG( page, false, _T("NULL page in wxBookCtrlBase::InsertPage()") );
wxCHECK_MSG( page || AllowNullPage(), false, _T("NULL page in wxBookCtrlBase::InsertPage()") );
wxCHECK_MSG( nPage <= m_pages.size(), false,
_T("invalid page index in wxBookCtrlBase::InsertPage()") );
@@ -155,9 +158,10 @@ wxBookCtrlBase::InsertPage(size_t nPage,
bool wxBookCtrlBase::DeletePage(size_t nPage)
{
wxWindow *page = DoRemovePage(nPage);
if ( !page )
if ( !(page || AllowNullPage()) )
return false;
// delete NULL is harmless
delete page;
return true;