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