Package wx :: Package lib :: Module foldpanelbar
[frames | no frames]

Module wx.lib.foldpanelbar

The FoldPanelBar is a control that contains multiple panels (of type FoldPanelItem) that can be expanded or collapsed. The captionbar of the FoldPanel can be customized by setting it to a horizontal gradient style, vertical gradient style, a single color, a rectangle or filled rectangle. The FoldPanel items can be collapsed in place or to the bottom of the control. wx.Window derived controls can be added dynamically, and separated by separator lines. FoldPanelBar is freeware and distributed under the wxPython license.

How does it work

The internals of the FoldPanelBar is a list of FoldPanelItem objects. Through the reference of FoldPanel these panels can be controlled by adding new controls to a FoldPanel or adding new FoldPanels to the FoldPanelBar. The CaptionBar fires events to the parent (container of all panel items) when a sub-panel needs resizing (either folding or expanding). The fold or expand process is simply a resize of the panel so it looks like all controls on it are gone. All controls are still child of the FoldPanel they are located on. If they don't handle the event (and they won't) then the owner of the FoldPanelBar gets the events. This is what you need to handle the controls. There isn't much to it just a lot of calculations to see what panel belongs where. There are no sizers involved in the panels, everything is purely x-y positioning.

What can it do and what not?

  1. What it can do:
    • Run-time addition of panels (no deletion just yet)
    • Run time addition of controls to the panel (it will be resized accordingly)
    • Creating panels in collapsed mode or expanded mode
    • Various modes of caption behaviour and filling to make it more appealing
    • Panels can be folded and collapsed (or all of them) to allow more space
  2. What it cannot do:

    • Selection of a panel like in a list ctrl
    • Dragging and dropping the panels
    • Re-ordering the panels (not yet)

Supported platforms

FoldPanelBar is supported on the following platforms:
  • Windows (Verified on Windows XP, 2000)
  • Linux/Unix (GTK2) (Thanks To Toni Brkic And Robin Dunn)
  • Mac OSX (Thanks To Robin Dunn For The CaptionBar Size Patch)

FoldPanelBar is based upon Jorgen Bodde's C++ implementation. Latest Revision: Andrea Gavana @ 05 Nov 2005, 23.30 CET


Classes
CaptionBar This class is a graphical caption component that consists of a caption and a clickable arrow.
CaptionBarEvent This event will be sent when a EVT_CAPTIONBAR is mapped in the parent.
CaptionBarStyle This class encapsulates the styles you wish to set for the CaptionBar (this is the part of the FoldPanel where the caption is displayed).
FoldPanelBar The FoldPanelBar is a class which can maintain a list of collapsable panels.
FoldPanelItem This class is a child sibling of the FoldPanelBar class.
FoldWindowItem This class is a child sibling of the FoldPanelItem class.

Function Summary
  GetCollapsedIconBitmap()
  GetCollapsedIconData()
  GetCollapsedIconImage()
  GetExpandedIconBitmap()
  GetExpandedIconData()
  GetExpandedIconImage()

Variable Summary
int CAPTIONBAR_FILLED_RECTANGLE = 5                                                                     
int CAPTIONBAR_GRADIENT_H = 2                                                                     
int CAPTIONBAR_GRADIENT_V = 1                                                                     
int CAPTIONBAR_NOSTYLE = 0                                                                     
int CAPTIONBAR_RECTANGLE = 4                                                                     
int CAPTIONBAR_SINGLE = 3                                                                     
PyEventBinder EVT_CAPTIONBAR = <wx._core.PyEventBinder object at 0xb49...
int FPB_ALIGN_LEFT = 0                                                                     
int FPB_ALIGN_WIDTH = 1                                                                     
int FPB_BMP_RIGHTSPACE = 2                                                                     
int FPB_COLLAPSE_TO_BOTTOM = 2                                                                     
int FPB_DEFAULT_EXTRASTYLE = 0                                                                     
int FPB_DEFAULT_LEFTLINESPACING = 2                                                                     
int FPB_DEFAULT_LEFTSPACING = 5                                                                     
int FPB_DEFAULT_RIGHTLINESPACING = 2                                                                     
int FPB_DEFAULT_RIGHTSPACING = 10                                                                    
int FPB_DEFAULT_SPACING = 8                                                                     
int FPB_DEFAULT_STYLE = 2621440                                                               
int FPB_EXCLUSIVE_FOLD = 4                                                                     
int FPB_EXTRA_X = 10                                                                    
int FPB_EXTRA_Y = 4                                                                     
int FPB_HORIZONTAL = 4                                                                     
int FPB_SINGLE_FOLD = 1                                                                     
int FPB_VERTICAL = 8                                                                     
int wxEVT_CAPTIONBAR = 10316                                                                 

Variable Details

CAPTIONBAR_FILLED_RECTANGLE

Type:
int
Value:
5                                                                     

CAPTIONBAR_GRADIENT_H

Type:
int
Value:
2                                                                     

CAPTIONBAR_GRADIENT_V

Type:
int
Value:
1                                                                     

CAPTIONBAR_NOSTYLE

Type:
int
Value:
0                                                                     

CAPTIONBAR_RECTANGLE

Type:
int
Value:
4                                                                     

CAPTIONBAR_SINGLE

Type:
int
Value:
3                                                                     

EVT_CAPTIONBAR

Type:
PyEventBinder
Value:
<wx._core.PyEventBinder object at 0xb490cdec>                          

FPB_ALIGN_LEFT

Type:
int
Value:
0                                                                     

FPB_ALIGN_WIDTH

Type:
int
Value:
1                                                                     

FPB_BMP_RIGHTSPACE

Type:
int
Value:
2                                                                     

FPB_COLLAPSE_TO_BOTTOM

Type:
int
Value:
2                                                                     

FPB_DEFAULT_EXTRASTYLE

Type:
int
Value:
0                                                                     

FPB_DEFAULT_LEFTLINESPACING

Type:
int
Value:
2                                                                     

FPB_DEFAULT_LEFTSPACING

Type:
int
Value:
5                                                                     

FPB_DEFAULT_RIGHTLINESPACING

Type:
int
Value:
2                                                                     

FPB_DEFAULT_RIGHTSPACING

Type:
int
Value:
10                                                                    

FPB_DEFAULT_SPACING

Type:
int
Value:
8                                                                     

FPB_DEFAULT_STYLE

Type:
int
Value:
2621440                                                               

FPB_EXCLUSIVE_FOLD

Type:
int
Value:
4                                                                     

FPB_EXTRA_X

Type:
int
Value:
10                                                                    

FPB_EXTRA_Y

Type:
int
Value:
4                                                                     

FPB_HORIZONTAL

Type:
int
Value:
4                                                                     

FPB_SINGLE_FOLD

Type:
int
Value:
1                                                                     

FPB_VERTICAL

Type:
int
Value:
8                                                                     

wxEVT_CAPTIONBAR

Type:
int
Value:
10316                                                                 

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:07:18 2007 http://epydoc.sf.net