use common code to determine best notebook size instaed of Mac-specific which mistakenly used current pages sizes and not the best ones
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -133,7 +133,6 @@ public:
|
|||||||
// -------------------
|
// -------------------
|
||||||
virtual void Command(wxCommandEvent& event);
|
virtual void Command(wxCommandEvent& event);
|
||||||
protected:
|
protected:
|
||||||
virtual wxSize DoGetBestSize() const ;
|
|
||||||
virtual wxNotebookPage *DoRemovePage(size_t page) ;
|
virtual wxNotebookPage *DoRemovePage(size_t page) ;
|
||||||
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
|
@@ -163,34 +163,6 @@ wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
|
|||||||
return DoGetSizeFromClientSize( sizePage ) ;
|
return DoGetSizeFromClientSize( sizePage ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize wxNotebook::DoGetBestSize() const
|
|
||||||
{
|
|
||||||
// calculate the max page size
|
|
||||||
wxSize size(0, 0);
|
|
||||||
|
|
||||||
size_t count = GetPageCount();
|
|
||||||
if ( count )
|
|
||||||
{
|
|
||||||
for ( size_t n = 0; n < count; n++ )
|
|
||||||
{
|
|
||||||
wxSize sizePage = m_pages[n]->GetSize();
|
|
||||||
|
|
||||||
if ( size.x < sizePage.x )
|
|
||||||
size.x = sizePage.x;
|
|
||||||
if ( size.y < sizePage.y )
|
|
||||||
size.y = sizePage.y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else // no pages
|
|
||||||
{
|
|
||||||
// use some arbitrary default size
|
|
||||||
size.x =
|
|
||||||
size.y = 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
return CalcSizeFromPage(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
int wxNotebook::SetSelection(size_t nPage)
|
int wxNotebook::SetSelection(size_t nPage)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
|
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
|
||||||
|
Reference in New Issue
Block a user