]> git.saurik.com Git - wxWidgets.git/blame - interface/clrpicker.h
regenerated headers to remove @seealso in favour of @see; fixed links to global funct...
[wxWidgets.git] / interface / clrpicker.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: clrpicker.h
e54c96f1 3// Purpose: interface of wxColourPickerCtrl
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxColourPickerCtrl
11 @wxheader{clrpicker.h}
7c913512 12
23324ae1
FM
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
16 colour-chooser
17 dialog.
18 It is only available if @c wxUSE_COLOURPICKERCTRL is set to 1 (the default).
7c913512 19
23324ae1
FM
20 @beginStyleTable
21 @style{wxCLRP_DEFAULT_STYLE}:
22 The default style: 0.
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).
32 @endStyleTable
7c913512 33
23324ae1
FM
34 @library{wxcore}
35 @category{miscpickers}
36 @appearance{colourpickerctrl.png}
7c913512 37
e54c96f1 38 @see wxColourDialog, wxColourPickerEvent
23324ae1
FM
39*/
40class wxColourPickerCtrl : public wxPickerBase
41{
42public:
43 /**
44 Initializes the object and calls Create() with
45 all the parameters.
46 */
4cc4bfaf 47 wxColourPickerCtrl(wxWindow* parent, wxWindowID id,
23324ae1
FM
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");
54
55 /**
7c913512 56 @param parent
4cc4bfaf 57 Parent window, must not be non-@NULL.
7c913512 58 @param id
4cc4bfaf 59 The identifier for the control.
7c913512 60 @param colour
4cc4bfaf 61 The initial colour shown in the control.
7c913512 62 @param pos
4cc4bfaf 63 Initial position.
7c913512 64 @param size
4cc4bfaf 65 Initial size.
7c913512 66 @param style
4cc4bfaf 67 The window style, see wxCRLP_* flags.
7c913512 68 @param validator
4cc4bfaf 69 Validator which can be used for additional date checks.
7c913512 70 @param name
4cc4bfaf 71 Control name.
23324ae1
FM
72
73 @returns @true if the control was successfully created or @false if
4cc4bfaf 74 creation failed.
23324ae1 75 */
4cc4bfaf 76 bool Create(wxWindow* parent, wxWindowID id,
23324ae1
FM
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");
83
84 /**
85 Returns the currently selected colour.
86 */
328f5751 87 wxColour GetColour() const;
23324ae1
FM
88
89 //@{
90 /**
91 Sets the currently selected colour. See wxColour::Set.
92 */
4cc4bfaf
FM
93 void SetColour(const wxColour& col);
94 void SetColour(const wxString& colname);
23324ae1
FM
95 //@}
96};
97
98
e54c96f1 99
23324ae1
FM
100/**
101 @class wxColourPickerEvent
102 @wxheader{clrpicker.h}
7c913512 103
23324ae1
FM
104 This event class is used for the events generated by
105 wxColourPickerCtrl.
7c913512 106
23324ae1
FM
107 @library{wxcore}
108 @category{FIXME}
7c913512 109
e54c96f1 110 @see wxColourPickerCtrl
23324ae1
FM
111*/
112class wxColourPickerEvent : public wxCommandEvent
113{
114public:
115 /**
116 The constructor is not normally used by the user code.
117 */
4cc4bfaf 118 wxColourPickerEvent(wxObject* generator, int id,
23324ae1
FM
119 const wxColour& colour);
120
121 /**
122 Retrieve the colour the user has just selected.
123 */
328f5751 124 wxColour GetColour() const;
23324ae1
FM
125
126 /**
127 Set the colour associated with the event.
128 */
4cc4bfaf 129 void SetColour(const wxColour& pos);
23324ae1 130};
e54c96f1 131