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