Stop resizing widgets sample pages when first showing them
The size of wxBookCtrl pages is determined by wxBookCtrl and can't be changed, yet the sample tried to do it, making them larger than the actually available space and cutting them off as the result. Just stop doing this and simply layout the page using the available space -- if there is not enough of it, that's too bad, but the user can always resize the main window in this case. See #4379.
This commit is contained in:
@@ -724,20 +724,7 @@ void WidgetsFrame::OnPageChanged(WidgetsBookCtrlEvent& event)
|
||||
{
|
||||
wxWindowUpdateLocker noUpdates(curPage);
|
||||
curPage->CreateContent();
|
||||
//curPage->Layout();
|
||||
curPage->GetSizer()->Fit(curPage);
|
||||
|
||||
WidgetsBookCtrl *book = wxStaticCast(curPage->GetParent(), WidgetsBookCtrl);
|
||||
wxSize size;
|
||||
for ( size_t i = 0; i < book->GetPageCount(); ++i )
|
||||
{
|
||||
wxWindow *page = book->GetPage(i);
|
||||
if ( page )
|
||||
{
|
||||
size.IncTo(page->GetSize());
|
||||
}
|
||||
}
|
||||
curPage->SetSize(size);
|
||||
curPage->Layout();
|
||||
}
|
||||
// re-apply the attributes to the widget(s)
|
||||
curPage->SetUpWidget();
|
||||
|
Reference in New Issue
Block a user