AGW Logo

agw_title CubeColourDialog

This is the CubeColourDialog main class implementation.

hierarchy Inheritance Diagram

Inheritance diagram for: CubeColourDialog

Inheritance diagram of CubeColourDialog


appearance Control Appearance


CubeColourDialog

CubeColourDialog


method_summary Methods Summary

__init__Default class constructor.
AssignColourValueCommon code to handle spin control changes.
CalcCuboidCalculates the RGB colour cube vertices.
CalcRectsCalculates the brightness control user-selected rect.
CalcSlopesCalculates the line slopes in the RGB colour cube.
DoLayoutLayouts all the controls in the CubeColourDialog.
DrawAllDraws all the custom controls after a colour change.
DrawAlphaRefreshes the alpha channel control.
DrawBrightRefreshes the brightness control.
DrawHSBRefreshes the HSB colour wheel.
DrawMarkersDraws the markers for all the controls.
DrawRGBRefreshes the RGB colour cube.
GetAGWWindowStyleFlagReturns the CubeColourDialog window style flags.
GetColourDataReturns a wxPython compatible wx.ColourData.
GetHSVAColourReturns a 4-elements tuple of hue, saturation, brightness, alpha components.
GetRGBAColourReturns a 4-elements tuple of red, green, blue, alpha components.
InitDialogInitialize the CubeColourDialog.
OnAddCustomHandles the Add Custom wx.EVT_BUTTON event for CubeColourDialog.
OnAlphaSpinHandles the wx.EVT_SPINCTRL event for the alpha channel.
OnCancelHandles the Cancel wx.EVT_BUTTON event for CubeColourDialog.
OnCloseWindowHandles the wx.EVT_CLOSE event for CubeColourDialog.
OnKeyUpHandles the wx.EVT_CHAR_HOOK event for CubeColourDialog.
OnOkHandles the Ok wx.EVT_BUTTON event for CubeColourDialog.
OnShowAlphaShows/hides the alpha channel control in CubeColourDialog.
OnSpinCtrlHandles the wx.EVT_SPINCTRL event for RGB and HSB colours.
SetAGWWindowStyleFlagSets the CubeColourDialog window style flags.
SetCodesSets the HTML/MS Access codes (if any) in the text controls.
SetPanelColoursAssigns colours to the colour panels.
SetPropertiesSets some initial properties for CubeColourDialog (sizes, values).
SetSpinValsSets the values for all the spin controls.
ShowModalShows CubeColourDialog as a modal dialog. Program flow does

API Class API

class CubeColourDialog(wx.Dialog)[source]

This is the CubeColourDialog main class implementation.



__init__(parent, colourData=None, agwStyle=CCD_SHOW_ALPHA)[source]

Default class constructor.

Parameters:
  • 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(attribute, colourVal, maxVal, position)[source]

Common code to handle spin control changes.



CalcCuboid()[source]

Calculates the RGB colour cube vertices.



CalcRects()[source]

Calculates the brightness control user-selected rect.



CalcSlopes()[source]

Calculates the line slopes in the RGB colour cube.



DoLayout()[source]

Layouts all the controls in the CubeColourDialog.



DrawAll()[source]

Draws all the custom controls after a colour change.



DrawAlpha()[source]

Refreshes the alpha channel control.



DrawBright()[source]

Refreshes the brightness control.



DrawHSB()[source]

Refreshes the HSB colour wheel.



DrawMarkers(dc=None)[source]

Draws the markers for all the controls.

Parameters:dc – an instance of wx.DC. If dc is None, a wx.ClientDC is created on the fly.


DrawRGB()[source]

Refreshes the RGB colour cube.



GetAGWWindowStyleFlag()[source]

Returns the CubeColourDialog window style flags.

See also

SetAGWWindowStyleFlag for a list of possible flags.



GetColourData()[source]

Returns a wxPython compatible wx.ColourData.



GetHSVAColour()[source]

Returns a 4-elements tuple of hue, saturation, brightness, alpha components.



GetRGBAColour()[source]

Returns a 4-elements tuple of red, green, blue, alpha components.



InitDialog()[source]

Initialize the CubeColourDialog.



OnAddCustom(event)[source]

Handles the Add Custom wx.EVT_BUTTON event for CubeColourDialog.

Parameters:event – a wx.CommandEvent event to be processed.


OnAlphaSpin(event)[source]

Handles the wx.EVT_SPINCTRL event for the alpha channel.

Parameters:event – a wx.SpinEvent event to be processed.


OnCancel(event)[source]

Handles the Cancel wx.EVT_BUTTON event for CubeColourDialog.

Parameters:event – a wx.CommandEvent event to be processed.



OnCloseWindow(event)[source]

Handles the wx.EVT_CLOSE event for CubeColourDialog.

Parameters:event – a wx.CloseEvent event to be processed.


OnKeyUp(event)[source]

Handles the wx.EVT_CHAR_HOOK event for CubeColourDialog.

Parameters:event – a wx.KeyEvent event to be processed.


OnOk(event)[source]

Handles the Ok wx.EVT_BUTTON event for CubeColourDialog.

Parameters:event – a wx.CommandEvent event to be processed.



OnShowAlpha(event)[source]

Shows/hides the alpha channel control in CubeColourDialog.

Parameters:event – a wx.CommandEvent event to be processed.



OnSpinCtrl(event)[source]

Handles the wx.EVT_SPINCTRL event for RGB and HSB colours.

Parameters:event – a wx.SpinEvent event to be processed.



SetAGWWindowStyleFlag(agwStyle)[source]

Sets the CubeColourDialog window style flags.

Parameters:agwStyle – can only be CCD_SHOW_ALPHA or None.


SetCodes()[source]

Sets the HTML/MS Access codes (if any) in the text controls.



SetPanelColours()[source]

Assigns colours to the colour panels.



SetProperties()[source]

Sets some initial properties for CubeColourDialog (sizes, values).



SetSpinVals()[source]

Sets the values for all the spin controls.



ShowModal()[source]

Shows CubeColourDialog as a modal dialog. Program flow does not return until the dialog has been dismissed with EndModal.

Note

Overridden from wx.Dialog.

Tree

Table Of Contents

Previous topic

ColourPanel

Next topic

CustomPanel