Loading/Saving AuI screen designs.

Is my concept wrong, but from my reading it should be possible to at any point
save the current aui-managed design to a file and re-load it to make it
exactly the same?

If so, I've failed miserably, the file contains a heap of data but can't seem
to re-consitute the screen display to the altered stated.

Could anyone give me a few lines of code which do this.

Thanks

Richard.

Hi Richard,

Is my concept wrong, but from my reading it should be possible to at any point
save the current aui-managed design to a file and re-load it to make it
exactly the same?

If so, I've failed miserably, the file contains a heap of data but can't seem
to re-consitute the screen display to the altered stated.

Could anyone give me a few lines of code which do this.

This is what I do in the PyAUI demo (which works the same for wx.aui):

1) Add you panes and build your desired configuration;
2) Call:

self.perspective_default = self._mgr.SavePerspective()

3) When you want to reload it, just do:

self._mgr.LoadPerspective(self.perspective_default)
self._mgr.Update()

I never tried doing it from a file, but in theory there shouldn't be
any difference. However, in order to make SavePerspective and
LoadPerspective work across different sessions of the program (open
the app, close the app, re-open the app) you should ensure that *all*
your panes have a Name(). Otherwise wx.aui will generate random name
which can not be restored on different sessions.
I believe the best thing you could do is to look at the wx.aui demo in
the wxPython distribution.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/

I know I've asked a similar question before but now that I have seen your PyAUI I am wondering if there is still a way. I have an AUINotebook and would like to optimally be able to SavePerspective and LoadPerspective, but apparently it uses its own manager internally and I can neither access that manager nor create my own to do this? Is there any way to do this, maybe using PyAUI? I see the actual controls themselves aren't implemented in Python so maybe not.

I would really love to at least be able to open two tab groups split down the middle with a tab in each at the beginning, and I would probably be happy with that, however I suspect if that is possible so is total persistence of the layout. Any ideas? I am comfortable with going into any of the python source if that helps, as this would really be helpful to be able to do.

Thanks,
Mike Rooney

···

-----Original Message-----
From: Andrea Gavana [mailto:andrea.gavana@gmail.com]
Sent: Monday, January 08, 2007 5:28 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Loading/Saving AuI screen designs.

Hi Richard,

Is my concept wrong, but from my reading it should be possible to at any point
save the current aui-managed design to a file and re-load it to make it
exactly the same?

If so, I've failed miserably, the file contains a heap of data but can't seem
to re-consitute the screen display to the altered stated.

Could anyone give me a few lines of code which do this.

This is what I do in the PyAUI demo (which works the same for wx.aui):

1) Add you panes and build your desired configuration;
2) Call:

self.perspective_default = self._mgr.SavePerspective()

3) When you want to reload it, just do:

self._mgr.LoadPerspective(self.perspective_default)
self._mgr.Update()

I never tried doing it from a file, but in theory there shouldn't be
any difference. However, in order to make SavePerspective and
LoadPerspective work across different sessions of the program (open
the app, close the app, re-open the app) you should ensure that *all*
your panes have a Name(). Otherwise wx.aui will generate random name
which can not be restored on different sessions.
I believe the best thing you could do is to look at the wx.aui demo in
the wxPython distribution.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Hi Mike,

I know I've asked a similar question before but now that I have seen your PyAUI
I am wondering if there is still a way. I have an AUINotebook and would like to
optimally be able to SavePerspective and LoadPerspective, but apparently it
uses its own manager internally and I can neither access that manager nor
create my own to do this?

It is correct. It appears that AUINotebook has its own manager, and we
wxPythoneers can't do anything about that. Moreover, even if we were
able to access it, it is not clear to me what happens, for example,
when you close an AUINotebook page: does the associated page get
destroyed? If this is the case, even if you can access the manager you
can not use LoadPerspective and SavePerspective once you allow the
close button to be active.

Is there any way to do this, maybe using PyAUI? I see the actual controls
themselves aren't implemented in Python so maybe not.

PyAUI does not have an implementation for AUINotebook: I created it
more than one year ago, when AUINotebook didn't exist. After wxAUI has
been integrated in wxWidgets and wrapped in wxPython, I dropped the
development of PyAUI because it was redundant, and no one showed
interested anymore in it.

I would really love to at least be able to open two tab groups split down the
middle with a tab in each at the beginning, and I would probably be happy with
that, however I suspect if that is possible so is total persistence of the layout.
Any ideas? I am comfortable with going into any of the python source if that
helps, as this would really be helpful to be able to do.

