wx.lib.agw.flatnotebook.PageContainer¶
This class acts as a container for the pages you add to FlatNotebook
.
Class Hierarchy¶
Known Superclasses¶
Methods Summary¶
Default class constructor. |
|
Adds a page to the |
|
Cycles through the tabs. |
|
Assigns the image list for the |
|
Returns whether a tab can fit in the left space in the screen or not. |
|
Deletes a flag from the |
|
Deletes all the pages in the |
|
Delete the specified page from |
|
Does the actual page deletion. |
|
Does the actual selection of a page. |
|
Draws small arrow at the place that the tab will be placed. |
|
Enables or disables a tab. |
|
Fires the |
|
Returns the |
|
Returns whether a tab is enabled or not. |
|
Returns the image list for the page control. |
|
Returns the last visible tab in the tab area. |
|
Returns the number of visible tabs. |
|
Returns the number of tabs than can be scrolled left. |
|
Returns the number of tabs in the |
|
Returns the image index associated to a page. |
|
Returns the tab caption of the page. |
|
Returns the tab text colour if it has been set previously, or |
|
Returns the current selected page. |
|
Returns the colour for the single line border. |
|
Returns whether a flag is present in the |
|
HitTest method for |
|
Inserts a new page at the specified position. |
|
Returns whether a tab has a default style. |
|
Returns whether or not the mouse is hovering over this page’s tab |
|
Returns whether a tab is visible or not. |
|
Moves a tab inside the same |
|
Handles the drop action from a drag and drop operation. |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Pops up the menu activated with the drop down arrow in the navigation area. |
|
Scrolls tabs to the left by bulk of 5 tabs. |
|
Scrolls tabs to the right by bulk of 5 tabs. |
|
Sets the |
|
Sets/Unsets the focus on the appropriate page. |
|
Sets the image list for the |
|
Sets the image index for the given page. |
|
Sets the tab caption of the page. |
|
Sets the tab text colour individually. |
|
Sets the selected page. |
|
Shows a tab tooltip. |
|
Returns whether a tab has an associated image index or not. |
Class API¶
- class PageContainer(wx.Panel)¶
This class acts as a container for the pages you add to
FlatNotebook
.
Methods¶
- __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0)¶
Default class constructor.
Used internally, do not call it in your code!
- Parameters:
parent – the
PageContainer
parent;id – an identifier for the control: a value of -1 is taken to mean a default;
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 window style.
- AddPage(self, caption, selected=False, imgindex=-1)¶
Adds a page to the
PageContainer
.- Parameters:
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.
- AdvanceSelection(self, forward=True)¶
Cycles through the tabs.
- Parameters:
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 the image list for the
PageContainer
.- Parameters:
imageList – an instance of
wx.ImageList
.
- CanFitToScreen(self, page)¶
Returns whether a tab can fit in the left space in the screen or not.
- Parameters:
page – an integer specifying the page index.
- ClearAGWFlag(self, flag)¶
Deletes a flag from the
FlatNotebook
style.- Parameters:
flag – one of the possible
FlatNotebook
window styles.
See also
FlatNotebook.SetAGWWindowStyleFlag()
for a list of possible window style flags.
- DeleteAllPages(self)¶
Deletes all the pages in the
PageContainer
.
- DeletePage(self, page)¶
Delete the specified page from
PageContainer
.- Parameters:
page – an integer specifying the page index.
- DoDeletePage(self, page)¶
Does the actual page deletion.
- Parameters:
page – an integer specifying the page index.
- DoSetSelection(self, page)¶
Does the actual selection of a page.
- Parameters:
page – an integer specifying the page index.
- DrawDragHint(self)¶
Draws small arrow at the place that the tab will be placed.
- EnableTab(self, page, enabled=True)¶
Enables or disables a tab.
- Parameters:
page – an integer specifying the page index;
enabled –
True
to enable a tab,False
to disable it.
- FireEvent(self, selection)¶
Fires the
EVT_FLATNOTEBOOK_PAGE_CHANGING
andEVT_FLATNOTEBOOK_PAGE_CHANGED
events called from other methods (from menu selection or Smart Tabbing).This is an utility function.
- Parameters:
selection – the new selection inside
FlatNotebook
.
- GetAGWWindowStyleFlag(self)¶
Returns the
FlatNotebook
window style.See also
The
FlatNotebook.__init__()
method for the agwStyle parameter description.
- GetEnabled(self, page)¶
Returns whether a tab is enabled or not.
- Parameters:
page – an integer specifying the page index.
- GetImageList(self)¶
Returns the image list for the page control.
- GetLastVisibleTab(self)¶
Returns the last visible tab in the tab area.
- GetNumOfVisibleTabs(self)¶
Returns the number of visible tabs.
- GetNumTabsCanScrollLeft(self)¶
Returns the number of tabs than can be scrolled left.
- GetPageCount(self)¶
Returns the number of tabs in the
FlatNotebook
control.
- GetPageImage(self, page)¶
Returns the image index associated to a page.
- Parameters:
page – an integer specifying the page index.
- GetPageText(self, page)¶
Returns the tab caption of the page.
- Parameters:
page – an integer specifying the page index.
- GetPageTextColour(self, page)¶
Returns the tab text colour if it has been set previously, or
None
otherwise.- Parameters:
page – an integer specifying the page index.
- GetSelection(self)¶
Returns the current selected page.
- GetSingleLineBorderColour(self)¶
Returns the colour for the single line border.
- HasAGWFlag(self, flag)¶
Returns whether a flag is present in the
FlatNotebook
style.- Parameters:
flag – one of the possible
FlatNotebook
window styles.
See also
FlatNotebook.SetAGWWindowStyleFlag()
for a list of possible window style flags.
- HitTest(self, pt)¶
HitTest method for
PageContainer
.- Parameters:
pt – an instance of
wx.Point
, to test for hits.- Returns:
The hit test flag (if any) and the hit page index (if any). The return value can be one of the following bits:
HitTest Flag
Value
Description
FNB_NOWHERE
0
Indicates mouse coordinates not on any tab of the notebook
FNB_TAB
1
Indicates mouse coordinates inside a tab
FNB_X
2
Indicates mouse coordinates inside the ‘X’ button region
FNB_TAB_X
3
Indicates mouse coordinates inside the ‘X’ region in a tab
FNB_LEFT_ARROW
4
Indicates mouse coordinates inside the left arrow region
FNB_RIGHT_ARROW
5
Indicates mouse coordinates inside the right arrow region
FNB_DROP_DOWN_ARROW
6
Indicates mouse coordinates inside the drop down arrow region
- InsertPage(self, indx, text, selected=True, imgindex=-1)¶
Inserts a new page at the specified position.
- Parameters:
indx – specifies the position of 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.
- IsDefaultTabs(self)¶
Returns whether a tab has a default style.
- IsMouseHovering(self, page)¶
Returns whether or not the mouse is hovering over this page’s tab
- Parameters:
page – an integer specifying the page index.
- IsTabVisible(self, page)¶
Returns whether a tab is visible or not.
- Parameters:
page – an integer specifying the page index.
- MoveTabPage(self, nMove, nMoveTo)¶
Moves a tab inside the same
FlatNotebook
.- Parameters:
nMove – the start index of the moved tab;
nMoveTo – the destination index of the moved tab.
- OnDropTarget(self, x, y, nTabPage, wnd_oldContainer)¶
Handles the drop action from a drag and drop operation.
- Parameters:
x – the x position of the drop action;
y – the y position of the drop action;
nTabPage – the index of the tab being dropped;
wnd_oldContainer – the
FlatNotebook
to which the dropped tab previously belonged to.
- OnEraseBackground(self, event)¶
Handles the
wx.EVT_ERASE_BACKGROUND
event forPageContainer
.- Parameters:
event – a
EraseEvent
event to be processed.
Note
This method is intentionally empty to reduce flicker.
- OnKeyDown(self, event)¶
Handles the
wx.EVT_KEY_DOWN
event forPageContainer
.- Parameters:
event – a
KeyEvent
event to be processed.
Note
When the
PageContainer
has the focus tabs can be changed with the left/right arrow keys.
- OnKillFocus(self, event)¶
Handles the
wx.EVT_KILL_FOCUS
event forPageContainer
.- Parameters:
event – a
FocusEvent
event to be processed.
- OnLeftDClick(self, event)¶
Handles the
wx.EVT_LEFT_DCLICK
event forPageContainer
.- Parameters:
event – a
MouseEvent
event to be processed.
- OnLeftDown(self, event)¶
Handles the
wx.EVT_LEFT_DOWN
event forPageContainer
.- Parameters:
event – a
MouseEvent
event to be processed.
- OnLeftUp(self, event)¶
Handles the
wx.EVT_LEFT_UP
event forPageContainer
.- Parameters:
event – a
MouseEvent
event to be processed.
- OnMiddleDown(self, event)¶
Handles the
wx.EVT_MIDDLE_DOWN
event forPageContainer
.- Parameters:
event – a
MouseEvent
event to be processed.
- OnMouseEnterWindow(self, event)¶
Handles the
wx.EVT_ENTER_WINDOW
event forPageContainer
.- Parameters:
event – a
MouseEvent
event to be processed.
- OnMouseLeave(self, event)¶
Handles the
wx.EVT_LEAVE_WINDOW
event forPageContainer
.- Parameters:
event – a
MouseEvent
event to be processed.
- OnMouseMove(self, event)¶
Handles the
wx.EVT_MOTION
event forPageContainer
.- Parameters:
event – a
MouseEvent
event to be processed.
- OnMouseWheel(self, event)¶
Handles the
wx.EVT_MOUSEWHEEL
event forPageContainer
.- Parameters:
event – a
MouseEvent
event to be processed.
- OnPaint(self, event)¶
Handles the
wx.EVT_PAINT
event forPageContainer
.- Parameters:
event – a
PaintEvent
event to be processed.
- OnRightDown(self, event)¶
Handles the
wx.EVT_RIGHT_DOWN
event forPageContainer
.- Parameters:
event – a
MouseEvent
event to be processed.
- OnSetFocus(self, event)¶
Handles the
wx.EVT_SET_FOCUS
event forPageContainer
.- Parameters:
event – a
FocusEvent
event to be processed.
- OnSize(self, event)¶
Handles the
wx.EVT_SIZE
event forPageContainer
.- Parameters:
event – a
wx.SizeEvent
event to be processed.
- OnTabMenuSelection(self, event)¶
Handles the
wx.EVT_MENU
event forPageContainer
.- Parameters:
event – a
wx.MenuEvent
event to be processed.
- PopupTabsMenu(self)¶
Pops up the menu activated with the drop down arrow in the navigation area.
- RotateLeft(self)¶
Scrolls tabs to the left by bulk of 5 tabs.
- RotateRight(self)¶
Scrolls tabs to the right by bulk of 5 tabs.
- SetAGWWindowStyleFlag(self, agwStyle)¶
Sets the
FlatNotebook
window style.- Parameters:
agwStyle – the new
FlatNotebook
window style.
See also
The
FlatNotebook.__init__()
method for the agwStyle parameter description.
- SetFocusedPage(self, pageIndex=-1)¶
Sets/Unsets the focus on the appropriate page.
- Parameters:
pageIndex – an integer specifying the page index. If pageIndex is defaulted to -1, we have lost focus and no focus indicator is drawn.
- SetImageList(self, imglist)¶
Sets the image list for the
PageContainer
.- Parameters:
imageList – an instance of
wx.ImageList
.
- SetPageImage(self, page, image)¶
Sets the image index for the given page.
- Parameters:
page – an integer specifying the page index;
image – an index into the image list which was set with
SetImageList
.
- SetPageText(self, page, text)¶
Sets the tab caption of the page.
- Parameters:
page – an integer specifying the page index;
text – the new tab label.
- SetPageTextColour(self, page, colour)¶
Sets the tab text colour individually.
- Parameters:
page – an integer specifying the page index;
colour – a valid
wx.Colour
object or any typemap supported by wxWidgets/wxPython to generate a colour (i.e., a hex string, a colour name, a 3 or 4 integer tuple). You can passNone
orNullColour
to return to the default page text colour.
- SetSelection(self, page)¶
Sets the selected page.
- Parameters:
page – an integer specifying the page index.
- ShowTabTooltip(self, tabIdx)¶
Shows a tab tooltip.
- Parameters:
tabIdx – an integer specifying the page index.
- TabHasImage(self, tabIdx)¶
Returns whether a tab has an associated image index or not.
- Parameters:
tabIdx – an integer specifying the page index.