ColorPickerControl Class Reference
[Roadnav Control Classes]

wxControl that allows the user to pick a color More...

#include <ColorPickerControl.h>

List of all members.

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.


Detailed Description

wxControl that allows the user to pick a color

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.


Constructor & Destructor Documentation

ColorPickerControl::ColorPickerControl (  ) 

ColorPickerControl::ColorPickerControl ( wxWindow *  parent,
wxWindowID  id,
wxPoint  pt,
wxSize  sz 
)

ColorPickerControl constructor.

Definition at line 69 of file ColorPickerControl.cpp.


Member Function Documentation

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 (  ) 

Retrieve the color selected.

Definition at line 173 of file ColorPickerControl.cpp.

void ColorPickerControl::OnPaint ( wxPaintEvent &  event  )  [private]

Repaint the control.

Definition at line 81 of file ColorPickerControl.cpp.

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]


Member Data Documentation

Here we have the color the user has selected.

Definition at line 56 of file ColorPickerControl.h.


The documentation for this class was generated from the following files:

Generated on Sun Jul 27 17:26:09 2008 for Roadnav by  doxygen 1.5.5