AGW Logo

agw_title 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.

hierarchy Inheritance Diagram

Inheritance diagram for: FNBRenderer

Inheritance diagram of FNBRenderer


method_summary Methods Summary

__init__Default class constructor.
CalcTabHeightCalculates the height of the input tab.
CalcTabWidthCalculates the width of the input tab.
DrawArrowAccordingToStateDraws the left and right scrolling arrows.
DrawDragHintDraws tab drag hint, the default implementation is to do nothing.
DrawDropDownArrowDraws the drop-down arrow in the navigation area.
DrawFocusRectangleDraws a focus rectangle like the native wx.Notebook.
DrawLeftArrowDraws the left navigation arrow.
DrawRightArrowDraws the right navigation arrow.
DrawTabXDraws the ‘X’ in the selected tab.
DrawTabsActually draws the tabs in FlatNotebook.
DrawTabsLineDraws a line over the tabs.
DrawXDraw the ‘X’ navigation button in the navigation area.
GetButtonsAreaLengthReturns the navigation area width.
GetDropArrowButtonPosReturns the drop down button position in the navigation area.
GetLeftButtonPosReturns the left button position in the navigation area.
GetRightButtonPosReturns the right button position in the navigation area.
GetXPosReturns the ‘X’ button position in the navigation area.
NumberTabsCanFitCalculates the number of tabs that can fit on the available space on screen.

API Class API

class FNBRenderer(object)[source]

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.



__init__()[source]

Default class constructor.



CalcTabHeight(pageContainer)[source]

Calculates the height of the input tab.

Parameters:pageContainer – an instance of FlatNotebook.


CalcTabWidth(pageContainer, tabIdx, tabHeight)[source]

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(dc, pc, rect)[source]

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(pc, tabIdx)[source]

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(pageContainer, dc)[source]

Draws the drop-down arrow in the navigation area.

Parameters:


DrawFocusRectangle(dc, pageContainer, page)[source]

Draws a focus rectangle like the native wx.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(pageContainer, dc)[source]

Draws the left navigation arrow.

Parameters:


DrawRightArrow(pageContainer, dc)[source]

Draws the right navigation arrow.

Parameters:


DrawTabX(pageContainer, dc, rect, tabIdx, btnStatus)[source]

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.


DrawTabs(pageContainer, dc)[source]

Actually draws the tabs in FlatNotebook.

Parameters:


DrawTabsLine(pageContainer, dc, selTabX1=-1, selTabX2=-1)[source]

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.


DrawX(pageContainer, dc)[source]

Draw the ‘X’ navigation button in the navigation area.

Parameters:


GetButtonsAreaLength(pageContainer)[source]

Returns the navigation area width.

Parameters:pageContainer – an instance of FlatNotebook.


GetDropArrowButtonPos(pageContainer)[source]

Returns the drop down button position in the navigation area.

Parameters:pageContainer – an instance of FlatNotebook.


GetLeftButtonPos(pageContainer)[source]

Returns the left button position in the navigation area.

Parameters:pageContainer – an instance of FlatNotebook.


GetRightButtonPos(pageContainer)[source]

Returns the right button position in the navigation area.

Parameters:pageContainer – an instance of FlatNotebook.


GetXPos(pageContainer)[source]

Returns the ‘X’ button position in the navigation area.

Parameters:pageContainer – an instance of FlatNotebook.


NumberTabsCanFit(pageContainer, fr=-1)[source]

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.
Tree

Table Of Contents

Previous topic

FNBDropTarget

Next topic

FNBRendererDefault