Vincent R.
2014-10-17 07:15:26 UTC
Hi,
I have some pages that are designed under wxFormBuilder and I would like to
add by code a panel below taking 13% of the space.
So I am trying to move the page 's sizer inside another sizer and to
declare the right proportion but it doesn't work.
Here is what I tried :
enum { NAVPANEL_PERCENT_SZE = 13 };
wxSizer* pPageSizer = pWndPage->GetSizer();
if (pPageSizer)
{
wxBoxSizer* pNewPageSizer = new wxBoxSizer( wxVERTICAL );
pWndPage->SetSizer(pNewPageSizer);
pNewPageSizer->Insert(0, pPageSizer, 100 - NAVPANEL_PERCENT_SZE,
wxALL|wxEXPAND);
wxBoxSizer* pNavPanelSizer = new wxBoxSizer( wxVERTICAL );
StatusAndNavigateHTMLPanel* pNavStatus = new
StatusAndNavigateHTMLPanel(pWndPage, true);
pNavPanelSizer->Add(pNavStatus, NAVPANEL_PERCENT_SZE, wxALL|wxEXPAND);
pNewPageSizer->Add(pNavPanelSizer, NAVPANEL_PERCENT_SZE, wxALL|wxEXPAND);
pWndPage->Layout();
}
I assume that when I do pWndPage->SetSizer(pNewPageSizer); the sizer is
deallocated and that's why maybe it doesn't work.
So my question is how can I change the sizer tree to achieve what I want.
Thanks
I have some pages that are designed under wxFormBuilder and I would like to
add by code a panel below taking 13% of the space.
So I am trying to move the page 's sizer inside another sizer and to
declare the right proportion but it doesn't work.
Here is what I tried :
enum { NAVPANEL_PERCENT_SZE = 13 };
wxSizer* pPageSizer = pWndPage->GetSizer();
if (pPageSizer)
{
wxBoxSizer* pNewPageSizer = new wxBoxSizer( wxVERTICAL );
pWndPage->SetSizer(pNewPageSizer);
pNewPageSizer->Insert(0, pPageSizer, 100 - NAVPANEL_PERCENT_SZE,
wxALL|wxEXPAND);
wxBoxSizer* pNavPanelSizer = new wxBoxSizer( wxVERTICAL );
StatusAndNavigateHTMLPanel* pNavStatus = new
StatusAndNavigateHTMLPanel(pWndPage, true);
pNavPanelSizer->Add(pNavStatus, NAVPANEL_PERCENT_SZE, wxALL|wxEXPAND);
pNewPageSizer->Add(pNavPanelSizer, NAVPANEL_PERCENT_SZE, wxALL|wxEXPAND);
pWndPage->Layout();
}
I assume that when I do pWndPage->SetSizer(pNewPageSizer); the sizer is
deallocated and that's why maybe it doesn't work.
So my question is how can I change the sizer tree to achieve what I want.
Thanks
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users