AGW Logo

aui.aui_utilities functions

This is the description of standalone Python functions in the aui.aui_utilities module.

method_summary Functions Summary


BitmapFromBits BitmapFromBits() is a utility function that creates a
BlendColour Blends the two colour component fg and bg into one colour component, adding an optional alpha channel.
ChopText Chops the input text if its size does not fit in max_size, by cutting the text and adding ellipsis at the end.
Clip Clips the value in a based on the extremes b and c.
CopyAttributes Copies pens, brushes, colours and fonts from the old tab art to the new one.
DarkenBitmap Darkens the input bitmap on wxMAC using the input colour.
DrawGradientRectangle Draws a gradient-shaded rectangle.
DrawMACCloseButton Draws the wxMAC tab close button using wx.GraphicsContext.
FindFocusDescendant Find a window with the focus, that is also a descendant of the given window.
GetBaseColour Returns the face shading colour on push buttons/backgrounds, mimicking as closely
GetDockingImage Returns the correct name of the docking bitmap depending on the input parameters.
GetLabelSize Returns the AuiToolBar item label size.
GetSlidingPoints Returns the point at which the sliding in and out of a minimized pane begins.
IndentPressedBitmap Indents the input rectangle rect based on the value of button_state.
LightColour Brighten input colour by percent.
LightContrastColour Creates a new, lighter colour based on the input colour c.
MakeDisabledBitmap Convert the given image (in place) to a grayed-out version, appropriate for a ‘disabled’ appearance.
MakeGray Make a pixel grayed-out.
PaneCreateStippleBitmap Creates a stipple bitmap to be used in a wx.Brush.
RescaleScreenShot Rescales a bitmap to be 300 pixels wide (or tall) at maximum.
StepColour Darken/lighten the input colour c.
TakeScreenShot Takes a screenshot of the screen at given position and size (rect).

API Functions API



BitmapFromBits(bits, w, h, colour)[source]

BitmapFromBits() is a utility function that creates a masked bitmap from raw bits (XBM format).

Parameters:
  • bits – a string containing the raw bits of the bitmap;
  • w – the bitmap width;
  • h – the bitmap height;
  • colour – the colour which will replace all white pixels in the raw bitmap.


BlendColour(fg, bg, alpha)[source]

Blends the two colour component fg and bg into one colour component, adding an optional alpha channel.

Parameters:
  • fg – the first colour component;
  • bg – the second colour component;
  • alpha – an optional transparency value.


ChopText(dc, text, max_size)[source]

Chops the input text if its size does not fit in max_size, by cutting the text and adding ellipsis at the end.

Parameters:
  • dc – a wx.DC device context;
  • text – the text to chop;
  • max_size – the maximum size in which the text should fit.


Clip(a, b, c)[source]

Clips the value in a based on the extremes b and c.

Parameters:
  • a – the value to analyze;
  • b – a minimum value;
  • c – a maximum value.


CopyAttributes(newArt, oldArt)[source]

Copies pens, brushes, colours and fonts from the old tab art to the new one.

Parameters:


DarkenBitmap(bmp, caption_colour, new_colour)[source]

Darkens the input bitmap on wxMAC using the input colour.

Parameters:
  • bmp – the bitmap to be manipulated;
  • caption_colour – the colour of the pane caption;
  • new_colour – the colour used to darken the bitmap.


DrawGradientRectangle(dc, rect, start_colour, end_colour, direction, offset=0, length=0)[source]

Draws a gradient-shaded rectangle.

Parameters:
  • dc – a wx.DC device context;

  • rect – the rectangle in which to draw the gradient;
  • start_colour – the first colour of the gradient;
  • end_colour – the second colour of the gradient;
  • direction – the gradient direction (horizontal or vertical).


DrawMACCloseButton(colour, backColour=None)[source]

Draws the wxMAC tab close button using wx.GraphicsContext.

Parameters:
  • colour – the colour to use to draw the circle;
  • backColour – the optional background colour for the circle.


FindFocusDescendant(ancestor)[source]

Find a window with the focus, that is also a descendant of the given window. This is used to determine the window to initially send commands to.

Parameters:ancestor – the window to check for ancestry.


GetBaseColour()[source]

Returns the face shading colour on push buttons/backgrounds, mimicking as closely as possible the platform UI colours.



GetDockingImage(direction, useAero, center)[source]

Returns the correct name of the docking bitmap depending on the input parameters.

Parameters:
  • useAero – whether AuiManager is using Aero-style or Whidbey-style docking images or not;
  • center – whether we are looking for the center diamond-shaped bitmap or not.


GetLabelSize(dc, label, vertical)[source]

Returns the AuiToolBar item label size.

Parameters:
  • label – the toolbar tool label;
  • vertical – whether the toolbar tool orientation is vertical or not.


GetSlidingPoints(rect, size, direction)[source]

Returns the point at which the sliding in and out of a minimized pane begins.

Parameters:
  • rect – the AuiToolBar tool screen rectangle;
  • size – the pane window size;
  • direction – the pane docking direction.


IndentPressedBitmap(rect, button_state)[source]

Indents the input rectangle rect based on the value of button_state.

Parameters:


LightColour(colour, percent)[source]

Brighten input colour by percent.

Parameters:
  • colour – the colour to be brightened;
  • percent – brightening percentage.


LightContrastColour(c)[source]

Creates a new, lighter colour based on the input colour c.

Parameters:c – the input colour to analyze.


MakeDisabledBitmap(bitmap)[source]

Convert the given image (in place) to a grayed-out version, appropriate for a ‘disabled’ appearance.

Parameters:bitmap – the bitmap to gray-out.


MakeGray(rgbTuple, factor, maskColour)[source]

Make a pixel grayed-out. If the pixel matches the maskColour, it won’t be changed.

Parameters:
  • rgbTuple – a tuple representing a pixel colour;
  • factor – a graying-out factor;
  • maskColour – a colour mask.


PaneCreateStippleBitmap()[source]

Creates a stipple bitmap to be used in a wx.Brush. This is used to draw sash resize hints.



RescaleScreenShot(bmp, thumbnail_size=200)[source]

Rescales a bitmap to be 300 pixels wide (or tall) at maximum.

Parameters:
  • bmp – the bitmap to rescale;
  • thumbnail_size – the maximum size of every page thumbnail.


StepColour(c, ialpha)[source]

Darken/lighten the input colour c.

Parameters:
  • c – a colour to darken/lighten;
  • ialpha – a transparency value.


TakeScreenShot(rect)[source]

Takes a screenshot of the screen at given position and size (rect).

Parameters:rect – the screen rectangle for which we want to take a screenshot.
Tree

Table Of Contents

Previous topic

TabDragImage

Next topic

SVN Revision 69086 For aui_utilities