Home | Trees | Index | Help |
|
---|
Package wx :: Package lib :: Package colourchooser :: Module pycolourchooser :: Class PyColourChooser |
|
object
--+ |Object
--+ |EvtHandler
--+ |Window
--+ |Panel
--+ | PyColourChooser
A Pure-Python implementation of the colour chooser dialog.
The PyColourChooser is a pure python implementation of the colour chooser dialog. It's useful for embedding the colour choosing functionality inside other widgets, when the pop-up dialog is undesirable. It can also be used as a drop-in replacement on the GTK platform, as the native dialog is kind of ugly.
Method Summary | |
---|---|
Creates an instance of the colour chooser. | |
Updates the colour values based on the mouse location over the palette. | |
Returns a wxColour object indicating the current colour choice. | |
Initializes the pre-set palette colours. | |
Adds a custom colour to the custom colour box set. | |
Highlights the selected colour box and updates the solid colour display and colour slider to reflect the choice. | |
Highlights the selected custom colour box and updates the solid colour display and colour slider to reflect the choice. | |
Stores state that the mouse has been pressed and updates the selected colour values. | |
Updates the colour values during mouse motion while the mouse button is depressed. | |
Stores state that the mouse is no longer depressed. | |
Updates the solid colour display to reflect the changing slider. | |
Sets the custom colour at the given index. | |
Updates the colour chooser to reflect the given wxColour. | |
Performs necessary updates for when the colour selection has changed. | |
Updates the color levels to display the new values. |
Property Summary |
---|
Class Variable Summary | |
---|---|
list |
colour_names = ['ORANGE', 'GOLDENROD', 'WHEAT', 'SPRING ...
|
list |
custom_colours = [(wx.Colour(255, 255, 255, 255), 86), (...
|
int |
idADD_CUSTOM = 129 |
int |
idSCROLL = 130 |
int |
last_custom = 0 |
int |
NO_CUSTOM_COLOURS = 16 |
Instance Method Details |
---|
__init__(self,
parent,
id)
|
doPaletteClick(self, m_x, m_y)Updates the colour values based on the mouse location over the palette. |
GetValue(self)Returns a wxColour object indicating the current colour choice. |
InitColours(self)Initializes the pre-set palette colours. |
onAddCustom(self, event)Adds a custom colour to the custom colour box set. Boxes are chosen in a round-robin fashion, eventually overwriting previously added colours. |
onBasicClick(self, event, box)Highlights the selected colour box and updates the solid colour display and colour slider to reflect the choice. |
onCustomClick(self, event, box)Highlights the selected custom colour box and updates the solid colour display and colour slider to reflect the choice. |
onPaletteDown(self, event)Stores state that the mouse has been pressed and updates the selected colour values. |
onPaletteMotion(self, event)Updates the colour values during mouse motion while the mouse button is depressed. |
onPaletteUp(self, event)Stores state that the mouse is no longer depressed. |
onScroll(self, event)Updates the solid colour display to reflect the changing slider. |
setCustomColour(self, index, true_colour, base_colour, slidepos)Sets the custom colour at the given index. true_colour is wxColour object containing the actual rgb value of the custom colour. base_colour (wxColour) and slidepos (int) are used to configure the colour slider and set everything to its original position. |
SetValue(self, colour)Updates the colour chooser to reflect the given wxColour. |
UpdateColour(self, colour)Performs necessary updates for when the colour selection has changed. |
UpdateEntries(self, colour)Updates the color levels to display the new values. |
Class Variable Details |
---|
colour_names
|
idADD_CUSTOM
|
idSCROLL
|
last_custom
|
NO_CUSTOM_COLOURS
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:10:34 2007 | http://epydoc.sf.net |