#include <ColorPickerControl.h>
Public Member Functions | |
| ColorPickerControl () | |
| ColorPickerControl (wxWindow *parent, wxWindowID id, wxPoint pt, wxSize sz) | |
| ColorPickerControl constructor. | |
| void | SetColor (wxColour clrColor) |
| Assign a color to this control and refresh the control so the new color is shown. | |
| wxColour | GetColor () |
| Retrieve the color selected. | |
Private Member Functions | |
| void | OnPaint (wxPaintEvent &event) |
| Repaint the control. | |
| void | OnLeftUp (wxMouseEvent &event) |
| Left mouse button released - user wants to change the color. | |
| DECLARE_EVENT_TABLE () DECLARE_DYNAMIC_CLASS(ColorPickerControl) | |
Private Attributes | |
| wxColour | m_clrSelection |
| Here we have the color the user has selected. | |
The selected color appears in a box, which when clicked brings up a wxColourDialog box allowing the user to select a new color.
Definition at line 42 of file ColorPickerControl.h.
| ColorPickerControl::ColorPickerControl | ( | ) |
| ColorPickerControl::ColorPickerControl | ( | wxWindow * | parent, | |
| wxWindowID | id, | |||
| wxPoint | pt, | |||
| wxSize | sz | |||
| ) |
| void ColorPickerControl::SetColor | ( | wxColour | clrColor | ) |
Assign a color to this control and refresh the control so the new color is shown.
Definition at line 161 of file ColorPickerControl.cpp.
| wxColour ColorPickerControl::GetColor | ( | ) |
| void ColorPickerControl::OnPaint | ( | wxPaintEvent & | event | ) | [private] |
| void ColorPickerControl::OnLeftUp | ( | wxMouseEvent & | event | ) | [private] |
Left mouse button released - user wants to change the color.
When the left mouse button is pressed in the control, a wxColourDialog is shown to let the user pick a new color. The new color is then stored in m_clrSelection, and the parent is notified with a wxEVT_COMMAND_BUTTON_CLICKED event.
Definition at line 137 of file ColorPickerControl.cpp.
| ColorPickerControl::DECLARE_EVENT_TABLE | ( | ) | [private] |
wxColour ColorPickerControl::m_clrSelection [private] |
1.5.5