Ive converted one of my vb apps over to using AUI and have it running ok - (my
drug reference for my clnical desktop).
Quesions:
(Could someone please give actual code examples as many of you will know from
this list I'm a programming cretin and need something concrete, not just a
vague reference as I can't read the wx Docs properly).
1) Can one dyamically change the caption title - if so how
2) Can one programatically minimize a maximized window after the program has
started.
- I've a panel where the user can search for drugs by generic names or
indications, get a list of brands, and underneath that the product
information is showing. However one can maximize the product info to make
viewing easier - however if the search critera is reset, then the maximized
window stays maximize.
> 1) Can one dyamically change the caption title - if so how
Uhm, you may try something like:
MyPane = self._mgr.GetPane("TheNameOfYourPane")
MyPane.Caption("Hello My New Caption")
self._mgr.Update()
Please remember that GetPane() works with the *name* of your pane, not
with the caption title.
> 2) Can one programatically minimize a maximized window after the program
> has started.
I think you could do the same as before (not sure about the behavior
of Restore() though):
MyPane = self._mgr.GetPane("TheNameOfYourPane")
if MyPane.IsMaximized():
MyPane.Restore()
self._mgr.Update()
Dosn't work, however I've found a solution.
BTW .Restore() dosn't seem documented, however it does reduced the window size
back to what it was last set up, (not what it was first designed at).
What dosn't happen is that the panel that the aui-manager hiid to make room
for the maximized window stays hidden, so that you just end up with a blank
space above your original window, so one has to implicity do a
_mgr.GetPanel('name".Show()
i.e what seemed to work was:
if self._mgr.GetPane("the maximized panel").IsMaximized():
self._mgr.GetPanel("the maximized pane").Restore()
self._mgr.GetPane("the other pane that was hidden").Show()
self._mgr.Update()
Is that the best way?
Richard
···
On Monday 08 January 2007 08:47, Andrea Gavana wrote:
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
if self._mgr.GetPane("the maximized panel").IsMaximized():
self._mgr.GetPanel("the maximized pane").Restore()
self._mgr.GetPane("the other pane that was hidden").Show()
self._mgr.Update()
Is that the best way?
I have no idea if this is the best way or not. However, if you have a
lot of panels, does this mean that you have to cycle through all of
them to Show() them one by one? It seems like an overkill, and an ugly
behavior for a so well-written user interface manager like wxAUI.
Maybe Robin can shed some light on this...
BTW, have you tried something like:
1) Save the perspective you want to restore;
2) The user does whatever he wants with the GUI;
3) When you want to programmatically restore you setup, you just call:
self._mgr.LoadPerspective(yourPerspective)
self._mgr.Update()
I realize it might not be what you want, but I run out of better suggestions...
> i.e what seemed to work was:
>
> if self._mgr.GetPane("the maximized panel").IsMaximized():
> self._mgr.GetPanel("the maximized pane").Restore()
> self._mgr.GetPane("the other pane that was hidden").Show()
> self._mgr.Update()
>
> Is that the best way?
I have no idea if this is the best way or not. However, if you have a
lot of panels, does this mean that you have to cycle through all of
them to Show() them one by one? It seems like an overkill, and an ugly
behavior for a so well-written user interface manager like wxAUI.
Maybe Robin can shed some light on this...
Robin's comment would be interesting. About 18/12 ago I implemented a panel
swapping thingy way way less sophisticated than AUI but it essentially did
the same thing.
When I was mucking around with this last night, I noticed that if one did a
restore, then the re-ran the program, the sizer that the maximised panel had
replaced was no longer visible - so obviously the aui stuff removes it (or
any other panels) from the sizer it uses, and then when minimizes, replaces
them again. There must be a command in there somwhere that responds to the
user clicking on the minize button to do all that, that one could access.
BTW, have you tried something like:
1) Save the perspective you want to restore;
2) The user does whatever he wants with the GUI;
3) When you want to programmatically restore you setup, you just call:
self._mgr.LoadPerspective(yourPerspective)
self._mgr.Update()
Yes I did - the data seems to exist in the file and have tried the above., I
did post a question about it a few weeks ago, I'll have to re-visit the
problem.
richard
···
On Tuesday 09 January 2007 09:10, Andrea Gavana wrote:
On 1/8/07, Richard Terry wrote:
I realize it might not be what you want, but I run out of better
suggestions...
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
if self._mgr.GetPane("the maximized panel").IsMaximized():
self._mgr.GetPanel("the maximized pane").Restore()
self._mgr.GetPane("the other pane that was hidden").Show()
self._mgr.Update()
Is that the best way?
I haven't used wxAUI a whole lot yet, but I don't see anything else in the code that would make this any easier. Of course if you have other references to the panes you wouldn't have to look them up by name each time you use them, and that would simplify the above a bit...
I have no idea if this is the best way or not. However, if you have a
lot of panels, does this mean that you have to cycle through all of
them to Show() them one by one? It seems like an overkill, and an ugly
behavior for a so well-written user interface manager like wxAUI.
Maybe Robin can shed some light on this...
Robin's comment would be interesting. About 18/12 ago I implemented a panel swapping thingy way way less sophisticated than AUI but it essentially did the same thing.
When I was mucking around with this last night, I noticed that if one did a restore, then the re-ran the program, the sizer that the maximised panel had replaced was no longer visible - so obviously the aui stuff removes it (or any other panels) from the sizer it uses, and then when minimizes, replaces them again. There must be a command in there somwhere that responds to the user clicking on the minize button to do all that, that one could access.
Yep, the manager creates and destroys sizers on the fly as it needs them. You should probably consider them to be just "implementation details" and not depend on their presence in any way.
···
On Tuesday 09 January 2007 09:10, Andrea Gavana wrote:
On 1/8/07, Richard Terry wrote:
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!