This class acts as a container for the pages you add to FlatNotebook
.
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. |
PageContainer
(wx.Panel)¶This class acts as a container for the pages you add to FlatNotebook
.
__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!
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
.
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.
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
.
imageList – an instance of wx.ImageList
.
CanFitToScreen
(self, page)¶Returns whether a tab can fit in the left space in the screen or not.
page – an integer specifying the page index.
ClearAGWFlag
(self, flag)¶Deletes a flag from the FlatNotebook
style.
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
.
page – an integer specifying the page index.
DoDeletePage
(self, page)¶Does the actual page deletion.
page – an integer specifying the page index.
DoSetSelection
(self, page)¶Does the actual selection of a page.
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.
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
and EVT_FLATNOTEBOOK_PAGE_CHANGED
events called from other methods (from menu selection or Smart Tabbing).
This is an utility function.
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.
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.
page – an integer specifying the page index.
GetPageText
(self, page)¶Returns the tab caption of the page.
page – an integer specifying the page index.
GetPageTextColour
(self, page)¶Returns the tab text colour if it has been set previously, or None
otherwise.
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.
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
.
pt – an instance of wx.Point
, to test for hits.
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 |
---|---|---|
|
0 |
Indicates mouse coordinates not on any tab of the notebook |
|
1 |
Indicates mouse coordinates inside a tab |
|
2 |
Indicates mouse coordinates inside the ‘X’ button region |
|
3 |
Indicates mouse coordinates inside the ‘X’ region in a tab |
|
4 |
Indicates mouse coordinates inside the left arrow region |
|
5 |
Indicates mouse coordinates inside the right arrow region |
|
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.
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
page – an integer specifying the page index.
IsTabVisible
(self, page)¶Returns whether a tab is visible or not.
page – an integer specifying the page index.
MoveTabPage
(self, nMove, nMoveTo)¶Moves a tab inside the same FlatNotebook
.
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.
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 for PageContainer
.
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 for PageContainer
.
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 for PageContainer
.
event – a FocusEvent
event to be processed.
OnLeftDClick
(self, event)¶Handles the wx.EVT_LEFT_DCLICK
event for PageContainer
.
event – a MouseEvent
event to be processed.
OnLeftDown
(self, event)¶Handles the wx.EVT_LEFT_DOWN
event for PageContainer
.
event – a MouseEvent
event to be processed.
OnLeftUp
(self, event)¶Handles the wx.EVT_LEFT_UP
event for PageContainer
.
event – a MouseEvent
event to be processed.
OnMiddleDown
(self, event)¶Handles the wx.EVT_MIDDLE_DOWN
event for PageContainer
.
event – a MouseEvent
event to be processed.
OnMouseEnterWindow
(self, event)¶Handles the wx.EVT_ENTER_WINDOW
event for PageContainer
.
event – a MouseEvent
event to be processed.
OnMouseLeave
(self, event)¶Handles the wx.EVT_LEAVE_WINDOW
event for PageContainer
.
event – a MouseEvent
event to be processed.
OnMouseMove
(self, event)¶Handles the wx.EVT_MOTION
event for PageContainer
.
event – a MouseEvent
event to be processed.
OnMouseWheel
(self, event)¶Handles the wx.EVT_MOUSEWHEEL
event for PageContainer
.
event – a MouseEvent
event to be processed.
OnPaint
(self, event)¶Handles the wx.EVT_PAINT
event for PageContainer
.
event – a PaintEvent
event to be processed.
OnRightDown
(self, event)¶Handles the wx.EVT_RIGHT_DOWN
event for PageContainer
.
event – a MouseEvent
event to be processed.
OnSetFocus
(self, event)¶Handles the wx.EVT_SET_FOCUS
event for PageContainer
.
event – a FocusEvent
event to be processed.
OnSize
(self, event)¶Handles the wx.EVT_SIZE
event for PageContainer
.
event – a wx.SizeEvent
event to be processed.
OnTabMenuSelection
(self, event)¶Handles the wx.EVT_MENU
event for PageContainer
.
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.
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.
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
.
imageList – an instance of wx.ImageList
.
SetPageImage
(self, page, image)¶Sets the image index for the given page.
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.
page – an integer specifying the page index;
text – the new tab label.
SetPageTextColour
(self, page, colour)¶Sets the tab text colour individually.
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
pass None
or NullColour
to return to the default page text colour.
SetSelection
(self, page)¶Sets the selected page.
page – an integer specifying the page index.
ShowTabTooltip
(self, tabIdx)¶Shows a tab tooltip.
tabIdx – an integer specifying the page index.
TabHasImage
(self, tabIdx)¶Returns whether a tab has an associated image index or not.
tabIdx – an integer specifying the page index.