fix initial layout of the widgets pages: avoid calling Fit() on them
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
70c536f394
commit
be16b85933
@ -370,8 +370,6 @@ void BitmapComboBoxWidgetsPage::CreateContent()
|
||||
Reset();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -275,8 +275,6 @@ void ButtonWidgetsPage::CreateContent()
|
||||
CreateButton();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -233,8 +233,6 @@ void CheckBoxWidgetsPage::CreateContent()
|
||||
Reset();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
void CheckBoxWidgetsPage::Reset()
|
||||
|
@ -168,7 +168,7 @@ void ColourPickerWidgetsPage::CreateContent()
|
||||
sz->Add(boxleft, 0, wxGROW|wxALL, 5);
|
||||
sz->Add(m_sizer, 1, wxGROW|wxALL, 5);
|
||||
|
||||
SetSizerAndFit(sz);
|
||||
SetSizer(sz);
|
||||
}
|
||||
|
||||
void ColourPickerWidgetsPage::CreatePicker()
|
||||
|
@ -335,8 +335,6 @@ void ComboboxWidgetsPage::CreateContent()
|
||||
Reset();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -178,8 +178,6 @@ void DatePickerWidgetsPage::CreateContent()
|
||||
Reset();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
void DatePickerWidgetsPage::Reset()
|
||||
|
@ -216,8 +216,6 @@ void DirCtrlWidgetsPage::CreateContent()
|
||||
Reset();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
void DirCtrlWidgetsPage::Reset()
|
||||
|
@ -170,7 +170,7 @@ void DirPickerWidgetsPage::CreateContent()
|
||||
sz->Add(boxleft, 0, wxGROW|wxALL, 5);
|
||||
sz->Add(m_sizer, 1, wxGROW|wxALL, 5);
|
||||
|
||||
SetSizerAndFit(sz);
|
||||
SetSizer(sz);
|
||||
}
|
||||
|
||||
void DirPickerWidgetsPage::CreatePicker()
|
||||
|
@ -191,7 +191,7 @@ void FilePickerWidgetsPage::CreateContent()
|
||||
sz->Add(boxleft, 0, wxGROW|wxALL, 5);
|
||||
sz->Add(m_sizer, 1, wxGROW|wxALL, 5);
|
||||
|
||||
SetSizerAndFit(sz);
|
||||
SetSizer(sz);
|
||||
}
|
||||
|
||||
void FilePickerWidgetsPage::CreatePicker()
|
||||
|
@ -170,7 +170,7 @@ void FontPickerWidgetsPage::CreateContent()
|
||||
sz->Add(boxleft, 0, wxGROW|wxALL, 5);
|
||||
sz->Add(m_sizer, 1, wxGROW|wxALL, 5);
|
||||
|
||||
SetSizerAndFit(sz);
|
||||
SetSizer(sz);
|
||||
}
|
||||
|
||||
void FontPickerWidgetsPage::CreatePicker()
|
||||
|
@ -261,8 +261,6 @@ void GaugeWidgetsPage::CreateContent()
|
||||
Reset();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
GaugeWidgetsPage::~GaugeWidgetsPage()
|
||||
|
@ -223,8 +223,6 @@ void HyperlinkWidgetsPage::CreateContent()
|
||||
Reset();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
void HyperlinkWidgetsPage::Reset()
|
||||
|
@ -334,8 +334,6 @@ void ListboxWidgetsPage::CreateContent()
|
||||
Reset();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -295,8 +295,6 @@ void BookWidgetsPage::CreateContent()
|
||||
#endif // USE_ICONS_IN_BOOK
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
BookWidgetsPage::~BookWidgetsPage()
|
||||
|
@ -464,8 +464,6 @@ void ODComboboxWidgetsPage::CreateContent()
|
||||
Reset();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -302,8 +302,6 @@ void RadioWidgetsPage::CreateContent()
|
||||
|
||||
// final initializations
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -360,8 +360,6 @@ void SliderWidgetsPage::CreateContent()
|
||||
|
||||
// final initializations
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -266,8 +266,6 @@ void SpinBtnWidgetsPage::CreateContent()
|
||||
|
||||
// final initializations
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -307,8 +307,6 @@ void StaticWidgetsPage::CreateContent()
|
||||
Reset();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -559,8 +559,6 @@ void TextWidgetsPage::CreateContent()
|
||||
sizerTop->Add(m_sizerText, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -163,8 +163,6 @@ void ToggleWidgetsPage::CreateContent()
|
||||
Reset();
|
||||
|
||||
SetSizer(sizerTop);
|
||||
|
||||
sizerTop->Fit(this);
|
||||
}
|
||||
|
||||
void ToggleWidgetsPage::Reset()
|
||||
|
@ -653,12 +653,16 @@ void WidgetsFrame::OnPageChanged(WidgetsBookCtrlEvent& event)
|
||||
|
||||
GetMenuBar()->Check(Widgets_BusyCursor, false);
|
||||
|
||||
// lazy creation of the pages
|
||||
// create the pages on demand, otherwise the sample startup is too slow as
|
||||
// it creates hundreds of controls
|
||||
WidgetsPage *page = CurrentPage();
|
||||
if ( page->GetChildren().empty() )
|
||||
{
|
||||
wxWindowUpdateLocker noUpdates(page);
|
||||
page->CreateContent();
|
||||
//page->Layout();
|
||||
page->GetSizer()->Fit(page);
|
||||
|
||||
WidgetsBookCtrl *book = wxStaticCast(page->GetParent(), WidgetsBookCtrl);
|
||||
wxSize size;
|
||||
for ( size_t i = 0; i < book->GetPageCount(); ++i )
|
||||
|
Loading…
Reference in New Issue
Block a user