AGW Logo

flatnotebook functions

This is the description of standalone Python functions in the flatnotebook module.

method_summary Functions Summary


AdjustColour Brighten/darken input colour by percent and adjust alpha channel if needed.
DrawButton Draws a FlatNotebook tab.
FormatColour Convert the input colour into a valid wx.Colour instance, using whatever typemap
LightColour Brighten the input colour by a percentage.
PaintStraightGradientBox Draws a gradient coloured box from startColour to endColour.
RandomColour Creates a random colour.

API Functions API



AdjustColour(colour, percent, alpha=255)[source]

Brighten/darken input colour by percent and adjust alpha channel if needed.

Parameters:
  • colour – colour object to adjust, an instance of wx.Colour;

  • percent – percent to adjust + (brighten) or - (darken);
  • alpha – amount to adjust the alpha channel.
Returns:

The modified colour.



DrawButton(dc, rect, focus, upperTabs)[source]

Draws a FlatNotebook tab.

Parameters:
  • dc – an instance of wx.DC;
  • rect – the tab’s client rectangle;
  • focusTrue if the tab has focus, False otherwise;
  • upperTabsTrue if the tabs are at the top, False if they are at the bottom.


FormatColour(colour)[source]

Convert the input colour into a valid wx.Colour instance, using whatever typemap accepted by wxWidgets/wxPython.

Parameters:colour – can be an instance of wx.Colour, a 3 or 4 integer tuple, a hex string, a string representing the colour name or None.

Returns:a valid instance of wx.Colour or None if the input colour was None in the first place.


LightColour(colour, percent)[source]

Brighten the input colour by a percentage.

Parameters:
  • colour – a valid wx.Colour instance;

  • percent – the percentage by which the input colour should be brightened.


PaintStraightGradientBox(dc, rect, startColour, endColour, vertical=True)[source]

Draws a gradient coloured box from startColour to endColour.

Parameters:
  • dc – an instance of wx.DC;

  • rect – the rectangle to fill with the gradient shading;
  • startColour – the first colour in the gradient shading;
  • endColour – the last colour in the gradient shading;
  • verticalTrue if the gradient shading is north to south, False if it is east to west.


RandomColour()[source]

Creates a random colour.

Tree

Table Of Contents

Previous topic

TabNavigatorWindow

Next topic

SVN Revision 68362 For flatnotebook