.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.artmanager

.. highlight:: python



.. _wx.lib.agw.artmanager.ArtManager:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.artmanager.ArtManager**
==========================================================================================================================================

This class provides various art utilities, such as creating shadow, providing
lighter / darker colours for a given colour, etc...



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>ArtManager</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.agw.artmanager.ArtManager_inheritance.png" alt="Inheritance diagram of ArtManager" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="19,5,120,35"/> <area shape="rect" id="node2" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="71,83,181,112"/> <area shape="rect" id="node4" href="wx.lib.agw.artmanager.ArtManager.html" title="wx.lib.agw.artmanager.ArtManager" alt="" coords="5,160,248,189"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="144,5,225,35"/> </map> 
   </p>

|


|super_classes| Known Superclasses
==================================

:class:`wx.EvtHandler`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.agw.artmanager.ArtManager.__init__`                               Default class constructor.
:meth:`~wx.lib.agw.artmanager.ArtManager.AddMenuTheme`                           Adds a new theme to the stock.
:meth:`~wx.lib.agw.artmanager.ArtManager.BackgroundColour`                       Returns the background colour of a control when not in focus.
:meth:`~wx.lib.agw.artmanager.ArtManager.CalcButtonBestSize`                     Returns the best fit size for the supplied label & bitmap.
:meth:`~wx.lib.agw.artmanager.ArtManager.CanMakeWindowsTransparent`              Used internally.
:meth:`~wx.lib.agw.artmanager.ArtManager.ConvertToBitmap`                        Convert the given image to a bitmap, optionally overlaying an alpha
:meth:`~wx.lib.agw.artmanager.ArtManager.CreateGreyBitmap`                       Creates a grey bitmap image from the input bitmap.
:meth:`~wx.lib.agw.artmanager.ArtManager.DarkColour`                             Like the :meth:`~ArtManager.LightColour` function, but create the colour darker by `percent`.
:meth:`~wx.lib.agw.artmanager.ArtManager.DrawBitmapShadow`                       Draws a shadow using background bitmap.
:meth:`~wx.lib.agw.artmanager.ArtManager.DrawButton`                             Colour rectangle according to the theme.
:meth:`~wx.lib.agw.artmanager.ArtManager.DrawButtonColour`                       Draws a button using the appropriate theme.
:meth:`~wx.lib.agw.artmanager.ArtManager.DrawButtonTheme`                        Draws a button using the appropriate theme.
:meth:`~wx.lib.agw.artmanager.ArtManager.DrawDragSash`                           Draws resize sash.
:meth:`~wx.lib.agw.artmanager.ArtManager.DrawMenuBarBg`                          Draws the menu bar background according to the active theme.
:meth:`~wx.lib.agw.artmanager.ArtManager.DrawMenuBarBorder`                      Enables menu border drawing (XP style only).
:meth:`~wx.lib.agw.artmanager.ArtManager.DrawTextAndBitmap`                      Draws the text & bitmap on the input dc.
:meth:`~wx.lib.agw.artmanager.ArtManager.DrawToolBarBg`                          Draws the toolbar background according to the active theme.
:meth:`~wx.lib.agw.artmanager.ArtManager.DropShadow`                             Adds a shadow under the window (Windows only).
:meth:`~wx.lib.agw.artmanager.ArtManager.FillStockBitmaps`                       Initializes few standard bitmaps.
:meth:`~wx.lib.agw.artmanager.ArtManager.FrameColour`                            Return the surrounding colour for a control.
:meth:`~wx.lib.agw.artmanager.ArtManager.Free`                                   Destructor for the unique art manager object.
:meth:`~wx.lib.agw.artmanager.ArtManager.Get`                                    Accessor to the unique art manager object.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetAccelIndex`                          Returns the mnemonic index of the label and the label stripped of the ampersand mnemonic
:meth:`~wx.lib.agw.artmanager.ArtManager.GetAlignBuffer`                         Return the padding buffer for a text or bitmap.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetBitmapStartLocation`                 Returns the top left `x` and `y` cordinates of the bitmap drawing.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetColourSchemes`                       Returns the available colour schemes.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetFont`                                Returns the font used by this theme.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetMBVerticalGradient`                  Returns ``True`` if the menu bar should be painted with vertical gradient.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetMenuBarBorder`                       Returns menu bar border drawing flag.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetMenuBarColourScheme`                 Returns the current colour scheme.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetMenuBarFaceColour`                   Returns the menu bar face colour.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetMenuBarSelectionColour`              Returns the menu bar selection colour.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetMenuBgFactor`                        Gets the visibility depth of the menu in Metallic style.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetMenuFaceColour`                      Returns the colour used for the menu foreground.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetMenuTheme`                           Returns the currently used menu theme.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetMS2007ButtonSunken`                  Returns the sunken flag for MS 2007 buttons.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetRaiseToolbar`                        Returns ``True`` if we are dropping a shadow under a toolbar.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetStockBitmap`                         Returns a bitmap from a stock.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetTextColourDisable`                   Returns the colour used for disabled menu items.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetTextColourEnable`                    Returns the colour used for enabled menu items.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetTextStartLocation`                   Returns the top left `x` and `y` cordinates of the text drawing.
:meth:`~wx.lib.agw.artmanager.ArtManager.GetThemeBaseColour`                     Returns the theme (Blue, Silver, Green etc.) base colour, if no theme is active
:meth:`~wx.lib.agw.artmanager.ArtManager.GetTransparency`                        Returns the alpha channel value for transparent windows.
:meth:`~wx.lib.agw.artmanager.ArtManager.HighlightBackgroundColour`              Returns the background colour of a control when it is in focus.
:meth:`~wx.lib.agw.artmanager.ArtManager.InitColours`                            Initialise the colour map.
:meth:`~wx.lib.agw.artmanager.ArtManager.Initialize`                             Initializes the bitmaps and colours.
:meth:`~wx.lib.agw.artmanager.ArtManager.IsDark`                                 Returns whether a colour is dark or light.
:meth:`~wx.lib.agw.artmanager.ArtManager.LightColour`                            Return light contrast of `colour`. The colour returned is from the scale of
:meth:`~wx.lib.agw.artmanager.ArtManager.MakeWindowTransparent`                  Used internally. Makes a toplevel window transparent if the system supports it.
:meth:`~wx.lib.agw.artmanager.ArtManager.MixColours`                             Return mix of input colours.
:meth:`~wx.lib.agw.artmanager.ArtManager.OnSysColourChange`                      Handles the ``wx.EVT_SYS_COLOUR_CHANGED`` event for :class:`ArtManager`.
:meth:`~wx.lib.agw.artmanager.ArtManager.PaintCrescentGradientBox`               Paint a region with gradient colouring. The gradient is in crescent shape
:meth:`~wx.lib.agw.artmanager.ArtManager.PaintDiagonalGradientBox`               Paint rectangle with gradient colouring; the gradient lines are diagonal
:meth:`~wx.lib.agw.artmanager.ArtManager.PaintGradientRegion`                    Paint a region with gradient colouring.
:meth:`~wx.lib.agw.artmanager.ArtManager.PaintStraightGradientBox`               Paint the rectangle with gradient colouring; the gradient lines are either
:meth:`~wx.lib.agw.artmanager.ArtManager.RandomColour`                           Creates a random colour.
:meth:`~wx.lib.agw.artmanager.ArtManager.SetMBVerticalGradient`                  Sets the menu bar gradient style.
:meth:`~wx.lib.agw.artmanager.ArtManager.SetMenuBarColour`                       Sets the menu bar colour scheme to use.
:meth:`~wx.lib.agw.artmanager.ArtManager.SetMenuTheme`                           Set the menu theme, possible values (Style2007, StyleXP, StyleVista).
:meth:`~wx.lib.agw.artmanager.ArtManager.SetMS2007ButtonSunken`                  Sets MS 2007 button style sunken or not.
:meth:`~wx.lib.agw.artmanager.ArtManager.SetRaiseToolbar`                        Enables/disables toobar shadow drop.
:meth:`~wx.lib.agw.artmanager.ArtManager.SetTransparency`                        Sets the alpha channel value for transparent windows.
:meth:`~wx.lib.agw.artmanager.ArtManager.TakeScreenShot`                         Takes a screenshot of the screen at given position & size (rect).
:meth:`~wx.lib.agw.artmanager.ArtManager.TruncateText`                           Truncates a given string to fit given width size. if the text does not fit
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: ArtManager(wx.EvtHandler)

   This class provides various art utilities, such as creating shadow, providing
   lighter / darker colours for a given colour, etc...

   .. method:: __init__(self)

      Default class constructor. 


   .. method:: AddMenuTheme(self, render)

      Adds a new theme to the stock.
      
      :param `render`: a rendering theme class, which must be derived from
       :class:`RendererBase`.
      
      :return: An integer representing the size of the renderers dictionary.


   .. method:: BackgroundColour(self)

      Returns the background colour of a control when not in focus.
      
      :return: An instance of :class:`wx.Colour`.


   .. method:: CalcButtonBestSize(self, label, bmp)

      Returns the best fit size for the supplied label & bitmap.
      
      :param string `label`: the button label;
      :param `bmp`: the bitmap associated with the button, an instance of :class:`wx.Bitmap`.
      
      :return: An instance of :class:`wx.Size`, representing the best fit size for the supplied label & bitmap.


   .. method:: CanMakeWindowsTransparent(self)

      Used internally.
      
      :return: ``True`` if the system supports transparency of toplevel windows,
       otherwise returns ``False``.


   .. method:: ConvertToBitmap(self, xpm, alpha=None)

      Convert the given image to a bitmap, optionally overlaying an alpha
      channel to it.
      
      :param `xpm`: a list of strings formatted as XPM;
      :type `xpm`: list of strings
      :param `alpha`: a list of alpha values, the same size as the xpm bitmap.
      :type `alpha`: list of integers
      
      :return: An instance of :class:`wx.Bitmap`.


   .. method:: CreateGreyBitmap(self, bmp)

      Creates a grey bitmap image from the input bitmap.
      
      :param `bmp`: a valid :class:`wx.Bitmap` object to be greyed out.
      
      :return: A greyed-out representation of the input bitmap, an instance of :class:`wx.Bitmap`.


   .. method:: DarkColour(self, colour, percent)

      Like the :meth:`~ArtManager.LightColour` function, but create the colour darker by `percent`.
      
      :param `colour`: the input colour to be darkened, an instance of :class:`wx.Colour`;
      :param integer `percent`: determines how dark the colour will be. `percent` = ``100``
       returns black, `percent` = ``0`` returns `colour`.
      
      :return: A dark contrast of the input `colour`, an instance of :class:`wx.Colour`.


   .. method:: DrawBitmapShadow(self, dc, rect, where=BottomShadow|RightShadow)

      Draws a shadow using background bitmap.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the bitmap's client rectangle;
      :param integer `where`: where to draw the shadow. This can be any combination of the
       following bits:
      
       ========================== ======= ================================
       Shadow Settings             Value  Description
       ========================== ======= ================================
       ``RightShadow``                  1 Right side shadow
       ``BottomShadow``                 2 Not full bottom shadow
       ``BottomShadowFull``             4 Full bottom shadow
       ========================== ======= ================================


   .. method:: DrawButton(self, dc, rect, theme, state, input=None)

      Colour rectangle according to the theme.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the rectangle to be filled with gradient shading;
      :param string `theme`: the theme to use to draw the button;
      :param integer `state`: the button state;
      :param `input`: a flag used to call the right method.


   .. method:: DrawButtonColour(self, dc, rect, theme, state, colour)

      Draws a button using the appropriate theme.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the button's client rectangle;
      :param string `theme`: the theme to use to draw the button;
      :param integer `state`: the button state;
      :param `colour`: a valid :class:`wx.Colour` instance.


   .. method:: DrawButtonTheme(self, dc, rect, theme, state, useLightColours=True)

      Draws a button using the appropriate theme.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the button's client rectangle;
      :param string `theme`: the theme to use to draw the button;
      :param integer `state`: the button state;
      :param bool  `useLightColours`: ``True`` to use light colours, ``False`` otherwise.


   .. method:: DrawDragSash(self, rect)

      Draws resize sash.
      
      :param wx.Rect `rect`: the sash client rectangle.


   .. method:: DrawMenuBarBg(self, dc, rect)

      Draws the menu bar background according to the active theme.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the menubar's client rectangle.


   .. method:: DrawMenuBarBorder(self, border)

      Enables menu border drawing (XP style only).
      
      :param bool `border`: ``True`` to draw the menubar border, ``False`` otherwise.


   .. method:: DrawTextAndBitmap(self, dc, rect, text, enable=True, font=wx.NullFont, fontColour=wx.BLACK, bitmap=wx.NullBitmap, grayBitmap=wx.NullBitmap, style=0)

      Draws the text & bitmap on the input dc.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the text and bitmap client rectangle;
      :param string `text`: the button label;
      :param bool `enable`: ``True`` if the button is enabled, ``False`` otherwise;
      :param `font`: the font to use to draw the text, an instance of :class:`wx.Font`;
      :param `fontColour`: the colour to use to draw the text, an instance of
       :class:`wx.Colour`;
      :param `bitmap`: the bitmap associated with the button, an instance of :class:`wx.Bitmap`;
      :param `grayBitmap`: a greyed-out version of the input `bitmap` representing
       a disabled bitmap, an instance of :class:`wx.Bitmap`;
      :param integer `style`: the button style.
      
      :see: :meth:`~ArtManager.GetBitmapStartLocation` for a list of valid button styles.


   .. method:: DrawToolBarBg(self, dc, rect)

      Draws the toolbar background according to the active theme.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the toolbar's client rectangle.


   .. method:: DropShadow(self, wnd, drop=True)

      Adds a shadow under the window (Windows only).
      
      :param `wnd`: the window for which we are dropping a shadow, an instance of :class:`TopLevelWindow`;
      :param bool `drop`: ``True`` to drop a shadow, ``False`` to remove it.


   .. method:: FillStockBitmaps(self)

      Initializes few standard bitmaps. 


   .. method:: FrameColour(self)

      Return the surrounding colour for a control.
      
      :return: An instance of :class:`wx.Colour`.


   .. classmethod:: Free(self)

      Destructor for the unique art manager object. 


   .. classmethod:: Get(self)

      Accessor to the unique art manager object.
      
      :return: A unique instance of :class:`ArtManager`.


   .. method:: GetAccelIndex(self, label)

      Returns the mnemonic index of the label and the label stripped of the ampersand mnemonic
      (e.g. 'lab&el' ==> will result in 3 and labelOnly = label).
      
      :param string `label`: a string containining an ampersand.
      
      :return: A tuple containining the mnemonic index of the label and the label
       stripped of the ampersand mnemonic.


   .. method:: GetAlignBuffer(self)

      Return the padding buffer for a text or bitmap.
      
      :return: An integer representing the padding buffer.


   .. method:: GetBitmapStartLocation(self, dc, rect, bitmap, text="", style=0)

      Returns the top left `x` and `y` cordinates of the bitmap drawing.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the bitmap's client rectangle;
      :param wx.Bitmap `bitmap`: the bitmap associated with the button;
      :param string `text`: the button label;
      :param integer `style`: the button style. This can be one of the following bits:
      
       ============================== ======= ================================
       Button style                    Value  Description
       ============================== ======= ================================
       ``BU_EXT_XP_STYLE``               1    A button with a XP style
       ``BU_EXT_2007_STYLE``             2    A button with a MS Office 2007 style
       ``BU_EXT_LEFT_ALIGN_STYLE``       4    A left-aligned button
       ``BU_EXT_CENTER_ALIGN_STYLE``     8    A center-aligned button
       ``BU_EXT_RIGHT_ALIGN_STYLE``      16   A right-aligned button
       ``BU_EXT_RIGHT_TO_LEFT_STYLE``    32   A button suitable for right-to-left languages
       ============================== ======= ================================
      
      :return: A tuple containining the top left `x` and `y` cordinates of the bitmap drawing.


   .. method:: GetColourSchemes(self)

      Returns the available colour schemes.
      
      :return: A list of strings representing the available colour schemes.


   .. method:: GetFont(self)

      Returns the font used by this theme.
      
      :return: An instance of :class:`wx.Font`.


   .. method:: GetMBVerticalGradient(self)

      Returns ``True`` if the menu bar should be painted with vertical gradient. 


   .. method:: GetMenuBarBorder(self)

      Returns menu bar border drawing flag.
      
      :return: ``True`` if the menu bar border is to be drawn, ``False`` otherwise.


   .. method:: GetMenuBarColourScheme(self)

      Returns the current colour scheme.
      
      :return: A string representing the current colour scheme.


   .. method:: GetMenuBarFaceColour(self)

      Returns the menu bar face colour.
      
      :return: An instance of :class:`wx.Colour`.


   .. method:: GetMenuBarSelectionColour(self)

      Returns the menu bar selection colour.
      
      :return: An instance of :class:`wx.Colour`.


   .. method:: GetMenuBgFactor(self)

      Gets the visibility depth of the menu in Metallic style.
      The higher the value, the menu bar will look more raised


   .. method:: GetMenuFaceColour(self)

      Returns the colour used for the menu foreground.
      
      :return: An instance of :class:`wx.Colour`.


   .. method:: GetMenuTheme(self)

      Returns the currently used menu theme.
      
      :return: A string containining the currently used theme for the menu.


   .. method:: GetMS2007ButtonSunken(self)

      Returns the sunken flag for MS 2007 buttons.
      
      :return: ``True`` if the MS 2007 buttons are sunken, ``False`` otherwise.


   .. method:: GetRaiseToolbar(self)

      Returns ``True`` if we are dropping a shadow under a toolbar. 


   .. method:: GetStockBitmap(self, name)

      Returns a bitmap from a stock.
      
      :param string `name`: the bitmap name.
      
      :return: The stock bitmap, if `name` was found in the stock bitmap dictionary.
       Othewise, :class:`NullBitmap` is returned.


   .. method:: GetTextColourDisable(self)

      Returns the colour used for disabled menu items.
      
      :return: An instance of :class:`wx.Colour`.


   .. method:: GetTextColourEnable(self)

      Returns the colour used for enabled menu items.
      
      :return: An instance of :class:`wx.Colour`.


   .. method:: GetTextStartLocation(self, dc, rect, bitmap, text, style=0)

      Returns the top left `x` and `y` cordinates of the text drawing.
      In case the text is too long, the text is being fixed (the text is cut and
      a '...' mark is added in the end).
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the text's client rectangle;
      :param wx.Bitmap `bitmap`: the bitmap associated with the button;
      :param string `text`: the button label;
      :param integer `style`: the button style.
      
      :return: A tuple containining the top left `x` and `y` cordinates of the text drawing, plus
       the truncated version of the input `text`.
      
      :see: :meth:`~ArtManager.GetBitmapStartLocation` for a list of valid button styles.


   .. method:: GetThemeBaseColour(self, useLightColours=True)

      Returns the theme (Blue, Silver, Green etc.) base colour, if no theme is active
      it return the active caption colour, lighter in 30%.
      
      :param bool `useLightColours`: ``True`` to use light colours, ``False`` otherwise.
      
      :return: An instance of :class:`wx.Colour`.


   .. method:: GetTransparency(self)

      Returns the alpha channel value for transparent windows.
      
      :return: An integer representing the alpha channel value.


   .. method:: HighlightBackgroundColour(self)

      Returns the background colour of a control when it is in focus.
      
      :return: An instance of :class:`wx.Colour`.


   .. method:: InitColours(self)

      Initialise the colour map. 


   .. method:: Initialize(self)

      Initializes the bitmaps and colours. 


   .. method:: IsDark(self, colour)

      Returns whether a colour is dark or light.
      
      :param `colour`: an instance of :class:`wx.Colour`.
      
      :return: ``True`` if the average RGB values are dark, ``False`` otherwise.


   .. method:: LightColour(self, colour, percent)

      Return light contrast of `colour`. The colour returned is from the scale of
      `colour` ==> white.
      
      :param `colour`: the input colour to be brightened, an instance of :class:`wx.Colour`;
      :param integer `percent`: determines how light the colour will be. `percent` = ``100``
       returns white, `percent` = ``0`` returns `colour`.
      
      :return: A light contrast of the input `colour`, an instance of :class:`wx.Colour`.


   .. method:: MakeWindowTransparent(self, wnd, amount)

      Used internally. Makes a toplevel window transparent if the system supports it.
      
      :param `wnd`: the toplevel window to make transparent, an instance of :class:`TopLevelWindow`;
      :param integer `amount`: the window transparency to apply.


   .. method:: MixColours(self, firstColour, secondColour, percent)

      Return mix of input colours.
      
      :param `firstColour`: the first colour to be mixed, an instance of :class:`wx.Colour`;
      :param `secondColour`: the second colour to be mixed, an instance of :class:`wx.Colour`;
      :param integer `percent`: the relative percentage of `firstColour` with respect to
       `secondColour`.
      
      :return: An instance of :class:`wx.Colour`.


   .. method:: OnSysColourChange(self, event)

      Handles the ``wx.EVT_SYS_COLOUR_CHANGED`` event for :class:`ArtManager`.
      
      :param `event`: a :class:`SysColourChangedEvent` event to be processed.


   .. method:: PaintCrescentGradientBox(self, dc, rect, startColour, endColour, concave=True)

      Paint a region with gradient colouring. The gradient is in crescent shape
      which fits the 2007 style.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the rectangle to be filled with gradient shading;
      :param wx.Colour `startColour`: the first colour of the gradient shading;
      :param wx.Colour `endColour`: the second colour of the gradient shading;
      :param bool `concave`: ``True`` for a concave effect, ``False`` for a convex one.


   .. method:: PaintDiagonalGradientBox(self, dc, rect, startColour, endColour, startAtUpperLeft=True, trimToSquare=True)

      Paint rectangle with gradient colouring; the gradient lines are diagonal
      and may start from the upper left corner or from the upper right corner.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the rectangle to be filled with gradient shading;
      :param wx.Colour `startColour`: the first colour of the gradient shading;
      :param wx.Colour `endColour`: the second colour of the gradient shading;
      :param bool `startAtUpperLeft`: ``True`` to start the gradient lines at the upper
       left corner of the rectangle, ``False`` to start at the upper right corner;
      :param bool `trimToSquare`: ``True`` to trim the gradient lines in a square.


   .. method:: PaintGradientRegion(self, dc, region, startColour, endColour, vertical=True)

      Paint a region with gradient colouring.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param `region`: a region to be filled with gradient shading (an instance of
       :class:`Region`);
      :param wx.Colour `startColour`: the first colour of the gradient shading;
      :param wx.Colour `endColour`: the second colour of the gradient shading;
      :param bool `vertical`: ``True`` for gradient colouring in the vertical direction,
       ``False`` for horizontal shading.


   .. method:: PaintStraightGradientBox(self, dc, rect, startColour, endColour, vertical=True)

      Paint the rectangle with gradient colouring; the gradient lines are either
      horizontal or vertical.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param wx.Rect `rect`: the rectangle to be filled with gradient shading;
      :param wx.Colour `startColour`: the first colour of the gradient shading;
      :param wx.Colour `endColour`: the second colour of the gradient shading;
      :param bool `vertical`: ``True`` for gradient colouring in the vertical direction,
       ``False`` for horizontal shading.


   .. method:: RandomColour(self)

      Creates a random colour.
      
      :return: An instance of :class:`wx.Colour`.


   .. method:: SetMBVerticalGradient(self, v)

      Sets the menu bar gradient style.
      
      :param bool `v`: ``True`` for a vertical shaded gradient, ``False`` otherwise.


   .. method:: SetMenuBarColour(self, scheme)

      Sets the menu bar colour scheme to use.
      
      :param string `scheme`: a string representing a colour scheme (i.e., 'Default',
       'Dark', 'Dark Olive Green', 'Generic').


   .. method:: SetMenuTheme(self, theme)

      Set the menu theme, possible values (Style2007, StyleXP, StyleVista).
      
      :param string `theme`: a rendering theme class, either `StyleXP`, `Style2007` or `StyleVista`.


   .. method:: SetMS2007ButtonSunken(self, sunken)

      Sets MS 2007 button style sunken or not.
      
      :param bool `sunken`: ``True`` to have a sunken border effect, ``False`` otherwise.


   .. method:: SetRaiseToolbar(self, rais)

      Enables/disables toobar shadow drop.
      
      :param bool `rais`: ``True`` to drop a shadow below a toolbar, ``False`` otherwise.


   .. method:: SetTransparency(self, amount)

      Sets the alpha channel value for transparent windows.
      
      :param integer `amount`: the actual transparency value (between 0 and 255).
      
      :raise: `Exception` if the `amount` parameter is lower than ``0`` or greater than ``255``.


   .. method:: TakeScreenShot(self, rect, bmp)

      Takes a screenshot of the screen at given position & size (rect).
      
      :param wx.Rect `rect`: the screen rectangle we wish to capture;
      :param wx.Bitmap `bmp`: currently unused.


   .. method:: TruncateText(self, dc, text, maxWidth)

      Truncates a given string to fit given width size. if the text does not fit
      into the given width it is truncated to fit. The format of the fixed text
      is ``truncate text ...``.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param string `text`: the text to be (eventually) truncated;
      :param integer `maxWidth`: the maximum width allowed for the text.
      
      :return: A new string containining the (possibly) truncated text.


