I'm trying to use SavePerspective and LoadPerspective of AuiManager. This works fairly well except that the orientation of a docked AuiToolBar is not restored properly by LoadPerspective.
A complete test program is included below. To reproduce the problem, start the program, use the menu item Perspective->Save, move the toolbar from the top and dock it on the left or right side. The toolbar changes orientation as it should and becomes vertical. Now use the menu item Perspective->Load. The toolbar is moved back to the saved position, but it is still vertically oriented. The same thing happens if the other direction, if the perspective is saved with the toolbar in the vertical direction and the toolbar is moved to the horizontal direction and the perspective is loaded.
The fix seems to be easy, edit wx/lib/agw/aui/framemanager.py and remove the comment below in the DoUpdate method:
if p.IsToolbar():
# self.SwitchToolBarOrientation(p)
p.best_size = p.window.GetBestSize()
With this change the toolbar orientation is updated on LoadPerspective.
I'm trying to use SavePerspective and LoadPerspective of AuiManager. This works fairly well except that the orientation of a docked AuiToolBar is not restored properly by LoadPerspective.
A complete test program is included below. To reproduce the problem, start the program, use the menu item Perspective->Save, move the toolbar from the top and dock it on the left or right side. The toolbar changes orientation as it should and becomes vertical. Now use the menu item Perspective->Load. The toolbar is moved back to the saved position, but it is still vertically oriented. The same thing happens if the other direction, if the perspective is saved with the toolbar in the vertical direction and the toolbar is moved to the horizontal direction and the perspective is loaded.
The fix seems to be easy, edit wx/lib/agw/aui/framemanager.py and remove the comment below in the DoUpdate method:
With this change the toolbar orientation is updated on LoadPerspective.
System info:
Ubuntu 16.04 Python version: 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609]
wxWidgets version: 4.0.3 gtk3 (phoenix) wxWidgets 3.0.5
which I installed with:
pip install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython
Test program: