LoadPerspective and managed window's size

Riccardo Cohen rcohen at articque.com
Mon Apr 14 07:00:43 PDT 2008


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
> 
> 
> 
> 
> 
> On Sun, Apr 13, 2008 at 10:10 PM, dot news at armadillo dot
> fr"@riobu.com Harry <"harry> wrote:
>>
>>
>>  Thanks, that's equally my conclusion.
>>  I also conclude that the developers of AUI don't contribute to this group.
>>
>>  Tyushkov Nikolay wrote:
>>
>>> Hello
>>>
>>> My experience shows that SavePerspective does not save any information
>> about window size. So, I  save\restore window size and  position manually.
>>>
>>>
>>>> Somehow I almost never get any answers when I ask about AUI.
>>>>
>>>> Harry wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> AUI question: One would expect LoadPerspective() on an AUI managed
>> window to return its state
>>>>> to exactly as when I did the SavePerspective().
>>>>> However, while all the panes are displayed correctly, the managed
>> window's size doesn't change.
>>>>> In other words, if I resize the managed window, do SavePerspective(),
>> resize again
>>>>> and do LoadPerspective(), then the managed window is not resized back.
>>>>>
>>>>> Is this behavior by design ?
>>>>>
>>  _______________________________________________
>>  wx-users mailing list
>>  wx-users at lists.wxwidgets.org
>>  http://lists.wxwidgets.org/mailman/listinfo/wx-users
>>
> _______________________________________________
> wx-users mailing list
> wx-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-users
> 

-- 
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