]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/clrpicker.tex
silence gcc warnings about values not handled in switch
[wxWidgets.git] / docs / latex / wx / clrpicker.tex
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: clrpicker.tex
3 %% Purpose: wxColourPickerCtrl and wxColourPickerEvent documentation
4 %% Author: Francesco Montorsi
5 %% Created: 2006-04-17
6 %% RCS-ID: $Id$
7 %% Copyright: (c) 2006 Francesco Montorsi
8 %% License: wxWindows license
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11 \section{\class{wxColourPickerCtrl}}\label{wxcolourpickerctrl}
12
13 This control allows the user to select a colour. The generic implementation is
14 a button which brings up a \helpref{wxColourDialog}{wxcolourdialog} when clicked. Native implementation
15 may differ but this is usually a (small) widget which give access to the colour-chooser
16 dialog.
17 It is only available if \texttt{wxUSE\_COLOURPICKERCTRL} is set to $1$ (the default).
18
19 \wxheading{Derived from}
20
21 \helpref{wxPickerBase}{wxpickerbase}\\
22 \helpref{wxControl}{wxcontrol}\\
23 \helpref{wxWindow}{wxwindow}\\
24 \helpref{wxEvtHandler}{wxevthandler}\\
25 \helpref{wxObject}{wxobject}
26
27 \wxheading{Include files}
28
29 <wx/clrpicker.h>
30
31 \wxheading{Window styles}
32
33 \twocolwidtha{5cm}%
34 \begin{twocollist}\itemsep=0pt
35 \twocolitem{\windowstyle{wxCLRP\_DEFAULT}}{Default style.}
36 \twocolitem{\windowstyle{wxCLRP\_USE\_TEXTCTRL}}{Creates a text control to the left of the
37 picker button which is completely managed by the \helpref{wxColourPickerCtrl}{wxcolourpickerctrl}
38 and which can be used by the user to specify a colour (see \helpref{SetColour}{wxcolourpickerctrlsetcolour}).
39 The text control is automatically synchronized with button's value. Use functions defined in \helpref{wxPickerBase}{wxpickerbase} to modify the text control.}
40 \twocolitem{\windowstyle{wxCLRP\_USE\_TEXTCTRL}}{Creates a text control to the left of the
41 picker button which is completely managed by the \helpref{wxColourPickerCtrl}{wxcolourpickerctrl}
42 and which can be used by the user to specify a colour (see \helpref{SetColour}{wxcolourpickerctrlsetcolour}).
43 The text control is automatically synchronized with button's value. Use functions defined in \helpref{wxPickerBase}{wxpickerbase} to modify the text control.}
44 \twocolitem{\windowstyle{wxCLRP\_SHOW\_LABEL}}{Shows the colour in HTML form (#AABBCC) as colour button label
45 (instead of no label at all).}
46 \end{twocollist}
47
48 \wxheading{Event handling}
49
50 \twocolwidtha{7cm}%
51 \begin{twocollist}\itemsep=0pt
52 \twocolitem{{\bf EVT\_COLOURPICKER\_CHANGED(id, func)}}{The user changed the
53 colour selected in the control either using the button or using text control
54 (see wxCLRP\_USE\_TEXTCTRL; note that in this case the event is fired only if
55 the user's input is valid, i.e. recognizable). }
56 \end{twocollist}
57
58 \wxheading{See also}
59
60 \helpref{wxColourDialog}{wxcolourdialog},\\
61 \helpref{wxColourPickerEvent}{wxcolourpickerevent}
62
63
64 \latexignore{\rtfignore{\wxheading{Members}}}
65
66 \membersection{wxColourPickerCtrl::wxColourPickerCtrl}\label{wxcolourpickerctrl}
67
68 \func{}{wxColourPickerCtrl}{\param{wxWindow *}{parent},\rtfsp
69 \param{wxWindowID}{ id},\rtfsp
70 \param{const wxColour\& }{colour = *wxBLACK},\rtfsp
71 \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
72 \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
73 \param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
74 \param{const wxValidator\& }{validator = wxDefaultValidator},
75 \param{const wxString\& }{name = ``colourpickerctrl"}}
76
77 Initializes the object and calls \helpref{Create}{wxcolourpickerctrlcreate} with
78 all the parameters.
79
80
81 \membersection{wxColourPickerCtrl::Create}\label{wxcolourpickerctrlcreate}
82
83 \func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
84 \param{wxWindowID}{ id},\rtfsp
85 \param{const wxColour\& }{colour = *wxBLACK},\rtfsp
86 \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
87 \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
88 \param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
89 \param{const wxValidator\& }{validator = wxDefaultValidator},
90 \param{const wxString\& }{name = ``colourpickerctrl"}}
91
92 \wxheading{Parameters}
93
94 \docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
95
96 \docparam{id}{The identifier for the control.}
97
98 \docparam{colour}{The initial colour shown in the control.}
99
100 \docparam{pos}{Initial position.}
101
102 \docparam{size}{Initial size.}
103
104 \docparam{style}{The window style, see wxCRLP\_* flags.}
105
106 \docparam{validator}{Validator which can be used for additional date checks.}
107
108 \docparam{name}{Control name.}
109
110 \wxheading{Return value}
111
112 \true if the control was successfully created or \false if creation failed.
113
114
115 \membersection{wxColourPickerCtrl::GetColour}\label{wxcolourpickerctrlgetcolour}
116
117 \constfunc{wxColour}{GetColour}{\void}
118
119 Returns the currently selected colour.
120
121
122 \membersection{wxColourPickerCtrl::SetColour}\label{wxcolourpickerctrlsetcolour}
123
124 \func{void}{SetColour}{\param{const wxColour \&}{col}}
125
126 \func{void}{SetColour}{\param{const wxString \&}{colname}}
127
128 Sets the currently selected colour. See \helpref{wxColour::Set}{wxcolourset}.
129
130
131
132
133 %% wxColourPickerEvent documentation
134
135 \section{\class{wxColourPickerEvent}}\label{wxcolourpickerevent}
136
137 This event class is used for the events generated by
138 \helpref{wxColourPickerCtrl}{wxcolourpickerctrl}.
139
140 \wxheading{Derived from}
141
142 \helpref{wxCommandEvent}{wxcommandevent}\\
143 \helpref{wxEvent}{wxevent}\\
144 \helpref{wxObject}{wxobject}
145
146 \wxheading{Include files}
147
148 <wx/clrpicker.h>
149
150 \wxheading{Event handling}
151
152 To process input from a wxColourPickerCtrl, use one of these event handler macros to
153 direct input to member function that take a
154 \helpref{wxColourPickerEvent}{wxcolourpickerevent} argument:
155
156 \twocolwidtha{7cm}
157 \begin{twocollist}
158 \twocolitem{{\bf EVT\_COLOURPICKER\_CHANGED(id, func)}}{Generated whenever the selected colour changes.}
159 \end{twocollist}%
160
161
162 \wxheading{See also}
163
164 \helpref{wxColourPickerCtrl}{wxcolourpickerctrl}
165
166 \latexignore{\rtfignore{\wxheading{Members}}}
167
168 \membersection{wxColourPickerEvent::wxColourPickerEvent}\label{wxcolourpickereventctor}
169
170 \func{}{wxColourPickerEvent}{\param{wxObject *}{ generator}, \param{int}{ id}, \param{const wxColour\&}{ colour}}
171
172 The constructor is not normally used by the user code.
173
174
175 \membersection{wxColourPickerEvent::GetColour}\label{wxcolourpickereventgetcolour}
176
177 \constfunc{wxColour}{GetColour}{\void}
178
179 Retrieve the colour the user has just selected.
180
181
182 \membersection{wxColourPickerEvent::SetColour}\label{wxcolourpickereventsetcolour}
183
184 \func{void}{SetColour}{\param{const wxColour \&}{pos}}
185
186 Set the colour associated with the event.
187