This is the CubeColourDialog main class implementation.
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 |
CubeColourDialog
(wx.Dialog)¶This is the CubeColourDialog main class implementation.
__init__
(self, parent, colourData=None, agwStyle=CCD_SHOW_ALPHA)¶Default class constructor.
colourData – a standard wx.ColourData
(as used in wx.ColourDialog
);
agwStyle – can be either None
or CCD_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.
dc – an instance of wx.DC
. If dc is None
, a ClientDC
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 for CubeColourDialog
.
event – a CommandEvent
event to be processed.
OnAlphaSpin
(self, event)¶Handles the wx.EVT_SPINCTRL
event for the alpha channel.
event – a SpinEvent
event to be processed.
OnCancel
(self, event)¶Handles the Cancel wx.EVT_BUTTON
event for CubeColourDialog
.
event – a CommandEvent
event to be processed.
OnCloseWindow
(self, event)¶Handles the wx.EVT_CLOSE
event for CubeColourDialog
.
event – a CloseEvent
event to be processed.
OnKeyUp
(self, event)¶Handles the wx.EVT_CHAR_HOOK
event for CubeColourDialog
.
event – a KeyEvent
event to be processed.
OnOk
(self, event)¶Handles the Ok wx.EVT_BUTTON
event for CubeColourDialog
.
event – a CommandEvent
event to be processed.
OnShowAlpha
(self, event)¶Shows/hides the alpha channel control in CubeColourDialog
.
event – a CommandEvent
event to be processed.
OnSpinCtrl
(self, event)¶Handles the wx.EVT_SPINCTRL
event for RGB and HSB colours.
event – a SpinEvent
event to be processed.
SetAGWWindowStyleFlag
(self, agwStyle)¶Sets the CubeColourDialog
window style flags.
agwStyle – can only be CCD_SHOW_ALPHA
or None
.
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 with EndModal
.
Note
Overridden from Dialog
.