Simplify layout of the svg sample
Get rid of the panel and the sizer, neither of them are necessary when we have a single control (wxNotebook in this case) taking up the entire frame client area.
This commit is contained in:
@@ -140,27 +140,17 @@ MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
|
|||||||
// Associate the menu bar with the frame
|
// Associate the menu bar with the frame
|
||||||
SetMenuBar(menu_bar);
|
SetMenuBar(menu_bar);
|
||||||
|
|
||||||
// Panel containing a notebook
|
|
||||||
m_panel = new wxPanel(this);
|
|
||||||
m_sizerFrame = new wxBoxSizer(wxVERTICAL);
|
|
||||||
m_panel->SetSizer(m_sizerFrame);
|
|
||||||
|
|
||||||
// Create a notebook
|
// Create a notebook
|
||||||
m_notebook = new wxNotebook(m_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBK_TOP);
|
m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBK_TOP);
|
||||||
|
|
||||||
//Add SVG Windows to a notebook
|
//Add SVG Windows to a notebook
|
||||||
for (int i = 0; i <= 8; ++i)
|
for (int i = 0; i <= 8; ++i)
|
||||||
{
|
{
|
||||||
wxString svgTitle;
|
wxString svgTitle;
|
||||||
svgTitle.Printf(wxT("SVG Test %d"), i);
|
svgTitle.Printf(wxT("SVG Test %d"), i);
|
||||||
m_notebook->AddPage(CreateNewPage(i), svgTitle, true);
|
m_notebook->AddPage(CreateNewPage(i), svgTitle);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a notebook
|
|
||||||
m_sizerFrame->Insert(0, m_notebook, wxSizerFlags(5).Expand().Border());
|
|
||||||
m_notebook->ChangeSelection(0);
|
|
||||||
m_sizerFrame->Layout();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MyPage *MyFrame::CreateNewPage(int index)
|
MyPage *MyFrame::CreateNewPage(int index)
|
||||||
|
Reference in New Issue
Block a user