fsleyes_widgets.notebook
¶
This module provides the Notebook
class, a notebook control
similar to the wx.Notebook
.
-
class
fsleyes_widgets.notebook.
Notebook
(parent, style=None, border=5)¶ Bases:
wx._core.Panel
A
wx.Panel
which provideswx.Notebook
-like functionality. Manages the display of multiple child windows. A row of buttons along one side allows the user to select which child window to display.This
Notebook
implementation supports page enabling/disabling, and toggling of page visibility.Create a
Notebook
object.The side on which the notebook page buttons will be displayed can be controlled by setting one of
wx.TOP
(the default),wx.BOTTOM
,wx.LEFT
, orwx.RIGHT
on thestyle
flags.The orientation of the page buttons can be set to either horizontal (the default) or vertical by setting one of
wx.HORIZONTAL
orwx.VERTICAL
on thestyle
flags.- Parameters
parent – The
wx
parent object.style – Passed to
wx.Panel.__init__
. If not provided, defaults towx.TOP | wx.HORIZONTAL | wx.SUNKEN_BORDER
.border – Border (in pixels) around pages. Defaults to 5.
-
__init__
(parent, style=None, border=5)¶ Create a
Notebook
object.The side on which the notebook page buttons will be displayed can be controlled by setting one of
wx.TOP
(the default),wx.BOTTOM
,wx.LEFT
, orwx.RIGHT
on thestyle
flags.The orientation of the page buttons can be set to either horizontal (the default) or vertical by setting one of
wx.HORIZONTAL
orwx.VERTICAL
on thestyle
flags.- Parameters
parent – The
wx
parent object.style – Passed to
wx.Panel.__init__
. If not provided, defaults towx.TOP | wx.HORIZONTAL | wx.SUNKEN_BORDER
.border – Border (in pixels) around pages. Defaults to 5.
-
property
pages
¶ Returns a list containing references to all of the pages in this
Notebook
.
Returns a list containing references to all of the page buttons in this
Notebook
.
-
SetButtonColours
(**kwargs)¶ Set the colours used for the notebook page buttons. Set any colour to
None
to use the default colours. All arguments must be passed as keyword arguments.- Parameters
text – Text colour
disabledText – Text colour for disabled pages.
default – Default (unselected) background colour.
selected – Selected background colour.
-
PageCount
()¶ Returns the number of pages in this
Notebook
.
-
FindPage
(page)¶ Returns the index of the given page, or
wx.NOT_FOUND
if the page is not in this notebook.
-
InsertPage
(index, page, text)¶ Inserts the given page into the notebook at the specified index. A button for the page is also added to the button row, with the specified text.
-
AddPage
(page, text)¶ Adds the given page (and a corresponding button with the given text) to the end of the notebook.
-
RemovePage
(index)¶ Removes the page at the specified index, but does not destroy it.
-
DeletePage
(index)¶ Removes the page at the specified index, and (attempts to) destroy it.
-
GetSelection
()¶ Returns the index of the currently selected page, or
None
if there are no pages.
-
SetSelection
(index)¶ Sets the displayed page to the one at the specified index.
-
AdvanceSelection
(forward=True)¶ Selects the next (or previous, if
forward
isFalse
) enabled page.
-
EnablePage
(index)¶ Enables the page at the specified index.
-
DisablePage
(index)¶ Disables the page at the specified index.
-
ShowPage
(index)¶ Shows the page at the specified index.
-
HidePage
(index)¶ Hides the page at the specified index.
-
_Notebook__onButton
(ev)¶ Called when a page button is pushed. Selects the respective page, and emits a
PageChangeEvent
.
-
_Notebook__updateMinSize
()¶ Calculate and return the best (minimum) size for this
Notebook
instance.The returned size is the minimum size of the largest page, plus the size of the button panel.
-
__module__
= 'fsleyes_widgets.notebook'¶
-
fsleyes_widgets.notebook.
EVT_PAGE_CHANGE
= <wx.core.PyEventBinder object>¶ Identifier for the
PageChangeEvent
event.
-
fsleyes_widgets.notebook.
PageChangeEvent
¶ alias of
wx.lib.newevent.NewEvent.<locals>._Event