问题
I am using wxwidget in windows. I have GUI which has several tabs. The requirements is user should have possibility resize the frame when switching between tabs. Now the current code is written like this. void XTab::OnPageChanged(wxNotebookEvent & event) { if(isActive()) { int page = event.GetOldSelection(); if(page!=-1) { XPanel * panel = (XPanel*)GetPage(page); panel->onUIDeactivate(); } page = event.GetSelection(); if(page!=-1) { XPanel * panel = (XPanel*)GetPage(page); xdmlASSERT(!panel->isActive()); panel->onUIActivate(); } RecalcSize(); DFrame::UpdateLayout(this);
Where Dframe is derived from wxFrame and XPanel is derived from wxPanel and XTab is from wxNotebook. Is there any I am using sizers in my code to put all child windows. panel is added to sizers and all child windows are in panel. RecalcSize() is againg caling GetSizer()->CalcMin() to get the minimum required size of frame. If user has resized frame this modified size should persist when switching between tabs. Currently this is not happening. How to achieve this?
来源:https://stackoverflow.com/questions/22937980/wxframe-resizing-in-wxnotebook