wx.lib.agw.flatnotebook.FNBRenderer¶
Parent class for the 6 renderers defined: Standard, VC71, Fancy, Firefox 2, VC8 and Ribbon. This class implements the common methods of all 6 renderers.
Class Hierarchy¶
Known Subclasses¶
wx.lib.agw.flatnotebook.FNBRendererDefault
, wx.lib.agw.flatnotebook.FNBRendererFancy
, wx.lib.agw.flatnotebook.FNBRendererFirefox2
, wx.lib.agw.flatnotebook.FNBRendererRibbonTabs
, wx.lib.agw.flatnotebook.FNBRendererVC71
, wx.lib.agw.flatnotebook.FNBRendererVC8
Methods Summary¶
Default class constructor. |
|
Calculates the height of the input tab. |
|
Calculates the width of the input tab. |
|
Draws the left and right scrolling arrows. |
|
Draws tab drag hint, the default implementation is to do nothing. |
|
Draws the drop-down arrow in the navigation area. |
|
Draws a focus rectangle like the native |
|
Draws the left navigation arrow. |
|
Draws the right navigation arrow. |
|
Actually draws the tabs in |
|
Draws a line over the tabs. |
|
Draws the ‘X’ in the selected tab. |
|
Draw the ‘X’ navigation button in the navigation area. |
|
Returns the navigation area width. |
|
Returns the drop down button position in the navigation area. |
|
Returns the left button position in the navigation area. |
|
Returns the right button position in the navigation area. |
|
Returns the ‘X’ button position in the navigation area. |
|
Calculates the number of tabs that can fit on the available space on screen. |
Class API¶
- class FNBRenderer(object)¶
Parent class for the 6 renderers defined: Standard, VC71, Fancy, Firefox 2, VC8 and Ribbon. This class implements the common methods of all 6 renderers.
Methods¶
- __init__(self)¶
Default class constructor.
- CalcTabHeight(self, pageContainer)¶
Calculates the height of the input tab.
- Parameters:
pageContainer – an instance of
FlatNotebook
.
- CalcTabWidth(self, pageContainer, tabIdx, tabHeight)¶
Calculates the width of the input tab.
- Parameters:
pageContainer – an instance of
FlatNotebook
;tabIdx – the index of the input tab;
tabHeight – the height of the tab.
- DrawArrowAccordingToState(self, dc, pc, rect)¶
Draws the left and right scrolling arrows.
- Parameters:
dc – an instance of
wx.DC
;pc – an instance of
FlatNotebook
;rect – the client rectangle containing the scrolling arrows.
- DrawDragHint(self, pc, tabIdx)¶
Draws tab drag hint, the default implementation is to do nothing. You can override this function to provide a nice feedback to user.
- Parameters:
pc – an instance of
FlatNotebook
;tabIdx – the index of the tab we are dragging.
Note
To show your own custom drag and drop UI feedback, you must override this method in your derived class.
- DrawDropDownArrow(self, pageContainer, dc)¶
Draws the drop-down arrow in the navigation area.
- Parameters:
pageContainer – an instance of
FlatNotebook
;dc – an instance of
wx.DC
.
- DrawFocusRectangle(self, dc, pageContainer, page)¶
Draws a focus rectangle like the native
Notebook
.- Parameters:
dc – an instance of
wx.DC
;pageContainer – an instance of
FlatNotebook
;page – an instance of
PageInfo
, representing a page in the notebook.
- DrawLeftArrow(self, pageContainer, dc)¶
Draws the left navigation arrow.
- Parameters:
pageContainer – an instance of
FlatNotebook
;dc – an instance of
wx.DC
.
- DrawRightArrow(self, pageContainer, dc)¶
Draws the right navigation arrow.
- Parameters:
pageContainer – an instance of
FlatNotebook
;dc – an instance of
wx.DC
.
- DrawTabs(self, pageContainer, dc)¶
Actually draws the tabs in
FlatNotebook
.- Parameters:
pageContainer – an instance of
FlatNotebook
;dc – an instance of
wx.DC
.
- DrawTabsLine(self, pageContainer, dc, selTabX1=-1, selTabX2=-1)¶
Draws a line over the tabs.
- Parameters:
pageContainer – an instance of
FlatNotebook
;dc – an instance of
wx.DC
;selTabX1 – first x coordinate of the tab line;
selTabX2 – second x coordinate of the tab line.
- DrawTabX(self, pageContainer, dc, rect, tabIdx, btnStatus)¶
Draws the ‘X’ in the selected tab.
- Parameters:
pageContainer – an instance of
FlatNotebook
;dc – an instance of
wx.DC
;rect – the current tab client rectangle;
tabIdx – the index of the current tab;
btnStatus – the status of the ‘X’ button in the current tab.
- DrawX(self, pageContainer, dc)¶
Draw the ‘X’ navigation button in the navigation area.
- Parameters:
pageContainer – an instance of
FlatNotebook
;dc – an instance of
wx.DC
.
- GetButtonsAreaLength(self, pageContainer)¶
Returns the navigation area width.
- Parameters:
pageContainer – an instance of
FlatNotebook
.
- GetDropArrowButtonPos(self, pageContainer)¶
Returns the drop down button position in the navigation area.
- Parameters:
pageContainer – an instance of
FlatNotebook
.
- GetLeftButtonPos(self, pageContainer)¶
Returns the left button position in the navigation area.
- Parameters:
pageContainer – an instance of
FlatNotebook
.
- GetRightButtonPos(self, pageContainer)¶
Returns the right button position in the navigation area.
- Parameters:
pageContainer – an instance of
FlatNotebook
.
- GetXPos(self, pageContainer)¶
Returns the ‘X’ button position in the navigation area.
- Parameters:
pageContainer – an instance of
FlatNotebook
.
- NumberTabsCanFit(self, pageContainer, fr=-1)¶
Calculates the number of tabs that can fit on the available space on screen.
- Parameters:
pageContainer – an instance of
FlatNotebook
;fr – the current first visible tab.