LoadPerspective and managed window's size

Harry harry dot news at armadillo dot fr
Mon Apr 14 09:15:39 PDT 2008



Riccardo,

If the size of the managed window is correct on 2.9 I might look at 
using AUI from there.
Where can I find the latest sources ?
(And the fix you describe below is very welcome.)

Note: I have fixed an abort in AUI. Does that interest you, or should I 
just submit the patch ?

Regards
Harry

Riccardo Cohen wrote:
> we use 2.9 on mac, linux and windows, and load/save perspective works 
> fine even for window size (dock or float).
> Of course it is not perfect, but I never noticed a problem with window 
> size.
> The only problem I found is that LoadPerspective() would hide a window 
> that is present in the pane before load, but not present in the saved 
> perspective.
> I just added a little check after load to avoid the panel hiding :
>
>   wxAuiPaneInfoArray panes=main->m_auiManager.GetAllPanes();
>   main->m_auiManager.LoadPerspective(per->get_sys_(),false);
>   int idxpane;
>   for (idxpane=0;idxpane<(int)panes.Count();idxpane++)
>   {
>     wxAuiPaneInfo 
> &newpaneinfo=main->m_auiManager.GetPane(panes[idxpane].name);
>     wxSize size=newpaneinfo.window->GetSize();
>     if (newpaneinfo.state&wxAuiPaneInfo::optionHidden || 
> size.GetWidth()==0 || size.GetHeight()==0)
>       // if bad pane => get back to original
>       newpaneinfo.SafeSet(panes[idxpane]);
>     else
>       // else reset original title only
>       newpaneinfo.Caption(panes[idxpane].caption);
>   }
>   main->m_auiManager.Update();
>
>
> Patrick Steele wrote:
>> I didn't find the saving / loading to decently work either, so like
>> Nikolay I wrote my own. I designed an xml-ish version that would save
>> and load out all relative pane information. It was custom code for a
>> previous company, so I can't share it out, but that's probably the
>> best way to go.
>> Patrick
>>


More information about the wx-users mailing list