Well, actually having a Python implementation of the current wxAUI
would (in theory) solve many standing issues (some of them have been
there for more than one year):

- wxEVT_AUI_PANE_DOCKED/wxEVT_AUI_PANE_FLOATED, or whatever you want
to call them: the events that might be called when you dock/undock a
pane;
- A way to hack the source code without relying in what is private or
not private in the underlying C++ wrapped class (whatever "private"
means), so that anyone could work on it and maybe provide
improvements/patches;

And other issues as well, reported by PyAUI users in the past, which I
never implemented.

If you wish to dig inside source code, I have uploaded a new version
of PyAUI development here:

http://xoomer.alice.it/infinity77/eng/freeware.html#pyaui

This version contains:

1) The patch provided by Tim Ansell, which handles Maximize/Restore
behavior for panes;
2) A working implementation of ModernDockArt, an art manager for
Windows XP users (requiress Mark Hammond's win32all installed): it is
very nice in my opinion.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/

···

On 1/9/07, Rooney, Mike (ext. 324) wrote:

There’s AuiNotebook.Split:

void Split(size_t page, int direction)
Split performs a split operation programmatically. The argument page indicates the page that will be split off. This page will also become the active page after the split. The direction argument specifies where the pane should go, it should be one of the following: wxTOP, wxBOTTOM, wxLEFT, or wxRIGHT.

Cheers, Frank

···

2007/1/9, Rooney, Mike (ext. 324) mxr@qvii.com:

I would really love to at least be able to open two tab groups split down the middle with a tab in each at the beginning, and I would probably be happy with that, however I suspect if that is possible so is total persistence of the layout. Any ideas? I am comfortable with going into any of the python source if that helps, as this would really be helpful to be able to do.

Rooney, Mike (ext. 324) wrote:

I know I've asked a similar question before but now that I have seen
your PyAUI I am wondering if there is still a way. I have an
AUINotebook and would like to optimally be able to SavePerspective
and LoadPerspective, but apparently it uses its own manager
internally and I can neither access that manager nor create my own to
do this? Is there any way to do this, maybe using PyAUI? I see the
actual controls themselves aren't implemented in Python so maybe not.

The next release has an API for accessing the internal manager.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks Frank! This is very useful and was just what I was looking for. However I would love to know where you found it. That method doesn’t show up in the 2.8 wxWidgets docs for AuiNotebook (or any of its derived classes). Maybe there are more useful methods I don’t know about, such as one to adjust the position of the split? Doing a split doesn’t split it in the center but instead only a few pixels off of whatever direction I select.

Thanks again!

···

-----Original Message-----
From: fniessink@gmail.com [mailto:fniessink@gmail.com]On Behalf Of Frank Niessink
Sent:
Tuesday, January 09, 2007 4:01 PM
To:
wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Loading/Saving AuI screen designs.

2007/1/9, Rooney, Mike (ext. 324) mxr@qvii.com:

I would really love to at least be able to open two tab groups split down the middle with a tab in each at the beginning, and I would probably be happy with that, however I suspect if that is possible so is total persistence of the layout. Any ideas? I am comfortable with going into any of the python source if that helps, as this would really be helpful to be able to do.

There’s AuiNotebook.Split:

void Split(size_t page, int direction)
Split performs a split operation programmatically. The argument page indicates the page that will be split off. This page will also become the active page after the split. The direction argument specifies where the pane should go, it should be one of the following: wxTOP, wxBOTTOM, wxLEFT, or wxRIGHT.

Cheers, Frank

I found it in the wxWidgets docs, you have to look carefully at the end of the page for AuiNotebook. It’s hard to find because it’s not listed in the TOC for AuiNotebook.

If I look at the python source for the AuiNotebook (it’s in site-packages/wx-2.8…/wx/aui.py) I see there are several auxiliary classes such as AuiNotebookPage that have methods or properties that might do what you want (
e.g. AuiNotebookPage has a property ‘rect’, maybe that could be used to change its size?). However, the AuiNotebook itself doesn’t provide any options to get to those objects, they are carefully hidden by the current API. I guess there’s no other option than to wait for the next release that hopefully exposes more of AuiNotebook’s internals.

Cheers, Frank

···

2007/1/10, Rooney, Mike (ext. 324) mxr@qvii.com:

Thanks Frank! This is very useful and was just what I was looking for. However I would love to know where you found it. That method doesn’t show up in the 2.8 wxWidgets docs for AuiNotebook (or any of its derived classes). Maybe there are more useful methods I don’t know about, such as one to adjust the position of the split? Doing a split doesn’t split it in the center but instead only a few pixels off of whatever direction I select.