]>
git.saurik.com Git - wxWidgets.git/blob - interface/clrpicker.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxColourPickerCtrl
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxColourPickerCtrl
11 @wxheader{clrpicker.h}
13 This control allows the user to select a colour. The generic implementation is
14 a button which brings up a wxColourDialog when clicked. Native implementation
15 may differ but this is usually a (small) widget which give access to the
18 It is only available if @c wxUSE_COLOURPICKERCTRL is set to 1 (the default).
21 @style{wxCLRP_DEFAULT_STYLE}:
23 @style{wxCLRP_USE_TEXTCTRL}:
24 Creates a text control to the left of the picker button which is
25 completely managed by the wxColourPickerCtrl and which can be used
26 by the user to specify a colour (see SetColour). The text control
27 is automatically synchronized with button's value. Use functions
28 defined in wxPickerBase to modify the text control.
29 @style{wxCLRP_SHOW_LABEL}:
30 Shows the colour in HTML form (AABBCC) as colour button label
31 (instead of no label at all).
35 @category{miscpickers}
36 @appearance{colourpickerctrl.png}
38 @see wxColourDialog, wxColourPickerEvent
40 class wxColourPickerCtrl
: public wxPickerBase
44 Initializes the object and calls Create() with
47 wxColourPickerCtrl(wxWindow
* parent
, wxWindowID id
,
48 const wxColour
& colour
= wxBLACK
,
49 const wxPoint
& pos
= wxDefaultPosition
,
50 const wxSize
& size
= wxDefaultSize
,
51 long style
= wxCLRP_DEFAULT_STYLE
,
52 const wxValidator
& validator
= wxDefaultValidator
,
53 const wxString
& name
= "colourpickerctrl");
57 Parent window, must not be non-@NULL.
59 The identifier for the control.
61 The initial colour shown in the control.
67 The window style, see wxCRLP_* flags.
69 Validator which can be used for additional date checks.
73 @returns @true if the control was successfully created or @false if
76 bool Create(wxWindow
* parent
, wxWindowID id
,
77 const wxColour
& colour
= wxBLACK
,
78 const wxPoint
& pos
= wxDefaultPosition
,
79 const wxSize
& size
= wxDefaultSize
,
80 long style
= wxCLRP_DEFAULT_STYLE
,
81 const wxValidator
& validator
= wxDefaultValidator
,
82 const wxString
& name
= "colourpickerctrl");
85 Returns the currently selected colour.
87 wxColour
GetColour() const;
91 Sets the currently selected colour. See wxColour::Set.
93 void SetColour(const wxColour
& col
);
94 void SetColour(const wxString
& colname
);
101 @class wxColourPickerEvent
102 @wxheader{clrpicker.h}
104 This event class is used for the events generated by
110 @see wxColourPickerCtrl
112 class wxColourPickerEvent
: public wxCommandEvent
116 The constructor is not normally used by the user code.
118 wxColourPickerEvent(wxObject
* generator
, int id
,
119 const wxColour
& colour
);
122 Retrieve the colour the user has just selected.
124 wxColour
GetColour() const;
127 Set the colour associated with the event.
129 void SetColour(const wxColour
& pos
);