1 \section{\class{wxRichTextStyleComboCtrl
}}\label{wxrichtextstylecomboctrl
}
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
}.
6 See
{\tt samples/richtext
} for an example of how to use it.
8 \wxheading{Derived from
}
10 \helpref{wxComboCtrl
}{wxcomboctrl
}
12 \wxheading{Include files
}
14 <wx/richtext/richtextstyles.h>
18 \helpref{wxRichtext
}{librarieslist
}
22 \helpref{wxRichTextStyleListBox
}{wxrichtextstylelistbox
},
\helpref{wxRichTextCtrl overview
}{wxrichtextctrloverview
}
24 \latexignore{\rtfignore{\wxheading{Members
}}}
26 \membersection{wxRichTextStyleComboCtrl::wxRichTextStyleComboCtrl
}\label{wxrichtextstylecomboctrlwxrichtextstylecomboctrl
}
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}}
32 \membersection{wxRichTextStyleComboCtrl::
\destruct{wxRichTextStyleComboCtrl
}}\label{wxrichtextstylecomboctrldtor
}
34 \func{}{\destruct{wxRichTextStyleComboCtrl
}}{\void}
38 \membersection{wxRichTextStyleComboCtrl::GetRichTextCtrl
}\label{wxrichtextstylecomboctrlgetrichtextctrl
}
40 \constfunc{wxRichTextCtrl*
}{GetRichTextCtrl
}{\void}
42 Returns the
\helpref{wxRichTextCtrl
}{wxrichtextctrl
} associated with this control.
44 \membersection{wxRichTextStyleComboCtrl::GetStyleSheet
}\label{wxrichtextstylecomboctrlgetstylesheet
}
46 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
48 Returns the style sheet associated with this control.
50 \membersection{wxRichTextStyleComboCtrl::SetRichTextCtrl
}\label{wxrichtextstylecomboctrlsetrichtextctrl
}
52 \func{void
}{SetRichTextCtrl
}{\param{wxRichTextCtrl*
}{ctrl
}}
54 Associates the control with a
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}.
56 \membersection{wxRichTextStyleComboCtrl::SetStyleSheet
}\label{wxrichtextstylecomboctrlsetstylesheet
}
58 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
60 Associates the control with a style sheet.
62 \membersection{wxRichTextStyleComboCtrl::UpdateStyles
}\label{wxrichtextstylecomboctrlupdatestyles
}
64 \func{void
}{UpdateStyles
}{\void}
66 Updates the combo control from the associated style sheet.
69 \section{\class{wxRichTextStyleListBox
}}\label{wxrichtextstylelistbox
}
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
}.
74 See
{\tt samples/richtext
} for an example of how to use it.
76 \wxheading{Derived from
}
78 \helpref{wxHtmlListBox
}{wxhtmllistbox
}
80 \wxheading{Include files
}
82 <wx/richtext/richtextstyles.h>
86 \helpref{wxRichtext
}{librarieslist
}
90 \helpref{wxRichTextStyleComboCtrl
}{wxrichtextstylecomboctrl
},
\helpref{wxRichTextCtrl overview
}{wxrichtextctrloverview
}
92 \latexignore{\rtfignore{\wxheading{Members
}}}
94 \membersection{wxRichTextStyleListBox::wxRichTextStyleListBox
}\label{wxrichtextstylelistboxwxrichtextstylelistbox
}
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}}
100 \membersection{wxRichTextStyleListBox::
\destruct{wxRichTextStyleListBox
}}\label{wxrichtextstylelistboxdtor
}
102 \func{}{\destruct{wxRichTextStyleListBox
}}{\void}
106 \membersection{wxRichTextStyleListBox::ApplyStyle
}\label{wxrichtextstylelistboxapplystyle
}
108 \func{void
}{ApplyStyle
}{\param{int
}{i
}}
110 Applies the
{\it i
}th style to the associated rich text control.
112 \membersection{wxRichTextStyleListBox::ConvertTenthsMMToPixels
}\label{wxrichtextstylelistboxconverttenthsmmtopixels
}
114 \constfunc{int
}{ConvertTenthsMMToPixels
}{\param{wxDC\&
}{dc
},
\param{int
}{units
}}
116 Converts units in tenths of a millimetre to device units.
118 \membersection{wxRichTextStyleListBox::CreateHTML
}\label{wxrichtextstylelistboxcreatehtml
}
120 \constfunc{wxString
}{CreateHTML
}{\param{wxRichTextStyleDefinition*
}{def
}}
122 Creates a suitable HTML fragment for a definition.
124 \membersection{wxRichTextStyleListBox::GetApplyOnSelection
}\label{wxrichtextstylelistboxgetapplyonselection
}
126 \constfunc{bool
}{GetApplyOnSelection
}{\void}
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.
131 \membersection{wxRichTextStyleListBox::GetRichTextCtrl
}\label{wxrichtextstylelistboxgetrichtextctrl
}
133 \constfunc{wxRichTextCtrl*
}{GetRichTextCtrl
}{\void}
135 Returns the
\helpref{wxRichTextCtrl
}{wxrichtextctrl
} associated with this listbox.
137 \membersection{wxRichTextStyleListBox::GetStyle
}\label{wxrichtextstylelistboxgetstyle
}
139 \constfunc{wxRichTextStyleDefinition*
}{GetStyle
}{\param{size
\_t }{i
}}
141 Gets a style for a listbox index.
143 \membersection{wxRichTextStyleListBox::GetStyleSheet
}\label{wxrichtextstylelistboxgetstylesheet
}
145 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
147 Returns the style sheet associated with this listbox.
149 \membersection{wxRichTextStyleListBox::GetStyleType
}\label{wxrichtextstylelistboxgetstyletype
}
151 \constfunc{wxRichTextStyleListBox::wxRichTextStyleType
}{GetStyleType
}{\void}
153 Returns the type of style to show in the list box.
155 \membersection{wxRichTextStyleListBox::OnGetItem
}\label{wxrichtextstylelistboxongetitem
}
157 \constfunc{wxString
}{OnGetItem
}{\param{size
\_t }{n
}}
159 Returns the HTML for this item.
161 \membersection{wxRichTextStyleListBox::OnLeftDown
}\label{wxrichtextstylelistboxonleftdown
}
163 \func{void
}{OnLeftDown
}{\param{wxMouseEvent\&
}{event
}}
165 Implements left click behaviour, applying the clicked style to the wxRichTextCtrl.
167 \membersection{wxRichTextStyleListBox::OnSelect
}\label{wxrichtextstylelistboxonselect
}
169 \func{void
}{OnSelect
}{\param{wxCommandEvent\&
}{event
}}
173 \membersection{wxRichTextStyleListBox::SetApplyOnSelection
}\label{wxrichtextstylelistboxsetapplyonselection
}
175 \func{void
}{SetApplyOnSelection
}{\param{bool
}{applyOnSelection
}}
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.
180 \membersection{wxRichTextStyleListBox::SetRichTextCtrl
}\label{wxrichtextstylelistboxsetrichtextctrl
}
182 \func{void
}{SetRichTextCtrl
}{\param{wxRichTextCtrl*
}{ctrl
}}
184 Associates the listbox with a
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}.
186 \membersection{wxRichTextStyleListBox::SetStyleSheet
}\label{wxrichtextstylelistboxsetstylesheet
}
188 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
190 Associates the control with a style sheet.
192 \membersection{wxRichTextStyleListBox::SetStyleType
}\label{wxrichtextstylelistboxsetstyletype
}
194 \func{void
}{SetStyleType
}{\param{wxRichTextStyleListBox::wxRichTextStyleType
}{styleType
}}
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.
199 \membersection{wxRichTextStyleListBox::UpdateStyles
}\label{wxrichtextstylelistboxupdatestyles
}
201 \func{void
}{UpdateStyles
}{\void}
203 Updates the list from the associated style sheet.
206 \section{\class{wxRichTextStyleListCtrl
}}\label{wxrichtextstylelistctrl
}
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
}.
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.
219 \wxheading{Window styles
}
222 \begin{twocollist
}\itemsep=
0pt
223 \twocolitem{\windowstyle{wxRICHTEXTSTYLELIST
\_HIDE\_TYPE\_SELECTOR}}{This style hides the category selection control.
}
226 \wxheading{Derived from
}
228 \helpref{wxControl
}{wxcontrol
}
230 \wxheading{Include files
}
232 <wx/richtext/richtextstyles.h>
236 \helpref{wxRichtext
}{librarieslist
}
238 \wxheading{Data structures
}
240 \latexignore{\rtfignore{\wxheading{Members
}}}
242 \membersection{wxRichTextStyleListCtrl::wxRichTextStyleListCtrl
}\label{wxrichtextstylelistctrlwxrichtextstylelistctrl
}
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}}
246 \func{}{wxRichTextStyleListCtrl
}{\void}
250 \membersection{wxRichTextStyleListCtrl::Create
}\label{wxrichtextstylelistctrlcreate
}
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}}
256 \membersection{wxRichTextStyleListCtrl::GetRichTextCtrl
}\label{wxrichtextstylelistctrlgetrichtextctrl
}
258 \constfunc{wxRichTextCtrl*
}{GetRichTextCtrl
}{\void}
260 Returns the associated rich text control, if any.
262 \membersection{wxRichTextStyleListCtrl::GetStyleChoice
}\label{wxrichtextstylelistctrlgetstylechoice
}
264 \constfunc{wxChoice*
}{GetStyleChoice
}{\void}
266 Returns the wxChoice control used for selecting the style category.
268 \membersection{wxRichTextStyleListCtrl::GetStyleListBox
}\label{wxrichtextstylelistctrlgetstylelistbox
}
270 \constfunc{wxRichTextStyleListBox*
}{GetStyleListBox
}{\void}
272 Returns the wxListBox control used to view the style list.
274 \membersection{wxRichTextStyleListCtrl::GetStyleSheet
}\label{wxrichtextstylelistctrlgetstylesheet
}
276 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
278 Returns the associated style sheet, if any.
280 \membersection{wxRichTextStyleListCtrl::GetStyleType
}\label{wxrichtextstylelistctrlgetstyletype
}
282 \constfunc{wxRichTextStyleListBox::wxRichTextStyleType
}{GetStyleType
}{\void}
284 Returns the type of style to show in the list box.
286 \membersection{wxRichTextStyleListCtrl::SetRichTextCtrl
}\label{wxrichtextstylelistctrlsetrichtextctrl
}
288 \func{void
}{SetRichTextCtrl
}{\param{wxRichTextCtrl*
}{ctrl
}}
290 Associates the control with a wxRichTextCtrl.
292 \membersection{wxRichTextStyleListCtrl::SetStyleSheet
}\label{wxrichtextstylelistctrlsetstylesheet
}
294 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
296 Associates the control with a style sheet.
298 \membersection{wxRichTextStyleListCtrl::SetStyleType
}\label{wxrichtextstylelistctrlsetstyletype
}
300 \func{void
}{SetStyleType
}{\param{wxRichTextStyleListBox::wxRichTextStyleType
}{styleType
}}
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.
305 \membersection{wxRichTextStyleListCtrl::UpdateStyles
}\label{wxrichtextstylelistctrlupdatestyles
}
307 \func{void
}{UpdateStyles
}{\void}
309 Updates the style list box.