aui LoadPerspective with a new window
Riccardo Cohen
rcohen at articque.com
Wed Feb 13 02:12:50 PST 2008
yes but the dock_size are not restored in your code, because you restore
individual panes only. I tried my method :
art_bool doupdate=art_false;
wxAuiPaneInfoArray panes=main->m_auiManager.GetAllPanes();
main->m_auiManager.LoadPerspective(per->get_sys_(),true);
int idxpane;
for (idxpane=0;idxpane<panes.Count();idxpane++)
{
wxSize size=panes[idxpane].window->GetSize();
if (panes[idxpane].state&wxAuiPaneInfo::optionHidden ||
size.GetWidth()==0 || size.GetHeight()==0)
{
wxAuiPaneInfo
&newpaneinfo=main->m_auiManager.GetPane(panes[idxpane].name);
newpaneinfo.SafeSet(panes[idxpane]);
doupdate=art_true;
}
}
if (doupdate)
main->m_auiManager.Update();
and it seems to work for my case at least. the test "optionHidden" can
be removed if hidden panes are managed by the application.
Leslie Newell wrote:
> That code will work if the pane is visible or not. If a pane exists in
> the perspective but not in AUI it is imply ignored. If a pane exists in
> AUI (visible or not) but not in the perspective it is untouched. This
> way you can safely add or remove panes in code without any unpleasant
> side effects.
>
> Les
>
> Riccardo Cohen wrote:
>> Thanks a lot for that piece of code. I'll try this way. But I think
>> that one little patch could be applied : after LoadPerspective, it
>> should be easy to check if some pane are not visible (ideally also not
>> in screen), and build a new paneinfo for these.
>>
>> I tried to do that, but I could not find the way of checking if a pane
>> is visible...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>
--
Très cordialement,
Riccardo Cohen
-------------------------------------------
Articque
http://www.articque.com
149 av Général de Gaulle
37230 Fondettes - France
tel : 02-47-49-90-49
fax : 02-47-49-91-49
More information about the wx-users
mailing list