]>
git.saurik.com Git - wxWidgets.git/blob - interface/clrpicker.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxColourPickerCtrl class
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}
39 wxColourDialog, wxColourPickerEvent
41 class wxColourPickerCtrl
: public wxPickerBase
45 Initializes the object and calls Create() with
48 wxColourPickerCtrl(wxWindow
* parent
, wxWindowID id
,
49 const wxColour
& colour
= wxBLACK
,
50 const wxPoint
& pos
= wxDefaultPosition
,
51 const wxSize
& size
= wxDefaultSize
,
52 long style
= wxCLRP_DEFAULT_STYLE
,
53 const wxValidator
& validator
= wxDefaultValidator
,
54 const wxString
& name
= "colourpickerctrl");
58 Parent window, must not be non-@NULL.
61 The identifier for the control.
64 The initial colour shown in the control.
73 The window style, see wxCRLP_* flags.
76 Validator which can be used for additional date checks.
81 @returns @true if the control was successfully created or @false if
84 bool Create(wxWindow
* parent
, wxWindowID id
,
85 const wxColour
& colour
= wxBLACK
,
86 const wxPoint
& pos
= wxDefaultPosition
,
87 const wxSize
& size
= wxDefaultSize
,
88 long style
= wxCLRP_DEFAULT_STYLE
,
89 const wxValidator
& validator
= wxDefaultValidator
,
90 const wxString
& name
= "colourpickerctrl");
93 Returns the currently selected colour.
99 Sets the currently selected colour. See wxColour::Set.
101 void SetColour(const wxColour
& col
);
102 void SetColour(const wxString
& colname
);
108 @class wxColourPickerEvent
109 @wxheader{clrpicker.h}
111 This event class is used for the events generated by
120 class wxColourPickerEvent
: public wxCommandEvent
124 The constructor is not normally used by the user code.
126 wxColourPickerEvent(wxObject
* generator
, int id
,
127 const wxColour
& colour
);
130 Retrieve the colour the user has just selected.
132 wxColour
GetColour();
135 Set the colour associated with the event.
137 void SetColour(const wxColour
& pos
);