This class provides various art utilities, such as creating shadow, providing lighter / darker colours for a given colour, etc...
__init__ | Default class constructor. |
AddMenuTheme | Adds a new theme to the stock. |
BackgroundColour | Returns the background colour of a control when not in focus. |
CalcButtonBestSize | Returns the best fit size for the supplied label & bitmap. |
CanMakeWindowsTransparent | Used internally. |
ConvertToBitmap | Convert the given image to a bitmap, optionally overlaying an alpha channel to it. |
CreateGreyBitmap | Creates a grey bitmap image from the input bitmap. |
DarkColour | Like the LightColour function, but create the colour darker by percent. |
DrawBitmapShadow | Draws a shadow using background bitmap. |
DrawButton | Colour rectangle according to the theme. |
DrawButtonColour | Draws a button using the appropriate theme. |
DrawButtonTheme | Draws a button using the appropriate theme. |
DrawDragSash | Draws resize sash. |
DrawMenuBarBg | Draws the menu bar background according to the active theme. |
DrawMenuBarBorder | Enables menu border drawing (XP style only). |
DrawTextAndBitmap | Draws the text & bitmap on the input dc. |
DrawToolBarBg | Draws the toolbar background according to the active theme. |
DropShadow | Adds a shadow under the window (Windows only). |
FillStockBitmaps | Initializes few standard bitmaps. |
FrameColour | Return the surrounding colour for a control. |
Free | Destructor for the unique art manager object. |
Get | Accessor to the unique art manager object. |
GetAccelIndex | Returns the mnemonic index of the label and the label stripped of the ampersand mnemonic (e.g. |
GetAlignBuffer | Return the padding buffer for a text or bitmap. |
GetBitmapStartLocation | Returns the top left x and y cordinates of the bitmap drawing. |
GetColourSchemes | Returns the available colour schemes. |
GetFont | Returns the font used by this theme. |
GetMBVerticalGradient | Returns True if the menu bar should be painted with vertical gradient. |
GetMS2007ButtonSunken | Returns the sunken flag for MS 2007 buttons. |
GetMenuBarBorder | Returns menu bar border drawing flag. |
GetMenuBarColourScheme | Returns the current colour scheme. |
GetMenuBarFaceColour | Returns the menu bar face colour. |
GetMenuBarSelectionColour | Returns the menu bar selection colour. |
GetMenuBgFactor | Gets the visibility depth of the menu in Metallic style. |
GetMenuFaceColour | Returns the colour used for the menu foreground. |
GetMenuTheme | Returns the currently used menu theme. |
GetRaiseToolbar | Returns True if we are dropping a shadow under a toolbar. |
GetStockBitmap | Returns a bitmap from a stock. |
GetTextColourDisable | Returns the colour used for disabled menu items. |
GetTextColourEnable | Returns the colour used for enabled menu items. |
GetTextStartLocation | Returns the top left x and y cordinates of the text drawing. |
GetThemeBaseColour | Returns the theme (Blue, Silver, Green etc.) base colour, if no theme is active |
GetTransparency | Returns the alpha channel value for transparent windows. |
HighlightBackgroundColour | Returns the background colour of a control when it is in focus. |
InitColours | Initialise the colour map. |
Initialize | Initializes the bitmaps and colours. |
IsDark | Returns whether a colour is dark or light. |
LightColour | Return light contrast of colour. |
MakeWindowTransparent | Used internally. |
MixColours | Return mix of input colours. |
OnSysColourChange | Handles the wx.EVT_SYS_COLOUR_CHANGED event for ArtManager. |
PaintCrescentGradientBox | Paint a region with gradient colouring. |
PaintDiagonalGradientBox | Paint rectangle with gradient colouring; the gradient lines are diagonal and may start from the upper left corner or from the upper right corner. |
PaintGradientRegion | Paint a region with gradient colouring. |
PaintStraightGradientBox | Paint the rectangle with gradient colouring; the gradient lines are either horizontal or vertical. |
RandomColour | Creates a random colour. |
SetMBVerticalGradient | Sets the menu bar gradient style. |
SetMS2007ButtonSunken | Sets MS 2007 button style sunken or not. |
SetMenuBarColour | Sets the menu bar colour scheme to use. |
SetMenuTheme | Set the menu theme, possible values (Style2007, StyleXP, StyleVista). |
SetRaiseToolbar | Enables/disables toobar shadow drop. |
SetTransparency | Sets the alpha channel value for transparent windows. |
TakeScreenShot | Takes a screenshot of the screen at given position & size (rect). |
TruncateText | Truncates a given string to fit given width size. |
This class provides various art utilities, such as creating shadow, providing lighter / darker colours for a given colour, etc...
Adds a new theme to the stock.
Parameters: | render – a rendering theme class, which must be derived from RendererBase. |
---|---|
Returns: | An integer representing the size of the renderers dictionary. |
Returns the background colour of a control when not in focus.
Returns: | An instance of wx.Colour. |
---|
Returns the best fit size for the supplied label & bitmap.
Parameters: |
|
---|---|
Returns: | An instance of wx.Size, representing the best fit size for the supplied label & bitmap. |
Used internally.
Returns: | True if the system supports transparency of toplevel windows, otherwise returns False. |
---|
Convert the given image to a bitmap, optionally overlaying an alpha channel to it.
Parameters: |
|
---|---|
Returns: | An instance of wx.Bitmap. |
Creates a grey bitmap image from the input bitmap.
Parameters: | bmp – a valid wx.Bitmap object to be greyed out. |
---|---|
Returns: | A greyed-out representation of the input bitmap, an instance of wx.Bitmap. |
Like the LightColour function, but create the colour darker by percent.
Parameters: |
|
---|---|
Returns: | A dark contrast of the input colour, an instance of wx.Colour. |
Draws a shadow using background bitmap.
Parameters: |
|
---|
Colour rectangle according to the theme.
Parameters: |
|
---|
Draws a button using the appropriate theme.
Parameters: |
---|
Draws a button using the appropriate theme.
Parameters: |
|
---|
Draws resize sash.
Parameters: | rect (wx.Rect) – the sash client rectangle. |
---|
Draws the menu bar background according to the active theme.
Parameters: |
|
---|
Enables menu border drawing (XP style only).
Parameters: | border (bool) – True to draw the menubar border, False otherwise. |
---|
Draws the text & bitmap on the input dc.
Parameters: |
|
---|
See also
GetBitmapStartLocation for a list of valid button styles.
Draws the toolbar background according to the active theme.
Parameters: |
|
---|
Adds a shadow under the window (Windows only).
Parameters: |
|
---|
Return the surrounding colour for a control.
Returns: | An instance of wx.Colour. |
---|
Accessor to the unique art manager object.
Returns: | A unique instance of ArtManager. |
---|
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).
Parameters: | label (string) – a string containining an ampersand. |
---|---|
Returns: | A tuple containining the mnemonic index of the label and the label stripped of the ampersand mnemonic. |
Return the padding buffer for a text or bitmap.
Returns: | An integer representing the padding buffer. |
---|
Returns the top left x and y cordinates of the bitmap drawing.
Parameters: |
|
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: | A tuple containining the top left x and y cordinates of the bitmap drawing. |
Returns the available colour schemes.
Returns: | A list of strings representing the available colour schemes. |
---|
Returns True if the menu bar should be painted with vertical gradient.
Returns the sunken flag for MS 2007 buttons.
Returns: | True if the MS 2007 buttons are sunken, False otherwise. |
---|
Returns menu bar border drawing flag.
Returns: | True if the menu bar border is to be drawn, False otherwise. |
---|
Returns the current colour scheme.
Returns: | A string representing the current colour scheme. |
---|
Returns the menu bar selection colour.
Returns: | An instance of wx.Colour. |
---|
Gets the visibility depth of the menu in Metallic style. The higher the value, the menu bar will look more raised
Returns the colour used for the menu foreground.
Returns: | An instance of wx.Colour. |
---|
Returns the currently used menu theme.
Returns: | A string containining the currently used theme for the menu. |
---|
Returns a bitmap from a stock.
Parameters: | name (string) – the bitmap name. |
---|---|
Returns: | The stock bitmap, if name was found in the stock bitmap dictionary. Othewise, wx.NullBitmap is returned. |
Returns the colour used for disabled menu items.
Returns: | An instance of wx.Colour. |
---|
Returns the colour used for enabled menu items.
Returns: | An instance of wx.Colour. |
---|
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).
Parameters: |
|
---|---|
Returns: | A tuple containining the top left x and y cordinates of the text drawing, plus the truncated version of the input text. |
See also
GetBitmapStartLocation for a list of valid button styles.
Returns the theme (Blue, Silver, Green etc.) base colour, if no theme is active it return the active caption colour, lighter in 30%.
Parameters: | useLightColours (bool) – True to use light colours, False otherwise. |
---|---|
Returns: | An instance of wx.Colour. |
Returns the alpha channel value for transparent windows.
Returns: | An integer representing the alpha channel value. |
---|
Returns the background colour of a control when it is in focus.
Returns: | An instance of wx.Colour. |
---|
Returns whether a colour is dark or light.
Parameters: | colour – an instance of wx.Colour. |
---|---|
Returns: | True if the average RGB values are dark, False otherwise. |
Return light contrast of colour. The colour returned is from the scale of colour ==> white.
Parameters: |
|
---|---|
Returns: | A light contrast of the input colour, an instance of wx.Colour. |
Used internally. Makes a toplevel window transparent if the system supports it.
Parameters: |
|
---|
Return mix of input colours.
Parameters: | |
---|---|
Returns: | An instance of wx.Colour. |
Handles the wx.EVT_SYS_COLOUR_CHANGED event for ArtManager.
Parameters: | event – a wx.SysColourChangedEvent event to be processed. |
---|
Paint a region with gradient colouring. The gradient is in crescent shape which fits the 2007 style.
Parameters: |
|
---|
Paint rectangle with gradient colouring; the gradient lines are diagonal and may start from the upper left corner or from the upper right corner.
Parameters: |
|
---|
Paint a region with gradient colouring.
Parameters: |
|
---|
Paint the rectangle with gradient colouring; the gradient lines are either horizontal or vertical.
Parameters: |
|
---|
Sets the menu bar gradient style.
Parameters: | v (bool) – True for a vertical shaded gradient, False otherwise. |
---|
Sets MS 2007 button style sunken or not.
Parameters: | sunken (bool) – True to have a sunken border effect, False otherwise. |
---|
Sets the menu bar colour scheme to use.
Parameters: | scheme (string) – a string representing a colour scheme (i.e., ‘Default’, ‘Dark’, ‘Dark Olive Green’, ‘Generic’). |
---|
Set the menu theme, possible values (Style2007, StyleXP, StyleVista).
Parameters: | theme (string) – a rendering theme class, either StyleXP, Style2007 or StyleVista. |
---|
Enables/disables toobar shadow drop.
Parameters: | rais (bool) – True to drop a shadow below a toolbar, False otherwise. |
---|
Sets the alpha channel value for transparent windows.
Parameters: | amount (integer) – the actual transparency value (between 0 and 255). |
---|---|
Raise : | Exception if the amount parameter is lower than 0 or greater than 255. |
Takes a screenshot of the screen at given position & size (rect).
Parameters: |
|
---|
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 ...>.
Parameters: |
|
---|---|
Returns: | A new string containining the (possibly) truncated text. |