Do we need a new style for this?
Currently I use:
PM.PM_SAVE_RESTORE_AUI_PERSPECTIVES
maybe have something like:
PM.PM_SAVE_RESTORE_AUI_LAYOUTONLY_PERSPECTIVES
or
PM.PM_SAVE_RESTORE_AUI_NOCAPTION_PERSPECTIVES
Werner
This is a good idea but a bit complicated to implement: the pane
captions are restored inside the AUI code, and specifically when you
call LoadPerspective to load an existing perspective. It has been
argued in the past (although I can't find the thread right now) that
AUI shouldn't save and restore pane captions as they are
language/translation dependent. But nothing has been done to change
this behaviour, as far as I remember.
There is also a ticket for wxAUI about this:
http://trac.wxwidgets.org/ticket/12528
The only possibility I see at the moment is a convoluted approach in
which the pane captions are always stored in their original (default)
language in the perspective; then, when restoring the perspective, the
appropriate translation is applied for the pane caption. The whole
process requires keeping some kind of dictionary with Name -> Caption
and use that to flip through saving/loading translated captions. It's
a fair bit of work overall and I am not exactly sure I can get it
right...
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
That's a possibility as well, and I believe it will be easier to
implement than my original idea. I don't have a lot of time at the
moment but I'll see what I can do in the near future. Of course, if
you would like to give it a try and implement it yourself, I'll be
more than happy to apply patches (hint hint :-D ).
On 23/04/2012 13:49, Andrea Gavana wrote:
...
> That's a possibility as well, and I believe it will be easier to
> implement than my original idea. I don't have a lot of time at the
> moment but I'll see what I can do in the near future. Of course, if
> you would like to give it a try and implement it yourself, I'll be
> more than happy to apply patches (hint hint :-D ).
Hint hint has arrived:-) .
Will give it a try over the next few days.
Werner
On 23/04/2012 13:49, Andrea Gavana wrote:
....
> That's a possibility as well, and I believe it will be easier to
> implement than my original idea. I don't have a lot of time at the
> moment but I'll see what I can do in the near future. Of course, if
> you would like to give it a try and implement it yourself, I'll be
> more than happy to apply patches (hint hint :-D ).
Started to have a look at this and first just wanted to see if the
replace tactic would work, so no flag yet.
In the attached patch I save the caption loaded from code and then later
on restore it. Checking it through the debugger I can see that the
correct thing gets restored - BUT on screen I see the data from the
persist restore.
I searched but just don't see where else the caption is being reset
during the persist restore process.
If you have a tip on where else I should look, please let me know.
Will have another look at it this afternoon.
Werner
Now I need to figure out how/where to create the flag and how to pass it
around.
- I think the flag should be in persist and it passes it to
"framemanager.LoadPerspective". Are you o.k. with that approach?
Werner
On 25/04/2012 13:28, Andrea Gavana wrote:
...
> I think I got it, mixed up "p" and "pane" when doing the restore.
>
> Now I need to figure out how/where to create the flag and how to pass it
> around.
>
> - I think the flag should be in persist and it passes it to
> "framemanager.LoadPerspective". Are you o.k. with that approach?
Attached a proposed patch. Please review carefully the stuff in
persist_handler as I don't really know what I am
doing with extracting/calculating on flags, i.e. would it work when one
uses/adds other flags.
> I think that would be OK, thank you for your contribution.
It is nothing compared to all the stuff you do for wxPython, so thanks
to you;-) .
Werner