Package wx :: Package lib :: Module foldpanelbar :: Class CaptionBar

[frames | no frames]

## Type CaptionBar

    object --+
             |
        Object --+
                 |
        EvtHandler --+
                     |
                Window --+
                         |
                        CaptionBar

This class is a graphical caption component that consists of a caption and a clickable arrow.

The CaptionBar fires an event EVT_CAPTIONBAR which is a `CaptionBarEvent`. This event can be caught and the parent window can act upon the collapsed or expanded state of the bar (which is actually just the icon which changed). The parent panel can reduce size or expand again.

Method Summary
| ``__init__`(self, parent, id, pos, size, caption, foldIcons, cbstyle, rightIndent, iconWidth, iconHeight, collapsed)` Default Class Constructor.
| ``ApplyCaptionStyle`(self, cbstyle, applyDefault)` Applies the style defined in cbstyle to the CaptionBar.
| ``Collapse`(self)` This sets the internal state / representation to collapsed.
| ``DoGetBestSize`(self)` Returns the best size for this panel, based upon the font assigned to this window, and the caption string
| ``DrawHorizontalGradient`(self, dc, rect)` Gradient fill from colour 1 to colour 2 with left to right.
| ``DrawSingleColour`(self, dc, rect)` Single colour fill.
| ``DrawSingleRectangle`(self, dc, rect)` Single rectangle.
| ``DrawVerticalGradient`(self, dc, rect)` Gradient fill from colour 1 to colour 2 with top to bottom.
| ``Expand`(self)` This sets the internal state / representation to expanded.
| ``FillCaptionBackground`(self, dc)` Fills the background of the caption with either a gradient or a solid color.
| ``GetCaptionStyle`(self)` Returns the current style of the captionbar in a `CaptionBarStyle` class.
| ``IsCollapsed`(self)` Returns wether the status of the bar is expanded or collapsed.
| ``IsVertical`(self)` Returns wether the CaptionBar Has Default Orientation Or Not.
| ``OnChar`(self, event)` Unused Methods.
| ``OnMouseEvent`(self, event)` Catches the mouse click-double click.
| ``OnPaint`(self, event)` The paint event for flat or gradient fill.
| ``OnSize`(self, event)` Handles the size events for the CaptionBar.
| ``RedrawIconBitmap`(self)` Redraws the icons (if they exists).
| ``SetBoldFont`(self)` Sets the CaptionBarFont weight to BOLD.
| ``SetCaptionStyle`(self, cbstyle, applyDefault)` Sets CaptionBar styles with CapionBarStyle class.
| ``SetNormalFont`(self)` Sets the CaptionBarFont weight to NORMAL.
| ``SetRightIndent`(self, pixels)` Sets the amount of pixels on the right from which the bitmap is trailing.

Property Summary

Class Variable Summary
`CaptionBarStyle` | `EmptyCaptionBarStyle` = `<wx.lib.foldpanelbar.CaptionBarSt...`

Instance Method Details

### __init__(self, parent, id, pos, size, caption='', foldIcons=None, cbstyle=<wx.lib.foldpanelbar.CaptionBarStyle instance at 0xb490ce4c>, rightIndent=2, iconWidth=16, iconHeight=16, collapsed=False)
(Constructor)

Default Class Constructor.

  Overrides:
    `wx.Window.__init__`

### ApplyCaptionStyle(self, cbstyle=<wx.lib.foldpanelbar.CaptionBarStyle instance at 0xb490ce4c>, applyDefault=True)

Applies the style defined in cbstyle to the CaptionBar.

### Collapse(self)

This sets the internal state / representation to collapsed.

This does not trigger a `CaptionBarEvent` to be sent to the parent.

### DoGetBestSize(self)

Returns the best size for this panel, based upon the font assigned to this window, and the caption string

### DrawHorizontalGradient(self, dc, rect)

Gradient fill from colour 1 to colour 2 with left to right.

### DrawSingleColour(self, dc, rect)

Single colour fill. This is the most easy one to find.

### DrawSingleRectangle(self, dc, rect)

Single rectangle. This is the most easy one to find.

### DrawVerticalGradient(self, dc, rect)

Gradient fill from colour 1 to colour 2 with top to bottom.

### Expand(self)

This sets the internal state / representation to expanded.

This does not trigger a `CaptionBarEvent` to be sent to the parent.

### FillCaptionBackground(self, dc)

Fills the background of the caption with either a gradient or a solid color.

### GetCaptionStyle(self)

Returns the current style of the captionbar in a `CaptionBarStyle` class.

This can be used to change and set back the changes.

### IsCollapsed(self)

Returns wether the status of the bar is expanded or collapsed.

### IsVertical(self)

Returns wether the CaptionBar Has Default Orientation Or Not.

Default is vertical.

### OnChar(self, event)

Unused Methods. Any Ideas?!?

### OnMouseEvent(self, event)

Catches the mouse click-double click.

If clicked on the arrow (single) or double on the caption we change state and an event must be fired to let this panel collapse or expand.

### OnPaint(self, event)

The paint event for flat or gradient fill.

### OnSize(self, event)

Handles the size events for the CaptionBar.

### RedrawIconBitmap(self)

Redraws the icons (if they exists).

### SetBoldFont(self)

Sets the CaptionBarFont weight to BOLD.

### SetCaptionStyle(self, cbstyle=<wx.lib.foldpanelbar.CaptionBarStyle instance at 0xb490ce4c>, applyDefault=True)

Sets CaptionBar styles with CapionBarStyle class.

All styles that are actually set, are applied. If you set applyDefault to True, all other (not defined) styles will be set to default. If it is False, the styles which are not set in the CaptionBarStyle will be ignored.

### SetNormalFont(self)

Sets the CaptionBarFont weight to NORMAL.

### SetRightIndent(self, pixels)

Sets the amount of pixels on the right from which the bitmap is trailing.

If this is 0, it will be drawn all the way to the right, default is equal to FPB_BMP_RIGHTSPACE. Assign this before assigning an image list to prevent a redraw.

Class Variable Details

### EmptyCaptionBarStyle

  Type:
    `CaptionBarStyle`
  Value:

        <wx.lib.foldpanelbar.CaptionBarStyle instance at 0xb490ce4c>

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:13:29 2007 | http://epydoc.sf.net