BPArt
is an art provider class which does all of the drawing for ButtonPanel
.
This allows the library caller to customize the BPArt
or to completely replace
all drawing with custom BPArts.
Default class constructor. |
|
Draws a button in |
|
Paint the |
|
Draws the main caption text in |
|
Draws the label for a button. |
|
Draws a separator in |
|
Gradient fill from colour 1 to colour 2 with top to bottom or left to right. |
|
Returns the option value for the specified colour |
|
Returns the option value for the specified font |
|
Returns the gradient type for |
|
Returns the option value for the specified size |
|
Sets the option value for the specified colour |
|
Sets the option value for the specified font |
|
Sets the gradient type for |
|
Sets the option value for the specified size |
BPArt
(object)¶BPArt
is an art provider class which does all of the drawing for ButtonPanel
.
This allows the library caller to customize the BPArt
or to completely replace
all drawing with custom BPArts.
__init__
(self, parentStyle)¶Default class constructor.
parentStyle (integer) – the window style for ButtonPanel
.
DrawButton
(self, dc, rect, buttonBitmap, isVertical, buttonStatus, isToggled, textAlignment, text="")¶Draws a button in ButtonPanel
, together with its text (if any).
dc – an instance of wx.DC
;
rect (wx.Rect) – the button client rectangle;
buttonBitmap (wx.Bitmap) – the bitmap associated with the button;
isVertical (bool) – True
if ButtonPanel
is in vertical orientation,
False
otherwise;
buttonStatus (string) – one of “Normal”, “Toggled”, “Pressed”, “Disabled” or “Hover”;
isToggled (bool) – whether the button is toggled or not;
textAlignment (integer) – the text alignment inside the button;
text (string) – the button label.
DrawButtonPanel
(self, dc, rect, style)¶Paint the ButtonPanel
’s background.
dc – an instance of wx.DC
;
rect (wx.Rect) – the ButtonPanel
client rectangle;
style (integer) – the ButtonPanel
window style.
DrawCaption
(self, dc, rect, captionText)¶Draws the main caption text in ButtonPanel
.
DrawLabel
(self, dc, text, isEnabled, xpos, ypos)¶Draws the label for a button.
dc – an instance of wx.DC
;
text (string) – the button label;
isEnabled (bool) – True
if the button is enabled, False
otherwise;
xpos (integer) – the text x position inside the button;
ypos (integer) – the text y position inside the button.
DrawSeparator
(self, dc, rect, isVertical)¶Draws a separator in ButtonPanel
.
dc – an instance of wx.DC
;
rect (wx.Rect) – the separator client rectangle;
isVertical (bool) – True
if ButtonPanel
is in vertical orientation,
False
otherwise.
FillGradientColour
(self, dc, rect)¶Gradient fill from colour 1 to colour 2 with top to bottom or left to right.
dc – an instance of wx.DC
;
rect (wx.Rect) – the ButtonPanel
client rectangle.
GetColour
(self, id)¶Returns the option value for the specified colour id
.
id (integer) –
the identification bit for the colour value. This can be one of the following bits:
Colour Id |
Value |
Description |
---|---|---|
|
0 |
Background brush colour when no gradient shading exists |
|
1 |
Starting gradient colour, used only when |
|
2 |
Ending gradient colour, used only when |
|
3 |
Pen colour to paint the border of |
|
4 |
Main |
|
5 |
Text colour for buttons with text |
|
6 |
Text colour for inactive buttons with text |
|
7 |
Brush colour to be used when hovering or selecting a button |
|
8 |
Pen colour to be used when hovering or selecting a button |
|
9 |
Pen colour used to paint the separators |
An instance of wx.Colour
for the input id
.
Exception if the id
is not recognized.
GetFont
(self, id)¶Returns the option value for the specified font id
.
id (integer) –
the identification bit for the font value. This can be one of the following bits:
Size Id |
Value |
Description |
---|---|---|
|
10 |
Font of the |
|
11 |
Text font for the buttons with text |
An instance of wx.Font
for the input id
.
Exception if the id
is not recognized.
GetGradientType
(self)¶Returns the gradient type for BPArt
drawings.
An integer representing the gradient type.
See also
SetGradientType
for a list of possible gradient types.
GetMetric
(self, id)¶Returns the option value for the specified size id
.
id (integer) –
the identification bit for the size value. This can be one of the following bits:
Size Id |
Value |
Description |
---|---|---|
|
14 |
Separator size. Note: This is not the line width, but the sum of the space before and after the separator line plus the width of the line |
|
15 |
Size of the left/right margins in |
|
16 |
Size of the border |
|
17 |
Inter-tool separator size |
An integer representing the option value for the input id
.
Exception if the id
is not recognized.
SetColour
(self, id, colour)¶Sets the option value for the specified colour id
.
id (integer) – the identification bit for the colour value;
colour – the new value for the colour (a valid wx.Colour
instance).
Exception if the id
is not recognized.
See also
GetColour
for a list of meaningful colour ids.
SetFont
(self, id, font)¶Sets the option value for the specified font id
.
id (integer) – the identification bit for the font value;
colour – the new value for the font (a valid wx.Font
instance).
Exception if the id
is not recognized.
See also
GetFont
for a list of meaningful font ids.
SetGradientType
(self, gradient)¶Sets the gradient type for BPArt
drawings.
gradient (integer) – can be one of the following bits:
Gradient Type |
Value |
Description |
---|---|---|
|
0 |
No gradient shading should be used to paint the background |
|
1 |
Vertical gradient shading should be used to paint the background |
|
2 |
Horizontal gradient shading should be used to paint the background |