]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/fontpicker.tex
Limit indentation in style listbox, and also show centring
[wxWidgets.git] / docs / latex / wx / fontpicker.tex
CommitLineData
ec376c8f
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: fontpicker.tex
3%% Purpose: wxFontPickerCtrl and wxFontPickerEvent 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{wxFontPickerCtrl}}\label{wxfontpickerctrl}
12
13This control allows the user to select a font. The generic implementation is
14a button which brings up a \helpref{wxFontDialog}{wxfontdialog} when clicked. Native implementation
15may differ but this is usually a (small) widget which give access to the font-chooser
16dialog.
17It is only available if \texttt{wxUSE\_FONTPICKERCTRL} 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/fontpicker.h>
30
31\wxheading{Window styles}
32
33\twocolwidtha{5cm}%
34\begin{twocollist}\itemsep=0pt
34c07b8b 35\twocolitem{\windowstyle{wxFNTP\_DEFAULT\_STYLE}}{The default style:
58772e49 36wxFNTP\_FONTDESC\_AS\_LABEL | wxFNTP\_USEFONT\_FOR\_LABEL.}
aaa6f9ba 37\twocolitem{\windowstyle{wxFNTP\_USE\_TEXTCTRL}}{Creates a text control to the left of the
ec376c8f
VZ
38picker button which is completely managed by the \helpref{wxFontPickerCtrl}{wxfontpickerctrl}
39and which can be used by the user to specify a font (see \helpref{SetSelectedFont}{wxfontpickerctrlsetselectedfont}).
40The text control is automatically synchronized with button's value. Use functions defined in \helpref{wxPickerBase}{wxpickerbase} to modify the text control.}
aaa6f9ba
RD
41\twocolitem{\windowstyle{wxFNTP\_FONTDESC\_AS\_LABEL}}{Keeps the label of the button updated with the fontface name and the font size. E.g. choosing "Times New Roman bold, italic with size 10" from the fontdialog, will update the label (overwriting any previous label) with the "Times New Roman, 10" text.}
42\twocolitem{\windowstyle{wxFNTP\_USEFONT\_FOR\_LABEL}}{Uses the currently selected font to draw the label of the button.}
ec376c8f
VZ
43\end{twocollist}
44
45\wxheading{Event handling}
46
47\twocolwidtha{7cm}%
48\begin{twocollist}\itemsep=0pt
49\twocolitem{{\bf EVT\_FONTPICKER\_CHANGED(id, func)}}{The user changed the font
50selected in the control either using the button or using text control (see
aaa6f9ba 51wxFNTP\_USE\_TEXTCTRL; note that in this case the event is fired only if the
ec376c8f
VZ
52user's input is valid, i.e. recognizable). }
53\end{twocollist}
54
55\wxheading{See also}
56
57\helpref{wxFontDialog}{wxfontdialog},\\
58\helpref{wxFontPickerEvent}{wxfontpickerevent}
59
60
61\latexignore{\rtfignore{\wxheading{Members}}}
62
63\membersection{wxFontPickerCtrl::wxFontPickerCtrl}\label{wxfontpickerctrl}
64
65\func{}{wxFontPickerCtrl}{\param{wxWindow *}{parent},\rtfsp
66\param{wxWindowID}{ id},\rtfsp
305329c2 67\param{const wxFont\& }{font = wxNullFont},\rtfsp
ec376c8f
VZ
68\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
69\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
aaa6f9ba 70\param{long}{ style = wxFNTP\_DEFAULT\_STYLE},\rtfsp
ec376c8f
VZ
71\param{const wxValidator\& }{validator = wxDefaultValidator},
72\param{const wxString\& }{name = ``fontpickerctrl"}}
73
74Initializes the object and calls \helpref{Create}{wxfontpickerctrlcreate} with
75all the parameters.
76
77
78\membersection{wxFontPickerCtrl::Create}\label{wxfontpickerctrlcreate}
79
80\func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
81\param{wxWindowID}{ id},\rtfsp
305329c2 82\param{const wxFont\& }{font = wxNullFont},\rtfsp
ec376c8f
VZ
83\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
84\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
aaa6f9ba 85\param{long}{ style = wxFNTP\_DEFAULT\_STYLE},\rtfsp
ec376c8f
VZ
86\param{const wxValidator\& }{validator = wxDefaultValidator},
87\param{const wxString\& }{name = ``fontpickerctrl"}}
88
89\wxheading{Parameters}
90
91\docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
92
93\docparam{id}{The identifier for the control.}
94
0817a2c5
VZ
95\docparam{font}{The initial font shown in the control. If \texttt{wxNullFont}
96is given, the default font is used.}
ec376c8f
VZ
97
98\docparam{pos}{Initial position.}
99
100\docparam{size}{Initial size.}
101
aaa6f9ba 102\docparam{style}{The window style, see {\tt wxFNTP\_*} flags.}
ec376c8f
VZ
103
104\docparam{validator}{Validator which can be used for additional date checks.}
105
106\docparam{name}{Control name.}
107
108\wxheading{Return value}
109
110\true if the control was successfully created or \false if creation failed.
111
112
113\membersection{wxFontPickerCtrl::GetSelectedFont}\label{wxfontpickerctrlgetselectedfont}
114
115\constfunc{wxFont}{GetSelectedFont}{\void}
116
117Returns the currently selected font.
118Note that this function is completely different from \helpref{wxWindow::GetFont}{wxwindowgetfont}.
119
120
121\membersection{wxFontPickerCtrl::SetSelectedFont}\label{wxfontpickerctrlsetselectedfont}
122
123\func{void}{SetSelectedFont}{\param{const wxFont \&}{font}}
124
125Sets the currently selected font.
126Note that this function is completely different from \helpref{wxWindow::SetFont}{wxwindowsetfont}.
127
128
129\membersection{wxFontPickerCtrl::GetMaxPointSize}\label{wxfontpickerctrlgetmaxpointsize}
130
131\constfunc{unsigned int}{GetMaxPointSize}{\void}
132
133Returns the maximum point size value allowed for the user-chosen font.
134
135
136\membersection{wxFontPickerCtrl::SetMaxPointSize}\label{wxfontpickerctrlsetmaxpointsize}
137
138\func{void}{GetMaxPointSize}{\param{unsigned int}{ max}}
139
140Sets the maximum point size value allowed for the user-chosen font.
141The default value is 100. Note that big fonts can require a lot of memory and CPU time
142both for creation and for rendering; thus, specially because the user has the option to specify
aaa6f9ba 143the fontsize through a text control (see wxFNTP\_USE\_TEXTCTRL), it's a good idea to put a limit
ec376c8f
VZ
144to the maximum font size when huge fonts do not make much sense.
145
146
147
148
149%% wxFontPickerEvent documentation
150
151\section{\class{wxFontPickerEvent}}\label{wxfontpickerevent}
152
153This event class is used for the events generated by
154\helpref{wxFontPickerCtrl}{wxfontpickerctrl}.
155
156\wxheading{Derived from}
157
158\helpref{wxCommandEvent}{wxcommandevent}\\
159\helpref{wxEvent}{wxevent}\\
160\helpref{wxObject}{wxobject}
161
162\wxheading{Include files}
163
aaa6f9ba 164<wx/fontpicker.h>
ec376c8f
VZ
165
166\wxheading{Event handling}
167
168To process input from a wxFontPickerCtrl, use one of these event handler macros to
169direct input to member function that take a
170\helpref{wxFontPickerEvent}{wxfontpickerevent} argument:
171
172\twocolwidtha{7cm}
173\begin{twocollist}
174\twocolitem{{\bf EVT\_FONTPICKER\_CHANGED(id, func)}}{Generated whenever the selected font changes.}
175\end{twocollist}%
176
177
178\wxheading{See also}
179
180\helpref{wxFontPickerCtrl}{wxfontpickerctrl}
181
182\latexignore{\rtfignore{\wxheading{Members}}}
183
184\membersection{wxFontPickerEvent::wxFontPickerEvent}\label{wxfontpickereventctor}
185
186\func{}{wxFontPickerEvent}{\param{wxObject *}{ generator}, \param{int}{ id}, \param{const wxFont\&}{ font}}
187
188The constructor is not normally used by the user code.
189
190
191\membersection{wxFontPickerEvent::GetFont}\label{wxfontpickereventgetfont}
192
193\constfunc{wxFont}{GetFont}{\void}
194
195Retrieve the font the user has just selected.
196
197
198\membersection{wxFontPickerEvent::SetFont}\label{wxfontpickereventsetfont}
199
200\func{void}{SetFont}{\param{const wxFont \&}{ f}}
201
202Set the font associated with the event.
b67a86d5 203