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¶
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¶
- class FoldPanelItem(wx.Panel)¶
This class is a child sibling of the
FoldPanelBarclass. It will contain aCaptionBarclass for receiving of events, and a the rest of the area can be populated by aPanelderived class.
Methods¶
- __init__(self, parent, id=wx.ID_ANY, caption='', foldIcons=None, collapsed=False, cbstyle=None)¶
Default class constructor.
- Parameters:
parent – the
FoldPanelItemparent 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.ImageListcontaining the icons to display next to the caption text;collapsed –
Trueif theCaptionBarshould start in the collapsed state,Falseotherwise;cbstyle – the
CaptionBarwindow style. Must be an instance ofCaptionBarStyle.
- 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.
- Parameters:
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.Windowadded;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.
- Parameters:
window – an instance of
wx.Window;flags – can be one of the following bits:
Align Flag
Value
Description
FPB_ALIGN_WIDTH1
The
wx.Windowto be added will be aligned to fit the width of the FoldPanel when it is resized. Very handy for sizer items, buttons and text boxes.FPB_ALIGN_LEFT0
Aligns left instead of fitting the width of the child window to be added. Use either this one or
FPB_ALIGN_WIDTH.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_WIDTHis 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
CaptionBarStyleclass.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,
Trueis returned.
- IsVertical(self)¶
Returns whether the
CaptionBarhas default orientation or not. Default is vertical.
- OnPaint(self, event)¶
Handles the
wx.EVT_PAINTevent forFoldPanelItem.- Parameters:
event – a
PaintEventevent to be processed.
- OnPressCaption(self, event)¶
Handles the
wx.EVT_CAPTIONBARevent forFoldPanelItem.- Parameters:
event – a
CaptionBarEventevent to be processed.
- Reposition(self, pos)¶
Repositions this
FoldPanelItemand reports the length occupied for the nextFoldPanelItemin the list.- Parameters:
pos – the new item position.
- ResizePanel(self)¶
Resizes the panel.