AGW Logo

agw_title CustomPanel

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

hierarchy Inheritance Diagram

Inheritance diagram for: CustomPanel

Inheritance diagram of CustomPanel


method_summary Methods Summary

__init__Default class constructor.
AddCustomAdds a user-chosen colour to the list of custom colours.
DoGetBestSizeOverridden base class virtual.
InitializeColoursInitializes the 16 custom colours in CustomPanel.
OnEraseBackgroundHandles the wx.EVT_ERASE_BACKGROUND for CustomPanel.
OnLeftDownHandles the wx.EVT_LEFT_DOWN for CustomPanel.
OnPaintHandles the wx.EVT_PAINT for CustomPanel.
OnSizeHandles the wx.EVT_SIZE for CustomPanel.
PaintCustomColourPaints a newly added custom colour subpanel.
PaintCustomColoursDraws all the 16 subpanels with their custom colours.
PaintHighlightHighlight the current custom colour selection (if any).

API Class API

class CustomPanel(wx.PyControl)[source]

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



__init__(parent, colourData)[source]

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

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


AddCustom(colour)[source]

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

Parameters:colour – an instance of wx.Colour.


DoGetBestSize()[source]

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

Note

Overridden from wx.PyControl.



InitializeColours()[source]

Initializes the 16 custom colours in CustomPanel.



OnEraseBackground(event)[source]

Handles the wx.EVT_ERASE_BACKGROUND for CustomPanel.

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

Note

This is intentionally empty to reduce flicker.



OnLeftDown(event)[source]

Handles the wx.EVT_LEFT_DOWN for CustomPanel.

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


OnPaint(event)[source]

Handles the wx.EVT_PAINT for CustomPanel.

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


OnSize(event)[source]

Handles the wx.EVT_SIZE for CustomPanel.

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


PaintCustomColour(dc, selX, selY)[source]

Paints a newly added custom colour subpanel.

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


PaintCustomColours(dc)[source]

Draws all the 16 subpanels with their custom colours.

Parameters:dc – an instance of wx.DC.



PaintHighlight(dc, draw=True)[source]

Highlight the current custom colour selection (if any).

Parameters:
  • dc – an instance of wx.DC;

  • draw – whether to draw a thin black border around the selected custom colour or not.
Tree

Table Of Contents

Previous topic

CubeColourDialog

Next topic

HSVWheel