
wx.lib.agw.foldpanelbar.FoldPanelItem¶This class is a child sibling of the FoldPanelBar class. It will
contain a CaptionBar class for receiving of events, and a the
rest of the area can be populated by a Panel derived class.
Class Hierarchy¶
Inheritance diagram for class FoldPanelItem:

Known Superclasses¶
Methods Summary¶Default class constructor. |
|
Adds a separator item to the list of items on this panel. |
|
Adds a window item to the list of items on this panel. |
|
Applies the style defined in cbstyle to the |
|
Internal method. |
|
Internal method. |
|
Returns height of caption only. This is for folding calculation purposes. |
|
Returns the current style of the captionbar in a |
|
Returns item’s position. |
|
Returns size of panel. |
|
Returns expanded or collapsed status. If the panel is |
|
Returns whether the |
|
Handles the |
|
Handles the |
|
Repositions this |
|
Resizes the panel. |
Class API¶FoldPanelItem(wx.Panel)¶This class is a child sibling of the FoldPanelBar class. It will
contain a CaptionBar class for receiving of events, and a the
rest of the area can be populated by a Panel derived class.
__init__(self, parent, id=wx.ID_ANY, caption="", foldIcons=None, collapsed=False, cbstyle=None)¶Default class constructor.
parent – the FoldPanelItem parent window;
id – an identifier for the control: a value of -1 is taken to mean a default;
caption – the string to be displayed in CaptionBar;
foldIcons – an instance of wx.ImageList containing the icons to display
next to the caption text;
collapsed – True if the CaptionBar should start in the collapsed state,
False otherwise;
cbstyle – the CaptionBar window style. Must be an instance of
CaptionBarStyle.
AddSeparator(self, colour=wx.BLACK, spacing=FPB_DEFAULT_SPACING, leftSpacing=FPB_DEFAULT_LEFTSPACING, rightSpacing=FPB_DEFAULT_RIGHTSPACING)¶Adds a separator item to the list of items on this panel.
colour – the separator colour, an instance of wx.Colour;
spacing – the separator to be added can be slightly indented from
left and right so it is more visibly placed in the fold panel. Use spacing > 0
to give the control an y offset from the previous wx.Window added;
leftSpacing – give the added separator a slight indent from the left;
rightSpacing – give the added separator a slight indent from the right.
AddWindow(self, window, flags=FPB_ALIGN_WIDTH, spacing=FPB_DEFAULT_SPACING, leftSpacing=FPB_DEFAULT_LEFTLINESPACING, rightSpacing=FPB_DEFAULT_RIGHTLINESPACING)¶Adds a window item to the list of items on this panel.
window – an instance of wx.Window;
flags – can be one of the following bits:
Align Flag |
Value |
Description |
|---|---|---|
|
1 |
The |
|
0 |
Aligns left instead of fitting the width of the child window to be added. Use either this one or |
spacing – reserves a number of pixels before the window element;
leftSpacing – an indent, in pixels;
rightSpacing – a right spacing, only relevant when the style
FPB_ALIGN_WIDTH is chosen.
ApplyCaptionStyle(self, cbstyle)¶Applies the style defined in cbstyle to the CaptionBar.
Collapse(self)¶Internal method.
This should not be called by the user, because it doesn’t trigger the parent to tell it that we are collapsed or expanded, it only changes visual state.
Expand(self)¶Internal method.
This should not be called by the user, because it doesn’t trigger the parent to tell it that we are collapsed or expanded, it only changes visual state.
GetCaptionLength(self)¶Returns height of caption only. This is for folding calculation purposes.
GetCaptionStyle(self)¶Returns the current style of the captionbar in a CaptionBarStyle class.
This can be used to change and set back the changes.
GetItemPos(self)¶Returns item’s position.
GetPanelLength(self)¶Returns size of panel.
IsExpanded(self)¶Returns expanded or collapsed status. If the panel is
expanded, True is returned.
IsVertical(self)¶Returns whether the CaptionBar has default orientation or not.
Default is vertical.
OnPaint(self, event)¶Handles the wx.EVT_PAINT event for FoldPanelItem.
event – a PaintEvent event to be processed.
OnPressCaption(self, event)¶Handles the wx.EVT_CAPTIONBAR event for FoldPanelItem.
event – a CaptionBarEvent event to be processed.
Reposition(self, pos)¶Repositions this FoldPanelItem and reports the length occupied
for the next FoldPanelItem in the list.
pos – the new item position.
ResizePanel(self)¶Resizes the panel.