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