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