Home | Trees | Index | Help |
|
---|
Package wx :: Package lib :: Module foldpanelbar :: Class FoldPanelBar |
|
object
--+ |Object
--+ |EvtHandler
--+ |Window
--+ |Panel
--+ | FoldPanelBar
The FoldPanelBar is a class which can maintain a list of collapsable panels. Once a panel is collapsed, only it's caption bar is visible to the user. This will provide more space for the other panels, or allow the user to close panels which are not used often to get the most out of the work area.
This control is easy to use. Simply create it as a child for a
panel or sash window, and populate panels with
AddFoldPanel
. Then use the AddFoldPanelWindow
to add
wx.Window
derived controls to the current fold panel. Use
AddFoldPanelSeparator
to put separators between the groups of
controls that need a visual separator to group them
together. After all is constructed, the user can fold the panels
by doubleclicking on the bar or single click on the arrow, which
will indicate the collapsed or expanded state.
Method Summary | |
---|---|
Default Class Constructor. | |
Adds a fold panel to the list of panels. | |
Adds a separator line to the current FoldPanel. | |
Adds a wx.Window derived instance to the referenced
FoldPanel. | |
Sets the style of the caption bar ( CaptionBar ) of the
FoldPanel. | |
Sets the style of all the caption bars of the FoldPanel. | |
Collapses the given FoldPanel reference, and updates the foldpanel bar. | |
Expands the given FoldPanel reference, and updates the foldpanel bar. | |
Returns the currently used caption style for the FoldPanel. | |
Returns the number of panels in the FoldPanelBar. | |
Returns the panel associated with the index "item". | |
Returns the length of the panels that are expanded and collapsed. | |
Returns whether the CaptionBar has default orientation or not. | |
Handles the EVT_CAPTIONBAR event in the FoldPanelBar. | |
Handles the EVT_SIZE event for the FoldPanelBar. | |
Resizes the fold panels so they match the width. | |
Refreshes all the panels from given index down to last one. | |
Repositions all the collapsed panels to the bottom. |
Property Summary |
---|
Class Variable Summary | |
---|---|
CaptionBarStyle |
EmptyCaptionBarStyle = <wx.lib.foldpanelbar.CaptionBarSt...
|
Instance Method Details |
---|
__init__(self,
parent,
id=-1,
pos=wx.Point(-1, -1),
size=wx.Size(-1, -1),
style=2621440,
extraStyle=0)
|
AddFoldPanel(self, caption='', collapsed=False, foldIcons=None, cbstyle=<wx.lib.foldpanelbar.CaptionBarStyle instance at 0xb490ceac>)Adds a fold panel to the list of panels. If the flag collapsed is set to True, the panel is collapsed initially. The FoldPanel item which is returned, can be used as a reference to perform actions upon the fold panel like collapsing it, expanding it, or deleting it from the list. Use this foldpanel to add windows to it. Please consult
|
AddFoldPanelSeparator(self, panel, colour=..., Spacing=8, leftSpacing=2, rightSpacing=2)Adds a separator line to the current FoldPanel. The seperator is a simple line which is drawn and is no real
component. It can be used to separate groups of controls
which belong to each other. The colour is adjustable, and it
takes the same Spacing, leftSpacing and rightSpacing as
|
AddFoldPanelWindow(self, panel, window, flags=1, Spacing=8, leftSpacing=2, rightSpacing=2)Adds a IMPORTANT: Make the window be a child of the FoldPanel. See example that follows. The flags to be used are:
The wx.Window to be added can be slightly indented from left and right so it is more visibly placed in the FoldPanel. Use Spacing > 0 to give the control an y offset from the previous wx.Window added, use leftSpacing to give it a slight indent from the left, and rightSpacing also reserves a little space on the right so the wxWindow can be properly placed in the FoldPanel. The following example adds a FoldPanel to the FoldPanelBar and adds two wx.Window derived controls to the FoldPanel: # create the FoldPanelBar >>> m_pnl = FoldPanelBar(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, FPB_DEFAULT_STYLE, FPB_COLLAPSE_TO_BOTTOM) # add a foldpanel to the control. "Test me" is the caption and it is # initially not collapsed. >>> item = m_pnl.AddFoldPanel("Test me", False) # now add a button to the fold panel. Mind that the button should be # made child of the FoldPanel and not of the main form. >>> m_pnl.AddFoldPanelWindow(item, wx.Button(item, ID_COLLAPSEME, "Collapse Me")) # add a separator between the two controls. This is purely a visual # line that can have a certain color and also the indents and width # aligning like a control. >>> m_pnl.AddFoldPanelSeparator(item) # now add a text ctrl. Also very easy. Align this on width so that # when the control gets wider the text control also sizes along. >>> m_pnl.AddFoldPanelWindow(item, wx.TextCtrl(item, wx.ID_ANY, "Comment"), FPB_ALIGN_WIDTH, FPB_DEFAULT_SPACING, 20) |
ApplyCaptionStyle(self, foldpanel, cbstyle)Sets the style of the caption bar ( The changes are applied immediately. All styles not set in the
CaptionBarStyle class are not applied. Use the CaptionBar
reference to indicate what captionbar you want to apply the
style to. To apply one style to all CaptionBar items, use
|
ApplyCaptionStyleAll(self, cbstyle)Sets the style of all the caption bars of the FoldPanel. The changes are applied immediately. |
Collapse(self, foldpanel)Collapses the given FoldPanel reference, and updates the foldpanel bar. In the FPB_COLLAPSE_TO_BOTTOM style, all collapsed captions are put at the bottom of the control. In the normal mode, they stay where they are. |
Expand(self, foldpanel)Expands the given FoldPanel reference, and updates the foldpanel bar. In the FPB_COLLAPSE_TO_BOTTOM style, they will be removed from the bottom and the order where the panel originally was placed is restored. |
GetCaptionStyle(self, foldpanel)Returns the currently used caption style for the FoldPanel. It is returned as a CaptionBarStyle class. After modifying it, it can be set again. |
GetCount(self)Returns the number of panels in the FoldPanelBar. |
GetFoldPanel(self, item)Returns the panel associated with the index "item". See the example at the bottom of the module, especially the events for the "Collapse Me" and "Expand Me" buttons. |
GetPanelsLength(self, collapsed, expanded)Returns the length of the panels that are expanded and collapsed. This is useful to determine quickly what size is used to display, and what is left at the bottom (right) to align the collapsed panels. |
IsVertical(self)Returns whether the CaptionBar has default orientation or not. Default is vertical. |
OnPressCaption(self, event)Handles the EVT_CAPTIONBAR event in the FoldPanelBar. |
OnSizePanel(self, event)Handles the EVT_SIZE event for the FoldPanelBar. |
RedisplayFoldPanelItems(self)Resizes the fold panels so they match the width. |
RefreshPanelsFrom(self, item)Refreshes all the panels from given index down to last one. |
RepositionCollapsedToBottom(self)Repositions all the collapsed panels to the bottom. When it is not possible to align them to the bottom, stick them behind the visible panels. The Rect holds the slack area left between last repositioned panel and the bottom panels. This needs to get a refresh. |
Class Variable Details |
---|
EmptyCaptionBarStyle
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:12:20 2007 | http://epydoc.sf.net |