]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/richtextstylelistbox.tex
Added wxDataViewModel::GetChildren() (removed GetSibling() and GetFirstChild())
[wxWidgets.git] / docs / latex / wx / richtextstylelistbox.tex
1 \section{\class{wxRichTextStyleComboCtrl}}\label{wxrichtextstylecomboctrl}
2
3 This is a combo control that can display the styles in a \helpref{wxRichTextStyleSheet}{wxrichtextstylesheet},
4 and apply the selection to an associated \helpref{wxRichTextCtrl}{wxrichtextctrl}.
5
6 See {\tt samples/richtext} for an example of how to use it.
7
8 \wxheading{Derived from}
9
10 \helpref{wxComboCtrl}{wxcomboctrl}\\
11 \helpref{wxControl}{wxcontrol}\\
12 \helpref{wxWindow}{wxwindow}\\
13 \helpref{wxEvtHandler}{wxevthandler}\\
14 \helpref{wxObject}{wxobject}
15
16 \wxheading{Include files}
17
18 <wx/richtext/richtextstyles.h>
19
20 \wxheading{Library}
21
22 \helpref{wxRichtext}{librarieslist}
23
24 \wxheading{See also}
25
26 \helpref{wxRichTextStyleListBox}{wxrichtextstylelistbox}, \helpref{wxRichTextCtrl overview}{wxrichtextctrloverview}
27
28 \latexignore{\rtfignore{\wxheading{Members}}}
29
30 \membersection{wxRichTextStyleComboCtrl::wxRichTextStyleComboCtrl}\label{wxrichtextstylecomboctrlwxrichtextstylecomboctrl}
31
32 \func{}{wxRichTextStyleComboCtrl}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}}
33
34 Constructor.
35
36 \membersection{wxRichTextStyleComboCtrl::\destruct{wxRichTextStyleComboCtrl}}\label{wxrichtextstylecomboctrldtor}
37
38 \func{}{\destruct{wxRichTextStyleComboCtrl}}{\void}
39
40 Destructor.
41
42 \membersection{wxRichTextStyleComboCtrl::GetRichTextCtrl}\label{wxrichtextstylecomboctrlgetrichtextctrl}
43
44 \constfunc{wxRichTextCtrl*}{GetRichTextCtrl}{\void}
45
46 Returns the \helpref{wxRichTextCtrl}{wxrichtextctrl} associated with this control.
47
48 \membersection{wxRichTextStyleComboCtrl::GetStyleSheet}\label{wxrichtextstylecomboctrlgetstylesheet}
49
50 \constfunc{wxRichTextStyleSheet*}{GetStyleSheet}{\void}
51
52 Returns the style sheet associated with this control.
53
54 \membersection{wxRichTextStyleComboCtrl::SetRichTextCtrl}\label{wxrichtextstylecomboctrlsetrichtextctrl}
55
56 \func{void}{SetRichTextCtrl}{\param{wxRichTextCtrl* }{ctrl}}
57
58 Associates the control with a \helpref{wxRichTextCtrl}{wxrichtextctrl}.
59
60 \membersection{wxRichTextStyleComboCtrl::SetStyleSheet}\label{wxrichtextstylecomboctrlsetstylesheet}
61
62 \func{void}{SetStyleSheet}{\param{wxRichTextStyleSheet* }{styleSheet}}
63
64 Associates the control with a style sheet.
65
66 \membersection{wxRichTextStyleComboCtrl::UpdateStyles}\label{wxrichtextstylecomboctrlupdatestyles}
67
68 \func{void}{UpdateStyles}{\void}
69
70 Updates the combo control from the associated style sheet.
71
72
73 \section{\class{wxRichTextStyleListBox}}\label{wxrichtextstylelistbox}
74
75 This is a listbox that can display the styles in a \helpref{wxRichTextStyleSheet}{wxrichtextstylesheet},
76 and apply the selection to an associated \helpref{wxRichTextCtrl}{wxrichtextctrl}.
77
78 See {\tt samples/richtext} for an example of how to use it.
79
80 \wxheading{Derived from}
81
82 \helpref{wxHtmlListBox}{wxhtmllistbox}\\
83 \helpref{wxVListBox}{wxvlistbox}\\
84 \helpref{wxVScrolledWindow}{wxvscrolledwindow}\\
85 \helpref{wxPanel}{wxpanel}\\
86 \helpref{wxWindow}{wxwindow}\\
87 \helpref{wxEvtHandler}{wxevthandler}\\
88 \helpref{wxObject}{wxobject}
89
90 \wxheading{Include files}
91
92 <wx/richtext/richtextstyles.h>
93
94 \wxheading{Library}
95
96 \helpref{wxRichtext}{librarieslist}
97
98 \wxheading{See also}
99
100 \helpref{wxRichTextStyleComboCtrl}{wxrichtextstylecomboctrl}, \helpref{wxRichTextCtrl overview}{wxrichtextctrloverview}
101
102 \latexignore{\rtfignore{\wxheading{Members}}}
103
104 \membersection{wxRichTextStyleListBox::wxRichTextStyleListBox}\label{wxrichtextstylelistboxwxrichtextstylelistbox}
105
106 \func{}{wxRichTextStyleListBox}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}}
107
108 Constructor.
109
110 \membersection{wxRichTextStyleListBox::\destruct{wxRichTextStyleListBox}}\label{wxrichtextstylelistboxdtor}
111
112 \func{}{\destruct{wxRichTextStyleListBox}}{\void}
113
114 Destructor.
115
116 \membersection{wxRichTextStyleListBox::ApplyStyle}\label{wxrichtextstylelistboxapplystyle}
117
118 \func{void}{ApplyStyle}{\param{int }{i}}
119
120 Applies the {\it i}th style to the associated rich text control.
121
122 \membersection{wxRichTextStyleListBox::ConvertTenthsMMToPixels}\label{wxrichtextstylelistboxconverttenthsmmtopixels}
123
124 \constfunc{int}{ConvertTenthsMMToPixels}{\param{wxDC\& }{dc}, \param{int }{units}}
125
126 Converts units in tenths of a millimetre to device units.
127
128 \membersection{wxRichTextStyleListBox::CreateHTML}\label{wxrichtextstylelistboxcreatehtml}
129
130 \constfunc{wxString}{CreateHTML}{\param{wxRichTextStyleDefinition* }{def}}
131
132 Creates a suitable HTML fragment for a definition.
133
134 \membersection{wxRichTextStyleListBox::GetApplyOnSelection}\label{wxrichtextstylelistboxgetapplyonselection}
135
136 \constfunc{bool}{GetApplyOnSelection}{\void}
137
138 If the return value is \true, clicking on a style name in the list will immediately
139 apply the style to the associated rich text control.
140
141 \membersection{wxRichTextStyleListBox::GetRichTextCtrl}\label{wxrichtextstylelistboxgetrichtextctrl}
142
143 \constfunc{wxRichTextCtrl*}{GetRichTextCtrl}{\void}
144
145 Returns the \helpref{wxRichTextCtrl}{wxrichtextctrl} associated with this listbox.
146
147 \membersection{wxRichTextStyleListBox::GetStyle}\label{wxrichtextstylelistboxgetstyle}
148
149 \constfunc{wxRichTextStyleDefinition*}{GetStyle}{\param{size\_t }{i}}
150
151 Gets a style for a listbox index.
152
153 \membersection{wxRichTextStyleListBox::GetStyleSheet}\label{wxrichtextstylelistboxgetstylesheet}
154
155 \constfunc{wxRichTextStyleSheet*}{GetStyleSheet}{\void}
156
157 Returns the style sheet associated with this listbox.
158
159 \membersection{wxRichTextStyleListBox::GetStyleType}\label{wxrichtextstylelistboxgetstyletype}
160
161 \constfunc{wxRichTextStyleListBox::wxRichTextStyleType}{GetStyleType}{\void}
162
163 Returns the type of style to show in the list box.
164
165 \membersection{wxRichTextStyleListBox::OnGetItem}\label{wxrichtextstylelistboxongetitem}
166
167 \constfunc{wxString}{OnGetItem}{\param{size\_t }{n}}
168
169 Returns the HTML for this item.
170
171 \membersection{wxRichTextStyleListBox::OnLeftDown}\label{wxrichtextstylelistboxonleftdown}
172
173 \func{void}{OnLeftDown}{\param{wxMouseEvent\& }{event}}
174
175 Implements left click behaviour, applying the clicked style to the wxRichTextCtrl.
176
177 \membersection{wxRichTextStyleListBox::OnSelect}\label{wxrichtextstylelistboxonselect}
178
179 \func{void}{OnSelect}{\param{wxCommandEvent\& }{event}}
180
181 Reacts to selection.
182
183 \membersection{wxRichTextStyleListBox::SetApplyOnSelection}\label{wxrichtextstylelistboxsetapplyonselection}
184
185 \func{void}{SetApplyOnSelection}{\param{bool }{applyOnSelection}}
186
187 If {\it applyOnSelection} is \true, clicking on a style name in the list will immediately
188 apply the style to the associated rich text control.
189
190 \membersection{wxRichTextStyleListBox::SetRichTextCtrl}\label{wxrichtextstylelistboxsetrichtextctrl}
191
192 \func{void}{SetRichTextCtrl}{\param{wxRichTextCtrl* }{ctrl}}
193
194 Associates the listbox with a \helpref{wxRichTextCtrl}{wxrichtextctrl}.
195
196 \membersection{wxRichTextStyleListBox::SetStyleSheet}\label{wxrichtextstylelistboxsetstylesheet}
197
198 \func{void}{SetStyleSheet}{\param{wxRichTextStyleSheet* }{styleSheet}}
199
200 Associates the control with a style sheet.
201
202 \membersection{wxRichTextStyleListBox::SetStyleType}\label{wxrichtextstylelistboxsetstyletype}
203
204 \func{void}{SetStyleType}{\param{wxRichTextStyleListBox::wxRichTextStyleType }{styleType}}
205
206 Sets the style type to display. One of wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_ALL, wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_PARAGRAPH,
207 wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_CHARACTER and wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_LIST.
208
209 \membersection{wxRichTextStyleListBox::UpdateStyles}\label{wxrichtextstylelistboxupdatestyles}
210
211 \func{void}{UpdateStyles}{\void}
212
213 Updates the list from the associated style sheet.
214
215
216 \section{\class{wxRichTextStyleListCtrl}}\label{wxrichtextstylelistctrl}
217
218 This class incorporates a \helpref{wxRichTextStyleListBox}{wxrichtextstylelistbox} and
219 a choice control that allows the user to select the category of style to view.
220 It is demonstrated in the wxRichTextCtrl sample in {\tt samples/richtext}.
221
222 To use wxRichTextStyleListCtrl, add the control to your window hierarchy and
223 call \helpref{SetStyleType}{wxrichtextstylelistctrlsetstyletype} with
224 one of wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_ALL, wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_PARAGRAPH,
225 wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_CHARACTER and wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_LIST to set the current view.
226 Associate the control with a style sheet and rich text control with SetStyleSheet and SetRichTextCtrl,
227 so that when a style is double-clicked, it is applied to the selection.
228
229 \wxheading{Window styles}
230
231 \twocolwidtha{5cm}
232 \begin{twocollist}\itemsep=0pt
233 \twocolitem{\windowstyle{wxRICHTEXTSTYLELIST\_HIDE\_TYPE\_SELECTOR}}{This style hides the category selection control.}
234 \end{twocollist}
235
236 \wxheading{Derived from}
237
238 \helpref{wxControl}{wxcontrol}\\
239 \helpref{wxWindow}{wxwindow}\\
240 \helpref{wxEvtHandler}{wxevthandler}\\
241 \helpref{wxObject}{wxobject}
242
243 \wxheading{Include files}
244
245 <wx/richtext/richtextstyles.h>
246
247 \wxheading{Library}
248
249 \helpref{wxRichtext}{librarieslist}
250
251 \wxheading{Data structures}
252
253 \latexignore{\rtfignore{\wxheading{Members}}}
254
255 \membersection{wxRichTextStyleListCtrl::wxRichTextStyleListCtrl}\label{wxrichtextstylelistctrlwxrichtextstylelistctrl}
256
257 \func{}{wxRichTextStyleListCtrl}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}}
258
259 \func{}{wxRichTextStyleListCtrl}{\void}
260
261 Constructors.
262
263 \membersection{wxRichTextStyleListCtrl::Create}\label{wxrichtextstylelistctrlcreate}
264
265 \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}}
266
267 Creates the windows.
268
269 \membersection{wxRichTextStyleListCtrl::GetRichTextCtrl}\label{wxrichtextstylelistctrlgetrichtextctrl}
270
271 \constfunc{wxRichTextCtrl*}{GetRichTextCtrl}{\void}
272
273 Returns the associated rich text control, if any.
274
275 \membersection{wxRichTextStyleListCtrl::GetStyleChoice}\label{wxrichtextstylelistctrlgetstylechoice}
276
277 \constfunc{wxChoice*}{GetStyleChoice}{\void}
278
279 Returns the wxChoice control used for selecting the style category.
280
281 \membersection{wxRichTextStyleListCtrl::GetStyleListBox}\label{wxrichtextstylelistctrlgetstylelistbox}
282
283 \constfunc{wxRichTextStyleListBox*}{GetStyleListBox}{\void}
284
285 Returns the wxListBox control used to view the style list.
286
287 \membersection{wxRichTextStyleListCtrl::GetStyleSheet}\label{wxrichtextstylelistctrlgetstylesheet}
288
289 \constfunc{wxRichTextStyleSheet*}{GetStyleSheet}{\void}
290
291 Returns the associated style sheet, if any.
292
293 \membersection{wxRichTextStyleListCtrl::GetStyleType}\label{wxrichtextstylelistctrlgetstyletype}
294
295 \constfunc{wxRichTextStyleListBox::wxRichTextStyleType}{GetStyleType}{\void}
296
297 Returns the type of style to show in the list box.
298
299 \membersection{wxRichTextStyleListCtrl::SetRichTextCtrl}\label{wxrichtextstylelistctrlsetrichtextctrl}
300
301 \func{void}{SetRichTextCtrl}{\param{wxRichTextCtrl* }{ctrl}}
302
303 Associates the control with a wxRichTextCtrl.
304
305 \membersection{wxRichTextStyleListCtrl::SetStyleSheet}\label{wxrichtextstylelistctrlsetstylesheet}
306
307 \func{void}{SetStyleSheet}{\param{wxRichTextStyleSheet* }{styleSheet}}
308
309 Associates the control with a style sheet.
310
311 \membersection{wxRichTextStyleListCtrl::SetStyleType}\label{wxrichtextstylelistctrlsetstyletype}
312
313 \func{void}{SetStyleType}{\param{wxRichTextStyleListBox::wxRichTextStyleType }{styleType}}
314
315 Sets the style type to display. One of wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_ALL, wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_PARAGRAPH,
316 wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_CHARACTER and wxRichTextStyleListBox::wxRICHTEXT\_STYLE\_LIST.
317
318 \membersection{wxRichTextStyleListCtrl::UpdateStyles}\label{wxrichtextstylelistctrlupdatestyles}
319
320 \func{void}{UpdateStyles}{\void}
321
322 Updates the style list box.
323