wx.lib.agw.labelbook.LabelContainer¶
Base class for LabelBook.
Class Hierarchy¶
Known Superclasses¶
wx.lib.agw.labelbook.ImageContainerBase
Methods Summary¶
Default class constructor. |
|
Allows the parent to examine the children type. Some implementation |
|
Draws a bitmap as the background of the control. |
|
Draws a label using the specified dc. |
|
Draws a rounded rectangle around the current tab. |
|
Draws a web style hover effect (cursor set to hand & text is underlined). |
|
Returns a colour for a parameter. |
|
Returns the width of the tab area. |
|
Initializes the colours map to be used for this control. |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Actually resizes the tab area. |
|
Sets the background bitmap for the control. |
|
Sets a colour for a parameter. |
|
Sets the width of the tab area. |
Class API¶
- class LabelContainer(ImageContainerBase)¶
Base class for
LabelBook.
Methods¶
- __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=0, name='LabelContainer')¶
Default class constructor.
- Parameters:
parent – parent window. Must not be
None;id – window identifier. A value of -1 indicates a default value;
pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;
size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;
style – the underlying
Panelwindow style;agwStyle –
the AGW-specific window style. This can be a combination of the following bits:
Window Styles
Hex Value
Description
INB_BOTTOM0x1
Place labels below the page area. Available only for
FlatImageBook.INB_LEFT0x2
Place labels on the left side. Available only for
FlatImageBook.INB_RIGHT0x4
Place labels on the right side.
INB_TOP0x8
Place labels above the page area.
INB_BORDER0x10
Draws a border around
LabelBookorFlatImageBook.INB_SHOW_ONLY_TEXT0x20
Shows only text labels and no images. Available only for
LabelBook.INB_SHOW_ONLY_IMAGES0x40
Shows only tab images and no label texts. Available only for
LabelBook.INB_FIT_BUTTON0x80
Displays a pin button to show/hide the book control.
INB_DRAW_SHADOW0x100
Draw shadows below the book tabs. Available only for
LabelBook.INB_USE_PIN_BUTTON0x200
Displays a pin button to show/hide the book control.
INB_GRADIENT_BACKGROUND0x400
Draws a gradient shading on the tabs background. Available only for
LabelBook.INB_WEB_HILITE0x800
On mouse hovering, tabs behave like html hyperlinks. Available only for
LabelBook.INB_NO_RESIZE0x1000
Don’t allow resizing of the tab area.
INB_FIT_LABELTEXT0x2000
Will fit the tab area to the longest text (or text+image if you have images) in all the tabs.
INB_BOLD_TAB_SELECTION0x4000
Show the selected tab text using a bold font.
name – the window name.
- CanDoBottomStyle(self)¶
Allows the parent to examine the children type. Some implementation (such as
LabelBook), does not support top/bottom images, only left/right.
- DrawBackgroundBitmap(self, dc)¶
Draws a bitmap as the background of the control.
- Parameters:
dc – an instance of
wx.DC.
- DrawLabel(self, dc, rect, text, bmp, imgInfo, orientationLeft, imgIdx, selected, hover)¶
Draws a label using the specified dc.
- Parameters:
dc – an instance of
wx.DC;rect – the text client rectangle;
text – the actual text string;
bmp – a bitmap to be drawn next to the text;
imgInfo – an instance of
wx.ImageInfo;orientationLeft –
Trueif the book has theINB_RIGHTorINB_LEFTstyle set;imgIdx – the tab image index;
selected –
Trueif the tab is selected,Falseotherwise;hover –
Trueif the tab is being hovered with the mouse,Falseotherwise.
- DrawRegularHover(self, dc, rect)¶
Draws a rounded rectangle around the current tab.
- Parameters:
dc – an instance of
wx.DC;rect – the current tab client rectangle.
- DrawWebHover(self, dc, caption, xCoord, yCoord, selected)¶
Draws a web style hover effect (cursor set to hand & text is underlined).
- Parameters:
dc – an instance of
wx.DC;caption – the tab caption text;
xCoord – the x position of the tab caption;
yCoord – the y position of the tab caption;
selected –
Trueif the tab is selected,Falseotherwise.
- GetColour(self, which)¶
Returns a colour for a parameter.
- Parameters:
which – the colour key.
See also
SetColourfor a list of valid colour keys.
- GetTabAreaWidth(self)¶
Returns the width of the tab area.
- InitializeColours(self)¶
Initializes the colours map to be used for this control.
- OnEraseBackground(self, event)¶
Handles the
wx.EVT_ERASE_BACKGROUNDevent forLabelContainer.- Parameters:
event – a
EraseEventevent to be processed.
- OnMouseLeaveWindow(self, event)¶
Handles the
wx.EVT_LEAVE_WINDOWevent forLabelContainer.- Parameters:
event – a
MouseEventevent to be processed.
- OnMouseLeftDown(self, event)¶
Handles the
wx.EVT_LEFT_DOWNevent forLabelContainer.- Parameters:
event – a
MouseEventevent to be processed.
- OnMouseLeftUp(self, event)¶
Handles the
wx.EVT_LEFT_UPevent forLabelContainer.- Parameters:
event – a
MouseEventevent to be processed.
- OnMouseMove(self, event)¶
Handles the
wx.EVT_MOTIONevent forLabelContainer.- Parameters:
event – a
MouseEventevent to be processed.
- OnPaint(self, event)¶
Handles the
wx.EVT_PAINTevent forLabelContainer.- Parameters:
event – a
PaintEventevent to be processed.
- OnSize(self, event)¶
Handles the
wx.EVT_SIZEevent forLabelContainer.- Parameters:
event – a
wx.SizeEventevent to be processed.
- Resize(self, event)¶
Actually resizes the tab area.
- Parameters:
event – an instance of
wx.SizeEvent.
- SetBackgroundBitmap(self, bmp)¶
Sets the background bitmap for the control.
- Parameters:
bmp – a valid
wx.Bitmapobject.
- SetColour(self, which, colour)¶
Sets a colour for a parameter.
- Parameters:
which – can be one of the following parameters:
Colour Key
Value
Description
INB_TAB_AREA_BACKGROUND_COLOUR100
The tab area background colour
INB_ACTIVE_TAB_COLOUR101
The active tab background colour
INB_TABS_BORDER_COLOUR102
The tabs border colour
INB_TEXT_COLOUR103
The tab caption text colour
INB_ACTIVE_TEXT_COLOUR104
The active tab caption text colour
INB_HILITE_TAB_COLOUR105
The tab caption highlight text colour
colour – a valid
wx.Colourobject.
- SetTabAreaWidth(self, width)¶
Sets the width of the tab area.
- Parameters:
width – the width of the tab area, in pixels.