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