I found out why the second issue is
happening. The ‘EVT_CAPTIONBAR’ is handled by every
FoldPanelBar instance, each one looks at event.GetFoldStatus().
The event is bound to
a specific CaptionBar, and only the first
time is the state of that captionbar changed; in the
other cases, the OnPressCaption handler
sees the new state of the original bar and changes
its own bar to the opposite state.
So, each expand or collapse of a panel also
changes all containing panels to the opposite state.
This problem goes away if I remove the ‘event.Skip()’
at the bottom of FoldPanelBar.OnPressCaption(), but I don’t
know if that creates other problems.
···
From: Gavana, Andrea
[mailto:gavana@kpo.kz]
Sent: Thursday, April 27, 2006
4:08 AM
To:
wxPython-users@lists.wxwidgets.org
Subject: RE: [wxPython-users]
Nested FoldPanelBars
Hello Gregory & NG,
The first problem is that FoldPanelBars, it seems, are
meant to be created with a fixed size, or to resize
themselves according to the containing frame, rather
than resizing themselves to fit the contents. Whenever I create
a bar, I have to Fit() all of its subpanels, and then
find the size of the whole thing, so that it’s only big
enough to contain its subpanels. That doesn’t seem
to be available as a built-in function, maybe I missed
it. That’s not really a problem; the bigger issue
is that when you collapse panels in a nested FoldPanelBar,
the FPB itself needs to get smaller so that the panel of
the containing FPB can get smaller; otherwise,
you’re not saving space by collapsing inner
panels. Likewise the containing FPB needs to get smaller
so that panels below it can move up (and all get bigger
when things are expanded).
I imagine there’s a way to this using all the
internal sizing events in the FPB, but I would appreciate some pointers.
I am having some troubles in correctly understanding your
problem here… it may be my limited knowledge of english, but if you could
provide a snippet of code that reproduce the problem it would help me (and
others) really a lot. BTW, I don’t remember I had to calculate any size when
using FPB, for the bar or for the contained panes… but surely I didn’t
understand what you meant here.
I have never tried nested FPBs, but I don’t see why they
shouldn’t work. Can you please post some code that shows the problem?
Thank you.
Andrea.
Andrea Gavana (gavana@kpo.kz)
Reservoir Engineer
KPDL
4, Millbank
SW1P 3JA London
Direct Tel: +44 (0) 20 717 08936
Mobile Tel: +44 (0) 77 487 70534
Fax: +44 (0) 20 717 08900
Web: http://xoomer.virgilio.it/infinity77
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