2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: clrpicker.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxColourPickerCtrl
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxColourPickerCtrl
|
|
|
|
@wxheader{clrpicker.h}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
This control allows the user to select a colour. The generic implementation is
|
|
|
|
a button which brings up a wxColourDialog when clicked. Native implementation
|
|
|
|
may differ but this is usually a (small) widget which give access to the
|
|
|
|
colour-chooser
|
|
|
|
dialog.
|
|
|
|
It is only available if @c wxUSE_COLOURPICKERCTRL is set to 1 (the default).
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginStyleTable
|
|
|
|
@style{wxCLRP_DEFAULT_STYLE}:
|
|
|
|
The default style: 0.
|
|
|
|
@style{wxCLRP_USE_TEXTCTRL}:
|
|
|
|
Creates a text control to the left of the picker button which is
|
|
|
|
completely managed by the wxColourPickerCtrl and which can be used
|
|
|
|
by the user to specify a colour (see SetColour). The text control
|
|
|
|
is automatically synchronized with button's value. Use functions
|
|
|
|
defined in wxPickerBase to modify the text control.
|
|
|
|
@style{wxCLRP_SHOW_LABEL}:
|
|
|
|
Shows the colour in HTML form (AABBCC) as colour button label
|
|
|
|
(instead of no label at all).
|
|
|
|
@endStyleTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{miscpickers}
|
|
|
|
@appearance{colourpickerctrl.png}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxColourDialog, wxColourPickerEvent
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxColourPickerCtrl : public wxPickerBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Initializes the object and calls Create() with
|
|
|
|
all the parameters.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxColourPickerCtrl(wxWindow* parent, wxWindowID id,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxColour& colour = wxBLACK,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxCLRP_DEFAULT_STYLE,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = "colourpickerctrl");
|
|
|
|
|
|
|
|
/**
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-09 12:33:59 +00:00
|
|
|
Parent window, must not be non-@NULL.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-09 12:33:59 +00:00
|
|
|
The identifier for the control.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param colour
|
2008-03-09 12:33:59 +00:00
|
|
|
The initial colour shown in the control.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-03-09 12:33:59 +00:00
|
|
|
Initial position.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2008-03-09 12:33:59 +00:00
|
|
|
Initial size.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
The window style, see wxCRLP_* flags.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param validator
|
2008-03-09 12:33:59 +00:00
|
|
|
Validator which can be used for additional date checks.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
Control name.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@returns @true if the control was successfully created or @false if
|
2008-03-09 12:33:59 +00:00
|
|
|
creation failed.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxColour& colour = wxBLACK,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxCLRP_DEFAULT_STYLE,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = "colourpickerctrl");
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the currently selected colour.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxColour GetColour() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Sets the currently selected colour. See wxColour::Set.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
void SetColour(const wxColour& col);
|
|
|
|
void SetColour(const wxString& colname);
|
2008-03-08 13:52:38 +00:00
|
|
|
//@}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxColourPickerEvent
|
|
|
|
@wxheader{clrpicker.h}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
This event class is used for the events generated by
|
|
|
|
wxColourPickerCtrl.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{FIXME}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxColourPickerCtrl
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxColourPickerEvent : public wxCommandEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
The constructor is not normally used by the user code.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxColourPickerEvent(wxObject* generator, int id,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxColour& colour);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Retrieve the colour the user has just selected.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxColour GetColour() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Set the colour associated with the event.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
void SetColour(const wxColour& pos);
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|