wx.lib.agw.labelbook¶LabelBook and FlatImageBook are a quasi-full generic and owner-drawn
implementations of Notebook.
LabelBook and FlatImageBook are quasi-full implementations of the Notebook,
and designed to be a drop-in replacement for Notebook. The API functions are
similar so one can expect the function to behave in the same way.
LabelBook anf FlatImageBook share their appearance with Toolbook and
Listbook, while having more options for custom drawings, label positioning,
mouse pointing and so on. Moreover, they retain also some visual characteristics
of the Outlook address book.
Some features:
They are generic controls;
Supports for left, right, top (FlatImageBook only), bottom (FlatImageBook
only) book styles;
Possibility to draw images only, text only or both (FlatImageBook only);
Support for a “pin-button”, that allows the user to shrink/expand the book tab area;
Shadows behind tabs (LabelBook only);
Gradient shading of the tab area (LabelBook only);
Web-like mouse pointing on tabs style (LabelBook only);
Many customizable colours (tab area, active tab text, tab borders, active
tab, highlight) - LabelBook only.
And much more. See the demo for a quasi-complete review of all the functionalities
of LabelBook and FlatImageBook.
Usage example:
import wx
import wx.lib.agw.labelbook as LB
class MyFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, -1, "LabelBook Demo")
# Possible values for Tab placement are INB_TOP, INB_BOTTOM, INB_RIGHT, INB_LEFT
notebook = LB.LabelBook(self, -1, agwStyle=LB.INB_FIT_LABELTEXT|LB.INB_LEFT|LB.INB_DRAW_SHADOW|LB.INB_GRADIENT_BACKGROUND)
pane1 = wx.Panel(notebook)
pane2 = wx.Panel(notebook)
imagelist = wx.ImageList(32, 32)
imagelist.Add(wx.Bitmap("my_bitmap.png", wx.BITMAP_TYPE_PNG))
notebook.AssignImageList(imagelist)
notebook.AddPage(pane_1, "Tab1", 1, 0)
notebook.AddPage(pane_2, "Tab2", 0, 0)
# our normal wxApp-derived class, as usual
app = wx.App(0)
frame = MyFrame(None)
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()
LabelBook and FlatImageBook have been tested on the following platforms:Windows (Windows XP);
Linux Ubuntu (Dapper 6.06)
This class supports the following window styles:
Window Styles |
Hex Value |
Description |
|---|---|---|
|
0x1 |
Place labels below the page area. Available only for |
|
0x2 |
Place labels on the left side. Available only for |
|
0x4 |
Place labels on the right side. |
|
0x8 |
Place labels above the page area. |
|
0x10 |
Draws a border around |
|
0x20 |
Shows only text labels and no images. Available only for |
|
0x40 |
Shows only tab images and no label texts. Available only for |
|
0x80 |
Displays a pin button to show/hide the book control. |
|
0x100 |
Draw shadows below the book tabs. Available only for |
|
0x200 |
Displays a pin button to show/hide the book control. |
|
0x400 |
Draws a gradient shading on the tabs background. Available only for |
|
0x800 |
On mouse hovering, tabs behave like html hyperlinks. Available only for |
|
0x1000 |
Don’t allow resizing of the tab area. |
|
0x2000 |
Will fit the tab area to the longest text (or text+image if you have images) in all the tabs. |
|
0x4000 |
Show the selected tab text using a bold font. |
This class processes the following events:
Event Name |
Description |
|---|---|
|
Notify client objects when the active page in |
|
Notify client objects when the active page in |
|
Notify client objects when a page in |
|
Notify client objects when a page in |
LabelBook and FlatImageBook are distributed under the wxPython license.
Latest Revision: Andrea Gavana @ 22 Jan 2013, 21.00 GMT
Version 0.6.
Classes Summary¶Base class for the containing window for |
|
Default implementation of the image book, it is like a |
|
Base class for |
|
Base class for |
|
This class holds all the information (caption, image, etc…) belonging to a |
|
This events will be sent when a |
|
An implementation of a notebook control - except that instead of having |
|
Base class for |