Phoenix Logo

phoenix_title 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 Class Hierarchy

Inheritance diagram for class FNBRenderer:


method_summary Methods Summary

__init__ Default class constructor.
CalcTabHeight Calculates the height of the input tab.
CalcTabWidth Calculates the width of the input tab.
DrawArrowAccordingToState Draws the left and right scrolling arrows.
DrawDragHint Draws tab drag hint, the default implementation is to do nothing.
DrawDropDownArrow Draws the drop-down arrow in the navigation area.
DrawFocusRectangle Draws a focus rectangle like the native Notebook.
DrawLeftArrow Draws the left navigation arrow.
DrawRightArrow Draws the right navigation arrow.
DrawTabs Actually draws the tabs in FlatNotebook.
DrawTabsLine Draws a line over the tabs.
DrawTabX Draws the ‘X’ in the selected tab.
DrawX Draw the ‘X’ navigation button in the navigation area.
GetButtonsAreaLength Returns the navigation area width.
GetDropArrowButtonPos Returns the drop down button position in the navigation area.
GetLeftButtonPos Returns the left button position in the navigation area.
GetRightButtonPos Returns the right button position in the navigation area.
GetXPos Returns the ‘X’ button position in the navigation area.
NumberTabsCanFit Calculates the number of tabs that can fit on the available space on screen.

api 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:


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:


DrawRightArrow(self, pageContainer, dc)

Draws the right navigation arrow.

Parameters:


DrawTabs(self, pageContainer, dc)

Actually draws the tabs in FlatNotebook.

Parameters:


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:


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.