This class can be used to simulate a knob volume control often found in PC music players.
__init__ |
Default class constructor. |
CircleCoords |
Converts the input values into logical x and y coordinates. |
Draw |
Draws everything on the empty bitmap. |
DrawBoundingCircle |
Draws the KnobCtrl bounding circle. |
DrawDiagonalGradient |
Draw a shading of diagonal gradient to KnobCtrl . |
DrawInsetCircle |
Draws the small knob. |
DrawTags |
Draws the tags. |
GetAngleFromCoord |
Returns the angular position based on the input logical coordinates. |
GetAngularRange |
Returns the angular range for KnobCtrl as a tuple. The start and end |
GetBoundingColour |
Returns the bounding circle colour. |
GetFirstGradientColour |
Returns the first gradient colour for shading. |
GetKnobRadius |
Returns the knob radius, in pixels. |
GetMaxValue |
Returns the maximum value for KnobCtrl . |
GetMinValue |
Returns the minimum value for KnobCtrl . |
GetSecondGradientColour |
Returns the second gradient colour for shading. |
GetTags |
Returns the KnobCtrl tags. |
GetTagsColour |
Returns the tags colour. |
GetTrackPosition |
Used internally. |
GetValue |
Returns the value of KnobCtrl . |
OffsetColour |
Changes the input colour by the offset value. Used internally. |
OnMouseEvents |
Handles the wx.EVT_MOUSE_EVENTS event for KnobCtrl . |
SetAngularRange |
Sets the angular range for KnobCtrl . |
SetBoundingColour |
Sets the bounding circle colour. |
SetFirstGradientColour |
Sets the first gradient colour for shading. |
SetKnobRadius |
Sets the knob radius. |
SetSecondGradientColour |
Sets the second gradient colour for shading. |
SetTags |
Sets the tags for KnobCtrl . |
SetTagsColour |
Sets the tags colour. |
SetTrackPosition |
Used internally. |
SetValue |
Sets programmatically the value of KnobCtrl . |
KnobCtrl
(BufferedWindow)¶This class can be used to simulate a knob volume control often found in PC music players.
__init__
(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, agwStyle=KC_BUFFERED_DC)¶Default class constructor.
Parameters: |
|
---|
CircleCoords
(self, radius, angle, centerX, centerY)¶Converts the input values into logical x and y coordinates.
Parameters: |
---|
Draw
(self, dc)¶Draws everything on the empty bitmap. Here all the chosen styles are applied.
Parameters: | dc – an instance of wx.DC . |
---|
DrawBoundingCircle
(self, dc, size)¶Draws the KnobCtrl
bounding circle.
Parameters: |
|
---|
DrawDiagonalGradient
(self, dc, size)¶Draw a shading of diagonal gradient to KnobCtrl
.
Parameters: |
|
---|
DrawInsetCircle
(self, dc, pencolour)¶Draws the small knob.
Parameters: |
|
---|
DrawTags
(self, dc, size)¶Draws the tags.
Parameters: |
|
---|
GetAngleFromCoord
(self, cx, cy)¶Returns the angular position based on the input logical coordinates. Used internally.
Parameters: |
|
---|
GetAngularRange
(self)¶Returns the angular range for KnobCtrl
as a tuple. The start and end
angles in the returned tuple are given in degrees, clockwise.
GetBoundingColour
(self)¶Returns the bounding circle colour.
GetFirstGradientColour
(self)¶Returns the first gradient colour for shading.
GetKnobRadius
(self)¶Returns the knob radius, in pixels.
GetSecondGradientColour
(self)¶Returns the second gradient colour for shading.
GetTagsColour
(self)¶Returns the tags colour.
GetTrackPosition
(self)¶Used internally.
OffsetColour
(self, colour, offset)¶Changes the input colour by the offset value. Used internally.
Parameters: |
|
---|
OnMouseEvents
(self, event)¶Handles the wx.EVT_MOUSE_EVENTS
event for KnobCtrl
.
Parameters: | event – a MouseEvent event to be processed. |
---|
SetAngularRange
(self, start, end)¶Sets the angular range for KnobCtrl
.
Parameters: |
|
---|
SetBoundingColour
(self, colour)¶Sets the bounding circle colour.
Parameters: | colour – a valid wx.Colour object. |
---|
SetFirstGradientColour
(self, colour)¶Sets the first gradient colour for shading.
Parameters: | colour – a valid wx.Colour object. |
---|
SetKnobRadius
(self, radius)¶Sets the knob radius.
Parameters: | radius – the knob radius, in pixels. |
---|
SetSecondGradientColour
(self, colour)¶Sets the second gradient colour for shading.
Parameters: | colour – a valid wx.Colour object. |
---|
SetTags
(self, tags)¶Sets the tags for KnobCtrl
.
Parameters: | tags – a list of integers ranging from minvalue to maxvalue. |
---|
SetTrackPosition
(self)¶Used internally.
SetValue
(self, val)¶Sets programmatically the value of KnobCtrl
.
Parameters: | val – an integer specifying the new KnobCtrl value. |
---|
Note
This method does not send a KnobCtrlEvent
.