]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: clrpicker.h | |
3 | // Purpose: documentation for wxColourPickerCtrl class | |
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 | |
23324ae1 FM |
38 | @seealso |
39 | wxColourDialog, wxColourPickerEvent | |
40 | */ | |
41 | class wxColourPickerCtrl : public wxPickerBase | |
42 | { | |
43 | public: | |
44 | /** | |
45 | Initializes the object and calls Create() with | |
46 | all the parameters. | |
47 | */ | |
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"); | |
55 | ||
56 | /** | |
7c913512 | 57 | @param parent |
23324ae1 FM |
58 | Parent window, must not be non-@NULL. |
59 | ||
7c913512 | 60 | @param id |
23324ae1 FM |
61 | The identifier for the control. |
62 | ||
7c913512 | 63 | @param colour |
23324ae1 FM |
64 | The initial colour shown in the control. |
65 | ||
7c913512 | 66 | @param pos |
23324ae1 FM |
67 | Initial position. |
68 | ||
7c913512 | 69 | @param size |
23324ae1 FM |
70 | Initial size. |
71 | ||
7c913512 | 72 | @param style |
23324ae1 FM |
73 | The window style, see wxCRLP_* flags. |
74 | ||
7c913512 | 75 | @param validator |
23324ae1 FM |
76 | Validator which can be used for additional date checks. |
77 | ||
7c913512 | 78 | @param name |
23324ae1 FM |
79 | Control name. |
80 | ||
81 | @returns @true if the control was successfully created or @false if | |
82 | creation failed. | |
83 | */ | |
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"); | |
91 | ||
92 | /** | |
93 | Returns the currently selected colour. | |
94 | */ | |
95 | wxColour GetColour(); | |
96 | ||
97 | //@{ | |
98 | /** | |
99 | Sets the currently selected colour. See wxColour::Set. | |
100 | */ | |
101 | void SetColour(const wxColour & col); | |
7c913512 | 102 | void SetColour(const wxString & colname); |
23324ae1 FM |
103 | //@} |
104 | }; | |
105 | ||
106 | ||
107 | /** | |
108 | @class wxColourPickerEvent | |
109 | @wxheader{clrpicker.h} | |
7c913512 | 110 | |
23324ae1 FM |
111 | This event class is used for the events generated by |
112 | wxColourPickerCtrl. | |
7c913512 | 113 | |
23324ae1 FM |
114 | @library{wxcore} |
115 | @category{FIXME} | |
7c913512 | 116 | |
23324ae1 FM |
117 | @seealso |
118 | wxColourPickerCtrl | |
119 | */ | |
120 | class wxColourPickerEvent : public wxCommandEvent | |
121 | { | |
122 | public: | |
123 | /** | |
124 | The constructor is not normally used by the user code. | |
125 | */ | |
126 | wxColourPickerEvent(wxObject * generator, int id, | |
127 | const wxColour& colour); | |
128 | ||
129 | /** | |
130 | Retrieve the colour the user has just selected. | |
131 | */ | |
132 | wxColour GetColour(); | |
133 | ||
134 | /** | |
135 | Set the colour associated with the event. | |
136 | */ | |
137 | void SetColour(const wxColour & pos); | |
138 | }; |