AGW Logo

agw_title LabelContainer

Base class for LabelBook.

hierarchy Inheritance Diagram

Inheritance diagram for: LabelContainer

Inheritance diagram of LabelContainer


supclasses Known Superclasses


method_summary Methods Summary

__init__Default class constructor.
CanDoBottomStyleAllows the parent to examine the children type.
DrawBackgroundBitmapDraws a bitmap as the background of the control.
DrawLabelDraws a label using the specified dc.
DrawRegularHoverDraws a rounded rectangle around the current tab.
DrawWebHoverDraws a web style hover effect (cursor set to hand & text is underlined).
GetColourReturns a colour for a parameter.
GetTabAreaWidthReturns the width of the tab area.
InitializeColoursInitializes the colours map to be used for this control.
OnEraseBackgroundHandles the wx.EVT_ERASE_BACKGROUND event for LabelContainer.
OnMouseLeaveWindowHandles the wx.EVT_LEAVE_WINDOW event for LabelContainer.
OnMouseLeftDownHandles the wx.EVT_LEFT_DOWN event for LabelContainer.
OnMouseLeftUpHandles the wx.EVT_LEFT_UP event for LabelContainer.
OnMouseMoveHandles the wx.EVT_MOTION event for LabelContainer.
OnPaintHandles the wx.EVT_PAINT event for LabelContainer.
OnSizeHandles the wx.EVT_SIZE event for LabelContainer.
ResizeActually resizes the tab area.
SetBackgroundBitmapSets the background bitmap for the control.
SetColourSets a colour for a parameter.
SetTabAreaWidthSets the width of the tab area.

API Class API

class LabelContainer(ImageContainerBase)[source]

Base class for LabelBook.



__init__(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=0, name="LabelContainer")[source]

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 wx.Panel window style;
  • agwStyle – the AGW-specific window style. This can be a combination of the following bits:


    Window Styles Hex Value Description
    INB_BOTTOM 0x1 Place labels below the page area. Available only for FlatImageBook.
    INB_LEFT 0x2 Place labels on the left side. Available only for FlatImageBook.
    INB_RIGHT 0x4 Place labels on the right side.
    INB_TOP 0x8 Place labels above the page area.
    INB_BORDER 0x10 Draws a border around LabelBook or FlatImageBook.
    INB_SHOW_ONLY_TEXT 0x20 Shows only text labels and no images. Available only for LabelBook.
    INB_SHOW_ONLY_IMAGES 0x40 Shows only tab images and no label texts. Available only for LabelBook.
    INB_FIT_BUTTON 0x80 Displays a pin button to show/hide the book control.
    INB_DRAW_SHADOW 0x100 Draw shadows below the book tabs. Available only for LabelBook.
    INB_USE_PIN_BUTTON 0x200 Displays a pin button to show/hide the book control.
    INB_GRADIENT_BACKGROUND 0x400 Draws a gradient shading on the tabs background. Available only for LabelBook.
    INB_WEB_HILITE 0x800 On mouse hovering, tabs behave like html hyperlinks. Available only for LabelBook.
    INB_NO_RESIZE 0x1000 Don’t allow resizing of the tab area.
    INB_FIT_LABELTEXT 0x2000 Will fit the tab area to the longest text (or text+image if you have images) in all the tabs.
    INB_BOLD_TAB_SELECTION 0x4000 Show the selected tab text using a bold font.
  • name – the window name.


CanDoBottomStyle()[source]

Allows the parent to examine the children type. Some implementation (such as LabelBook), does not support top/bottom images, only left/right.



DrawBackgroundBitmap(dc)[source]

Draws a bitmap as the background of the control.

Parameters:dc – an instance of wx.DC.


DrawLabel(dc, rect, text, bmp, imgInfo, orientationLeft, imgIdx, selected, hover)[source]

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 ImageInfo;
  • orientationLeftTrue if the book has the INB_RIGHT or INB_LEFT style set;
  • imgIdx – the tab image index;
  • selectedTrue if the tab is selected, False otherwise;
  • hoverTrue if the tab is being hovered with the mouse, False otherwise.


DrawRegularHover(dc, rect)[source]

Draws a rounded rectangle around the current tab.

Parameters:
  • dc – an instance of wx.DC;

  • rect – the current tab client rectangle.


DrawWebHover(dc, caption, xCoord, yCoord, selected)[source]

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;
  • selectedTrue if the tab is selected, False otherwise.


GetColour(which)[source]

Returns a colour for a parameter.

Parameters:which – the colour key.

See also

SetColour for a list of valid colour keys.



GetTabAreaWidth()[source]

Returns the width of the tab area.



InitializeColours()[source]

Initializes the colours map to be used for this control.



OnEraseBackground(event)[source]

Handles the wx.EVT_ERASE_BACKGROUND event for LabelContainer.

Parameters:event – a wx.EraseEvent event to be processed.


OnMouseLeaveWindow(event)[source]

Handles the wx.EVT_LEAVE_WINDOW event for LabelContainer.

Parameters:event – a wx.MouseEvent event to be processed.


OnMouseLeftDown(event)[source]

Handles the wx.EVT_LEFT_DOWN event for LabelContainer.

Parameters:event – a wx.MouseEvent event to be processed.



OnMouseLeftUp(event)[source]

Handles the wx.EVT_LEFT_UP event for LabelContainer.

Parameters:event – a wx.MouseEvent event to be processed.



OnMouseMove(event)[source]

Handles the wx.EVT_MOTION event for LabelContainer.

Parameters:event – a wx.MouseEvent event to be processed.



OnPaint(event)[source]

Handles the wx.EVT_PAINT event for LabelContainer.

Parameters:event – a wx.PaintEvent event to be processed.


OnSize(event)[source]

Handles the wx.EVT_SIZE event for LabelContainer.

Parameters:event – a wx.SizeEvent event to be processed.


Resize(event)[source]

Actually resizes the tab area.

Parameters:event – an instance of wx.SizeEvent.



SetBackgroundBitmap(bmp)[source]

Sets the background bitmap for the control.

Parameters:bmp – a valid wx.Bitmap object.


SetColour(which, colour)[source]

Sets a colour for a parameter.

Parameters:
  • which – can be one of the following parameters:


    Colour Key Value Description
    INB_TAB_AREA_BACKGROUND_COLOUR 100 The tab area background colour
    INB_ACTIVE_TAB_COLOUR 101 The active tab background colour
    INB_TABS_BORDER_COLOUR 102 The tabs border colour
    INB_TEXT_COLOUR 103 The tab caption text colour
    INB_ACTIVE_TEXT_COLOUR 104 The active tab caption text colour
    INB_HILITE_TAB_COLOUR 105 The tab caption highlight text colour
  • colour – a valid wx.Colour object.


SetTabAreaWidth(width)[source]

Sets the width of the tab area.

Parameters:width – the width of the tab area, in pixels.
Tree

Table Of Contents

Previous topic

LabelBook

Next topic

SVN Revision 68362 For labelbook