Table Of Contents

Previous topic

CubeColourDialog

Next topic

HSVWheel

This Page

phoenix_title CustomPanel

This panel displays a series of custom colours (chosen by the user) just like the standard ColourDialog.


class_hierarchy Inheritance Diagram

Inheritance diagram for class CustomPanel

Inheritance diagram of CustomPanel


super_classes Known Superclasses

PyControl


method_summary Methods Summary

__init__ Default class constructor.
AddCustom Adds a user-chosen colour to the list of custom colours.
DoGetBestSize Overridden base class virtual. Determines the best size of the control.
InitializeColours Initializes the 16 custom colours in CustomPanel.
OnEraseBackground Handles the EVT_ERASE_BACKGROUND for CustomPanel.
OnLeftDown Handles the EVT_LEFT_DOWN for CustomPanel.
OnPaint Handles the EVT_PAINT for CustomPanel.
OnSize Handles the EVT_SIZE for CustomPanel.
PaintCustomColour Paints a newly added custom colour subpanel.
PaintCustomColours Draws all the 16 subpanels with their custom colours.
PaintHighlight Highlight the current custom colour selection (if any).

api Class API



class CustomPanel(PyControl)

This panel displays a series of custom colours (chosen by the user) just like the standard ColourDialog.


Methods



__init__(self, parent, colourData)

Default class constructor. Used internally. Do not call it in your code!

Parameters:
  • parent – the control parent window;
  • colourData – an instance of ColourData.


AddCustom(self, colour)

Adds a user-chosen colour to the list of custom colours.

Parameters:colour – an instance of Colour.


DoGetBestSize(self)

Overridden base class virtual. Determines the best size of the control.

Note

Overridden from PyControl.



InitializeColours(self)

Initializes the 16 custom colours in CustomPanel.



OnEraseBackground(self, event)

Handles the EVT_ERASE_BACKGROUND for CustomPanel.

Parameters:event – a EraseEvent event to be processed.

Note

This is intentionally empty to reduce flicker.



OnLeftDown(self, event)

Handles the EVT_LEFT_DOWN for CustomPanel.

Parameters:event – a MouseEvent event to be processed.


OnPaint(self, event)

Handles the EVT_PAINT for CustomPanel.

Parameters:event – a PaintEvent event to be processed.


OnSize(self, event)

Handles the EVT_SIZE for CustomPanel.

Parameters:event – a SizeEvent event to be processed.


PaintCustomColour(self, dc, selX, selY)

Paints a newly added custom colour subpanel.

Parameters:
  • dc – an instance of DC;
  • selX – the x coordinate of the custom colour subpanel;
  • selY – the y coordinate of the custom colour subpanel.


PaintCustomColours(self, dc)

Draws all the 16 subpanels with their custom colours.

Parameters:dc – an instance of DC.


PaintHighlight(self, dc, draw=True)

Highlight the current custom colour selection (if any).

Parameters:
  • dc – an instance of DC;
  • draw – whether to draw a thin black border around the selected custom colour or not.