The FlatNotebook
is a full implementation 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.
__init__ |
Default class constructor. |
AddPage |
Adds a page to the FlatNotebook . |
AdvanceSelection |
Cycles through the tabs. |
AssignImageList |
Assigns the image list for the page control. |
DeleteAllPages |
Deletes all the pages in the FlatNotebook . |
DeletePage |
Deletes the specified page, and the associated window. |
DoGetBestSize |
Gets the size which best suits the window: for a control, it would be the |
EnableTab |
Enables or disables a tab. |
EnsureVisible |
Ensures that a tab is visible. |
GetActiveTabColour |
Returns the active tab colour. |
GetActiveTabTextColour |
Get the active tab text colour. |
GetAGWWindowStyleFlag |
Returns the FlatNotebook window style. |
GetBorderColour |
Returns the border colour. |
GetCurrentPage |
Returns the currently selected notebook page or None if none is selected. |
GetCustomPage |
Returns a custom panel to show when there are no pages left in FlatNotebook . |
GetEnabled |
Returns whether a tab is enabled or not. |
GetGradientColourBorder |
Gets the tab border colour. |
GetGradientColourFrom |
Gets first gradient colour. |
GetGradientColourTo |
Gets second gradient colour. |
GetImageList |
Returns the associated image list. |
GetNonActiveTabTextColour |
Returns the non active tabs text colour. |
GetPadding |
Returns the amount of space around each page’s icon and label, in pixels. |
GetPage |
Returns the window at the given page position, or None . |
GetPageBestSize |
Return the page best size. |
GetPageCount |
Returns the number of pages in the FlatNotebook control. |
GetPageImage |
Returns the image index for the given page. |
GetPageIndex |
Returns the index at which the window is found. |
GetPageShapeAngle |
Returns the angle associated to a tab. |
GetPageText |
Returns the string for the given page. |
GetPageTextColour |
Returns the tab text colour if it has been set previously, or None otherwise. |
GetPreviousSelection |
Returns the previous selection. |
GetSelection |
Returns the currently selected page, or -1 if none was selected. |
GetTabArea |
Returns the associated page. |
GetTabAreaColour |
Returns the area behind the tabs colour. |
GetTileOrientation |
Returns the orientation when on tiling mode. This method can return |
HasAGWFlag |
Returns whether a flag is present in the FlatNotebook style. |
HideTabs |
Hides the tabs. |
Init |
Initializes all the class attributes. |
InsertPage |
Inserts a new page at the specified position. |
OnDropTarget |
Handles the drop action from a drag and drop operation. |
OnNavigationKey |
Handles the wx.EVT_NAVIGATION_KEY event for FlatNotebook . |
RemovePage |
Deletes the specified page, without deleting the associated window. |
SetActiveTabColour |
Sets the active tab colour. |
SetActiveTabTextColour |
Sets the text colour for the active tab. |
SetAGWWindowStyleFlag |
Sets the FlatNotebook window style flags. |
SetAllPagesShapeAngle |
Sets the angle associated to all the tab. |
SetCustomPage |
Sets a custom panel to show when there are no pages left in FlatNotebook . |
SetGradientColourBorder |
Sets the tab border colour. |
SetGradientColourFrom |
Sets the starting colour for the gradient. |
SetGradientColours |
Sets the gradient colours for the tab. |
SetGradientColourTo |
Sets the ending colour for the gradient. |
SetImageList |
Sets the image list for the page control. |
SetNavigatorIcon |
Set the icon used by the TabNavigatorWindow . |
SetNonActiveTabTextColour |
Sets the non active tabs text colour. |
SetPadding |
Sets the amount of space around each page’s icon and label, in pixels. |
SetPageImage |
Sets the image index for the given page. |
SetPageShapeAngle |
Sets the angle associated to a tab. |
SetPageText |
Sets the text for the given page. |
SetPageTextColour |
Sets the tab text colour individually. |
SetRightClickMenu |
Sets the popup menu associated to a right click on a tab. |
SetSelection |
Sets the selection for the given page. |
SetTabAreaColour |
Sets the area behind the tabs colour. |
ShowCustomPage |
Hides the custom panel which is shown when there are no pages left in FlatNotebook . |
ShowTabs |
Shows the tabs if hidden previously. |
Tile |
Shows pages in column/row mode (one panel after the other in columns/rows). |
FlatNotebook
(wx.Panel)¶The FlatNotebook
is a full implementation 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.
__init__
(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=0, name="FlatNotebook")¶Default class constructor.
Parameters: |
|
---|
AddPage
(self, page, text, select=False, imageId=-1)¶Adds a page to the FlatNotebook
.
Parameters: |
|
---|---|
Returns: |
|
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, imageList)¶Assigns the image list for the page control.
Parameters: | imageList – an instance of wx.ImageList . |
---|
DeleteAllPages
(self)¶Deletes all the pages in the FlatNotebook
.
DeletePage
(self, page)¶Deletes the specified page, and the associated window.
Parameters: | page – an integer specifying the new selected page. |
---|
Note
The call to this function generates the page changing events.
DoGetBestSize
(self)¶Gets the size which best suits the window: for a control, it would be the minimal size which doesn’t truncate the control, for a panel - the same size as it would have after a call to Fit().
Note
Overridden from Panel
.
EnableTab
(self, page, enabled=True)¶Enables or disables a tab.
Parameters: |
|
---|
EnsureVisible
(self, page)¶Ensures that a tab is visible.
Parameters: | page – an integer specifying the page index. |
---|
GetActiveTabColour
(self)¶Returns the active tab colour.
GetActiveTabTextColour
(self)¶Get the active tab text colour.
GetAGWWindowStyleFlag
(self)¶Returns the FlatNotebook
window style.
See also
SetAGWWindowStyleFlag
for a list of valid window styles.
GetBorderColour
(self)¶Returns the border colour.
GetCurrentPage
(self)¶Returns the currently selected notebook page or None
if none is selected.
GetCustomPage
(self)¶Returns a custom panel to show when there are no pages left in FlatNotebook
.
GetEnabled
(self, page)¶Returns whether a tab is enabled or not.
Parameters: | page – an integer specifying the page index. |
---|
GetGradientColourBorder
(self)¶Gets the tab border colour.
GetGradientColourFrom
(self)¶Gets first gradient colour.
GetGradientColourTo
(self)¶Gets second gradient colour.
GetImageList
(self)¶Returns the associated image list.
GetNonActiveTabTextColour
(self)¶Returns the non active tabs text colour.
GetPadding
(self)¶Returns the amount of space around each page’s icon and label, in pixels.
GetPage
(self, page)¶Returns the window at the given page position, or None
.
GetPageBestSize
(self)¶Return the page best size.
GetPageCount
(self)¶Returns the number of pages in the FlatNotebook
control.
GetPageImage
(self, page)¶Returns the image index for the given page.
Parameters: | page – an integer specifying the page index. |
---|
GetPageIndex
(self, win)¶Returns the index at which the window is found.
Parameters: | win – an instance of wx.Window . |
---|
GetPageShapeAngle
(self, page_index)¶Returns the angle associated to a tab.
Parameters: | page_index – the index of the tab for which we wish to get the shape angle. |
---|
GetPageText
(self, page)¶Returns the string for the given 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. |
---|
GetPreviousSelection
(self)¶Returns the previous selection.
GetSelection
(self)¶Returns the currently selected page, or -1 if none was selected.
GetTabArea
(self)¶Returns the associated page.
GetTabAreaColour
(self)¶Returns the area behind the tabs colour.
GetTileOrientation
(self)¶Returns the orientation when on tiling mode. This method can return
wx.VERTICAL
when the panels are vertically stacked, wx.HORIZONTAL
when they are horizontally stacked panels or None
when there is no
stacking and FlatNotebook
behaves like a normal notebook.
HasAGWFlag
(self, flag)¶Returns whether a flag is present in the FlatNotebook
style.
Parameters: | flag – one of the possible FlatNotebook window styles. |
---|
See also
SetAGWWindowStyleFlag
for a list of possible window style flags.
HideTabs
(self)¶Hides the tabs.
Init
(self)¶Initializes all the class attributes.
InsertPage
(self, indx, page, text, select=True, imageId=-1)¶Inserts a new page at the specified position.
Parameters: |
|
---|---|
Returns: |
|
OnDropTarget
(self, x, y, nTabPage, wnd_oldContainer)¶Handles the drop action from a drag and drop operation.
Parameters: |
|
---|
Handles the wx.EVT_NAVIGATION_KEY
event for FlatNotebook
.
Parameters: | event – a NavigationKeyEvent event to be processed. |
---|
RemovePage
(self, page)¶Deletes the specified page, without deleting the associated window.
Parameters: | page – an integer specifying the page index. |
---|
SetActiveTabColour
(self, colour)¶Sets the active tab colour.
Parameters: | 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). |
---|
SetActiveTabTextColour
(self, textColour)¶Sets the text colour for the active tab.
Parameters: | textColour – 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). |
---|
SetAGWWindowStyleFlag
(self, agwStyle)¶Sets the FlatNotebook
window style flags.
Parameters: | agwStyle – the AGW-specific window style. This can be a combination of the
following bits:
|
---|
SetAllPagesShapeAngle
(self, angle)¶Sets the angle associated to all the tab.
Parameters: | angle – the new shape angle for the tab (must be less than 15 degrees). |
---|
SetCustomPage
(self, panel)¶Sets a custom panel to show when there are no pages left in FlatNotebook
.
Parameters: | panel – any subclass of wx.Window will do, as long as it is suitable
to be used as a notebook page. Examples include Panel , ScrolledWindow ,
and so on. |
---|
SetGradientColourBorder
(self, border)¶Sets the tab border colour.
Parameters: | border – the border colour, an instance of wx.Colour . |
---|
SetGradientColourFrom
(self, fr)¶Sets the starting colour for the gradient.
Parameters: | fr – the first gradient colour, an instance of wx.Colour . |
---|
SetGradientColours
(self, fr, to, border)¶Sets the gradient colours for the tab.
Parameters: |
---|
SetGradientColourTo
(self, to)¶Sets the ending colour for the gradient.
Parameters: | to – the second gradient colour, an instance of wx.Colour ; |
---|
SetImageList
(self, imageList)¶Sets the image list for the page control.
Parameters: | imageList – an instance of wx.ImageList . |
---|
Set the icon used by the TabNavigatorWindow
.
Parameters: | bmp – a valid wx.Bitmap object. |
---|
SetNonActiveTabTextColour
(self, colour)¶Sets the non active tabs text colour.
Parameters: | 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). |
---|
SetPadding
(self, padding)¶Sets the amount of space around each page’s icon and label, in pixels.
Parameters: | padding – the amount of space around each page’s icon and label, in pixels. |
---|
Note
Only the horizontal padding is considered.
SetPageImage
(self, page, image)¶Sets the image index for the given page.
Parameters: |
|
---|
SetPageShapeAngle
(self, page_index, angle)¶Sets the angle associated to a tab.
Parameters: |
|
---|
SetPageText
(self, page, text)¶Sets the text for the given page.
Parameters: |
|
---|
SetPageTextColour
(self, page, colour)¶Sets the tab text colour individually.
Parameters: |
|
---|
SetRightClickMenu
(self, menu)¶Sets the popup menu associated to a right click on a tab.
Parameters: | menu – an instance of wx.Menu . |
---|
SetSelection
(self, page)¶Sets the selection for the given page.
Parameters: | page – an integer specifying the new selected page. |
---|
Note
The call to this function does not generate the page changing events.
SetTabAreaColour
(self, colour)¶Sets the area behind the tabs colour.
Parameters: | 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). |
---|
ShowCustomPage
(self, show=True)¶Hides the custom panel which is shown when there are no pages left in FlatNotebook
.
ShowTabs
(self)¶Shows the tabs if hidden previously.
Tile
(self, orient=None)¶Shows pages in column/row mode (one panel after the other in columns/rows).
Parameters: | orient – this parameter represents the orientation of the stacked
panels. Pass wx.VERTICAL to get vertically stacked panels, wx.HORIZONTAL
to get horizontally stacked panels or None to return to the default
FlatNotebook behaviour with tabs. |
---|