wx.lib.agw.cubecolourdialog.CubeColourDialog¶
This is the CubeColourDialog main class implementation.
Class Hierarchy¶
Control Appearance¶
Known Superclasses¶
Methods Summary¶
Default class constructor. |
|
Common code to handle spin control changes. |
|
Calculates the RGB colour cube vertices. |
|
Calculates the brightness control user-selected rect. |
|
Calculates the line slopes in the RGB colour cube. |
|
Layouts all the controls in the |
|
Draws all the custom controls after a colour change. |
|
Refreshes the alpha channel control. |
|
Refreshes the brightness control. |
|
Refreshes the HSB colour wheel. |
|
Draws the markers for all the controls. |
|
Refreshes the RGB colour cube. |
|
Returns the |
|
Returns a wxPython compatible |
|
Returns a 4-elements tuple of hue, saturation, brightness, alpha components. |
|
Returns a 4-elements tuple of red, green, blue, alpha components. |
|
Initialize the |
|
Handles the Add Custom |
|
Handles the |
|
Handles the Cancel |
|
Handles the |
|
Handles the |
|
Handles the Ok |
|
Shows/hides the alpha channel control in |
|
Handles the |
|
Sets the |
|
Sets the HTML/MS Access codes (if any) in the text controls. |
|
Assigns colours to the colour panels. |
|
Sets some initial properties for |
|
Sets the values for all the spin controls. |
|
Shows |
Class API¶
- class CubeColourDialog(wx.Dialog)¶
This is the CubeColourDialog main class implementation.
Methods¶
- __init__(self, parent, colourData=None, agwStyle=CCD_SHOW_ALPHA)¶
Default class constructor.
- Parameters:
colourData – a standard
wx.ColourData
(as used inwx.ColourDialog
);agwStyle – can be either
None
orCCD_SHOW_ALPHA
, depending if you want to hide the alpha channel control or not.
- AssignColourValue(self, attribute, colourVal, maxVal, position)¶
Common code to handle spin control changes.
- CalcCuboid(self)¶
Calculates the RGB colour cube vertices.
- CalcRects(self)¶
Calculates the brightness control user-selected rect.
- CalcSlopes(self)¶
Calculates the line slopes in the RGB colour cube.
- DoLayout(self)¶
Layouts all the controls in the
CubeColourDialog
.
- DrawAll(self)¶
Draws all the custom controls after a colour change.
- DrawAlpha(self)¶
Refreshes the alpha channel control.
- DrawBright(self)¶
Refreshes the brightness control.
- DrawHSB(self)¶
Refreshes the HSB colour wheel.
- DrawMarkers(self, dc=None)¶
Draws the markers for all the controls.
- Parameters:
dc – an instance of
wx.DC
. If dc isNone
, aClientDC
is created on the fly.
- DrawRGB(self)¶
Refreshes the RGB colour cube.
- GetAGWWindowStyleFlag(self)¶
Returns the
CubeColourDialog
window style flags.See also
SetAGWWindowStyleFlag
for a list of possible flags.
- GetColourData(self)¶
Returns a wxPython compatible
wx.ColourData
.
- GetHSVAColour(self)¶
Returns a 4-elements tuple of hue, saturation, brightness, alpha components.
- GetRGBAColour(self)¶
Returns a 4-elements tuple of red, green, blue, alpha components.
- InitDialog(self)¶
Initialize the
CubeColourDialog
.
- OnAddCustom(self, event)¶
Handles the Add Custom
wx.EVT_BUTTON
event forCubeColourDialog
.- Parameters:
event – a
CommandEvent
event to be processed.
- OnAlphaSpin(self, event)¶
Handles the
wx.EVT_SPINCTRL
event for the alpha channel.- Parameters:
event – a
SpinEvent
event to be processed.
- OnCancel(self, event)¶
Handles the Cancel
wx.EVT_BUTTON
event forCubeColourDialog
.- Parameters:
event – a
CommandEvent
event to be processed.
- OnCloseWindow(self, event)¶
Handles the
wx.EVT_CLOSE
event forCubeColourDialog
.- Parameters:
event – a
CloseEvent
event to be processed.
- OnKeyUp(self, event)¶
Handles the
wx.EVT_CHAR_HOOK
event forCubeColourDialog
.- Parameters:
event – a
KeyEvent
event to be processed.
- OnOk(self, event)¶
Handles the Ok
wx.EVT_BUTTON
event forCubeColourDialog
.- Parameters:
event – a
CommandEvent
event to be processed.
- OnShowAlpha(self, event)¶
Shows/hides the alpha channel control in
CubeColourDialog
.- Parameters:
event – a
CommandEvent
event to be processed.
- OnSpinCtrl(self, event)¶
Handles the
wx.EVT_SPINCTRL
event for RGB and HSB colours.- Parameters:
event – a
SpinEvent
event to be processed.
- SetAGWWindowStyleFlag(self, agwStyle)¶
Sets the
CubeColourDialog
window style flags.- Parameters:
agwStyle – can only be
CCD_SHOW_ALPHA
orNone
.
- SetCodes(self)¶
Sets the HTML/MS Access codes (if any) in the text controls.
- SetPanelColours(self)¶
Assigns colours to the colour panels.
- SetProperties(self)¶
Sets some initial properties for
CubeColourDialog
(sizes, values).
- SetSpinVals(self)¶
Sets the values for all the spin controls.
- ShowModal(self)¶
Shows
CubeColourDialog
as a modal dialog. Program flow does not return until the dialog has been dismissed withEndModal
.Note
Overridden from
Dialog
.