Base class for the containing window for LabelBook
and FlatImageBook
.
wx.lib.agw.labelbook.FlatImageBook
, wx.lib.agw.labelbook.LabelBook
Default class constructor. |
|
Adds a page to the book. |
|
Cycles through the tabs. |
|
Assigns an image list to the control. |
|
Changes the selection for the given page, returning the previous selection. |
|
Deletes all the pages in the book. |
|
Deletes the specified page, and the associated window. |
|
Select the window by the provided pointer. |
|
Enables or disables a tab. |
|
Returns the |
|
Returns the currently selected notebook page or |
|
Returns whether a tab is enabled or not. |
|
Gets the font bold status. |
|
Gets the font size multiple for the page captions. |
|
Returns the associated image list. |
|
Returns the window at the given page position. |
|
Returns the number of pages in the book. |
|
Returns the image index for the given page. |
|
Returns the text for the given page. |
|
Returns the current selection. |
|
Returns whether a flag is present in the |
|
Inserts a page into the book at the specified position. |
|
Handles the |
|
Deletes the specified page, without deleting the associated window. |
|
Resizes the tab area if the control has the |
|
Sets the window style. |
|
Sets whether the page captions are bold or not. |
|
Sets the font size multiple for the page captions. |
|
Sets the image index for the given page. |
|
Sets the text for the given page. |
|
Changes the selection from currently visible/selected page to the page |
See GetCurrentPage |
|
See GetPage |
|
See GetPageCount |
|
See GetPageImage, SetPageImage |
|
See GetPageText, SetPageText |
|
See GetSelection, SetSelection |
FlatBookBase
(wx.Panel)¶Base class for the containing window for LabelBook
and FlatImageBook
.
__init__
(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=0, name="FlatBookBase")¶Default class constructor.
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 Panel
window style;
agwStyle –
the AGW-specific window style. This can be a combination of the following bits:
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. |
name – the window name.
AddPage
(self, page, text, select=False, imageId=-1)¶Adds a page to the book.
page – specifies the new page;
text – specifies the text for the new page;
select – specifies whether the page should be selected;
imageId – specifies the optional image index for the new page.
Note
The call to this function generates the page changing events.
AdvanceSelection
(self, forward=True)¶Cycles through the tabs.
forward – if True
, the selection is advanced in ascending order
(to the right), otherwise the selection is advanced in descending order.
Note
The call to this function generates the page changing events.
AssignImageList
(self, imglist)¶Assigns an image list to the control.
imglist – an instance of wx.ImageList
.
ChangeSelection
(self, page)¶Changes the selection for the given page, returning the previous selection.
page – an integer specifying the page to be selected.
Note
The call to this function does not generate the page changing events.
DeleteAllPages
(self)¶Deletes all the pages in the book.
DeletePage
(self, page)¶Deletes the specified page, and the associated window.
page – an integer specifying the page to be deleted.
Note
The call to this function generates the page changing events.
DoSetSelection
(self, window)¶Select the window by the provided pointer.
window – an instance of wx.Window
.
EnableTab
(self, page, enabled=True)¶Enables or disables a tab.
page – an integer specifying the page index;
enabled – True
to enable a tab, False
to disable it.
GetAGWWindowStyleFlag
(self)¶Returns the FlatBookBase
window style.
See also
SetAGWWindowStyleFlag
for a list of possible window style flags.
GetCurrentPage
(self)¶Returns the currently selected notebook page or None
.
GetEnabled
(self, page)¶Returns whether a tab is enabled or not.
page – an integer specifying the page index.
GetFontBold
(self)¶Gets the font bold status.
GetFontSizeMultiple
(self)¶Gets the font size multiple for the page captions.
GetImageList
(self)¶Returns the associated image list.
GetPage
(self, page)¶Returns the window at the given page position.
page – an integer specifying the page to be returned.
GetPageCount
(self)¶Returns the number of pages in the book.
GetPageImage
(self, page)¶Returns the image index for the given page.
page – an integer specifying the page index.
GetPageText
(self, page)¶Returns the text for the given page.
page – an integer specifying the page index.
GetSelection
(self)¶Returns the current selection.
HasAGWFlag
(self, flag)¶Returns whether a flag is present in the FlatBookBase
style.
flag – one of the possible FlatBookBase
window styles.
See also
SetAGWWindowStyleFlag
for a list of possible window style flags.
InsertPage
(self, page_idx, page, text, select=False, imageId=-1)¶Inserts a page into the book at the specified position.
page_idx – specifies the position for the new page;
page – specifies the new page;
text – specifies the text for the new page;
select – specifies whether the page should be selected;
imageId – specifies the optional image index for the new page.
Note
The call to this function generates the page changing events.
Handles the wx.EVT_NAVIGATION_KEY
event for FlatBookBase
.
event – a NavigationKeyEvent
event to be processed.
RemovePage
(self, page)¶Deletes the specified page, without deleting the associated window.
page – an integer specifying the page to be removed.
Note
The call to this function generates the page changing events.
ResizeTabArea
(self)¶Resizes the tab area if the control has the INB_FIT_LABELTEXT
style set.
SetAGWWindowStyleFlag
(self, agwStyle)¶Sets the window style.
agwStyle – can be a combination of the following bits:
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. |
SetFontBold
(self, bold)¶Sets whether the page captions are bold or not.
bold – True
or False
.
SetFontSizeMultiple
(self, multiple)¶Sets the font size multiple for the page captions.
multiple – The multiple to be applied to the system font to get the our font size.
SetPageImage
(self, page, imageId)¶Sets the image index for the given page.
page – an integer specifying the page index;
image – an index into the image list.
SetPageText
(self, page, text)¶Sets the text for the given page.
page – an integer specifying the page index;
text – the new tab label.
SetSelection
(self, page)¶Changes the selection from currently visible/selected page to the page given by page.
page – an integer specifying the page to be selected.
Note
The call to this function generates the page changing events.
CurrentPage
¶See GetCurrentPage
PageCount
¶See GetPageCount
PageImage
¶See GetPageImage, SetPageImage
PageText
¶See GetPageText, SetPageText
Selection
¶See GetSelection, SetSelection