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
}\\
11 \helpref{wxControl
}{wxcontrol
}\\
12 \helpref{wxWindow
}{wxwindow
}\\
13 \helpref{wxEvtHandler
}{wxevthandler
}\\
14 \helpref{wxObject
}{wxobject
}
16 \wxheading{Include files
}
18 <wx/richtext/richtextstyles.h>
22 \helpref{wxRichtext
}{librarieslist
}
26 \helpref{wxRichTextStyleListBox
}{wxrichtextstylelistbox
},
\helpref{wxRichTextCtrl overview
}{wxrichtextctrloverview
}
28 \latexignore{\rtfignore{\wxheading{Members
}}}
30 \membersection{wxRichTextStyleComboCtrl::wxRichTextStyleComboCtrl
}\label{wxrichtextstylecomboctrlwxrichtextstylecomboctrl
}
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}}
36 \membersection{wxRichTextStyleComboCtrl::
\destruct{wxRichTextStyleComboCtrl
}}\label{wxrichtextstylecomboctrldtor
}
38 \func{}{\destruct{wxRichTextStyleComboCtrl
}}{\void}
42 \membersection{wxRichTextStyleComboCtrl::GetRichTextCtrl
}\label{wxrichtextstylecomboctrlgetrichtextctrl
}
44 \constfunc{wxRichTextCtrl*
}{GetRichTextCtrl
}{\void}
46 Returns the
\helpref{wxRichTextCtrl
}{wxrichtextctrl
} associated with this control.
48 \membersection{wxRichTextStyleComboCtrl::GetStyleSheet
}\label{wxrichtextstylecomboctrlgetstylesheet
}
50 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
52 Returns the style sheet associated with this control.
54 \membersection{wxRichTextStyleComboCtrl::SetRichTextCtrl
}\label{wxrichtextstylecomboctrlsetrichtextctrl
}
56 \func{void
}{SetRichTextCtrl
}{\param{wxRichTextCtrl*
}{ctrl
}}
58 Associates the control with a
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}.
60 \membersection{wxRichTextStyleComboCtrl::SetStyleSheet
}\label{wxrichtextstylecomboctrlsetstylesheet
}
62 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
64 Associates the control with a style sheet.
66 \membersection{wxRichTextStyleComboCtrl::UpdateStyles
}\label{wxrichtextstylecomboctrlupdatestyles
}
68 \func{void
}{UpdateStyles
}{\void}
70 Updates the combo control from the associated style sheet.
73 \section{\class{wxRichTextStyleListBox
}}\label{wxrichtextstylelistbox
}
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
}.
78 See
{\tt samples/richtext
} for an example of how to use it.
80 \wxheading{Derived from
}
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
}
90 \wxheading{Include files
}
92 <wx/richtext/richtextstyles.h>
96 \helpref{wxRichtext
}{librarieslist
}
100 \helpref{wxRichTextStyleComboCtrl
}{wxrichtextstylecomboctrl
},
\helpref{wxRichTextCtrl overview
}{wxrichtextctrloverview
}
102 \latexignore{\rtfignore{\wxheading{Members
}}}
104 \membersection{wxRichTextStyleListBox::wxRichTextStyleListBox
}\label{wxrichtextstylelistboxwxrichtextstylelistbox
}
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}}
110 \membersection{wxRichTextStyleListBox::
\destruct{wxRichTextStyleListBox
}}\label{wxrichtextstylelistboxdtor
}
112 \func{}{\destruct{wxRichTextStyleListBox
}}{\void}
116 \membersection{wxRichTextStyleListBox::ApplyStyle
}\label{wxrichtextstylelistboxapplystyle
}
118 \func{void
}{ApplyStyle
}{\param{int
}{i
}}
120 Applies the
{\it i
}th style to the associated rich text control.
122 \membersection{wxRichTextStyleListBox::ConvertTenthsMMToPixels
}\label{wxrichtextstylelistboxconverttenthsmmtopixels
}
124 \constfunc{int
}{ConvertTenthsMMToPixels
}{\param{wxDC\&
}{dc
},
\param{int
}{units
}}
126 Converts units in tenths of a millimetre to device units.
128 \membersection{wxRichTextStyleListBox::CreateHTML
}\label{wxrichtextstylelistboxcreatehtml
}
130 \constfunc{wxString
}{CreateHTML
}{\param{wxRichTextStyleDefinition*
}{def
}}
132 Creates a suitable HTML fragment for a definition.
134 \membersection{wxRichTextStyleListBox::GetApplyOnSelection
}\label{wxrichtextstylelistboxgetapplyonselection
}
136 \constfunc{bool
}{GetApplyOnSelection
}{\void}
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.
141 \membersection{wxRichTextStyleListBox::GetRichTextCtrl
}\label{wxrichtextstylelistboxgetrichtextctrl
}
143 \constfunc{wxRichTextCtrl*
}{GetRichTextCtrl
}{\void}
145 Returns the
\helpref{wxRichTextCtrl
}{wxrichtextctrl
} associated with this listbox.
147 \membersection{wxRichTextStyleListBox::GetStyle
}\label{wxrichtextstylelistboxgetstyle
}
149 \constfunc{wxRichTextStyleDefinition*
}{GetStyle
}{\param{size
\_t }{i
}}
151 Gets a style for a listbox index.
153 \membersection{wxRichTextStyleListBox::GetStyleSheet
}\label{wxrichtextstylelistboxgetstylesheet
}
155 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
157 Returns the style sheet associated with this listbox.
159 \membersection{wxRichTextStyleListBox::GetStyleType
}\label{wxrichtextstylelistboxgetstyletype
}
161 \constfunc{wxRichTextStyleListBox::wxRichTextStyleType
}{GetStyleType
}{\void}
163 Returns the type of style to show in the list box.
165 \membersection{wxRichTextStyleListBox::OnGetItem
}\label{wxrichtextstylelistboxongetitem
}
167 \constfunc{wxString
}{OnGetItem
}{\param{size
\_t }{n
}}
169 Returns the HTML for this item.
171 \membersection{wxRichTextStyleListBox::OnLeftDown
}\label{wxrichtextstylelistboxonleftdown
}
173 \func{void
}{OnLeftDown
}{\param{wxMouseEvent\&
}{event
}}
175 Implements left click behaviour, applying the clicked style to the wxRichTextCtrl.
177 \membersection{wxRichTextStyleListBox::OnSelect
}\label{wxrichtextstylelistboxonselect
}
179 \func{void
}{OnSelect
}{\param{wxCommandEvent\&
}{event
}}
183 \membersection{wxRichTextStyleListBox::SetApplyOnSelection
}\label{wxrichtextstylelistboxsetapplyonselection
}
185 \func{void
}{SetApplyOnSelection
}{\param{bool
}{applyOnSelection
}}
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.
190 \membersection{wxRichTextStyleListBox::SetRichTextCtrl
}\label{wxrichtextstylelistboxsetrichtextctrl
}
192 \func{void
}{SetRichTextCtrl
}{\param{wxRichTextCtrl*
}{ctrl
}}
194 Associates the listbox with a
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}.
196 \membersection{wxRichTextStyleListBox::SetStyleSheet
}\label{wxrichtextstylelistboxsetstylesheet
}
198 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
200 Associates the control with a style sheet.
202 \membersection{wxRichTextStyleListBox::SetStyleType
}\label{wxrichtextstylelistboxsetstyletype
}
204 \func{void
}{SetStyleType
}{\param{wxRichTextStyleListBox::wxRichTextStyleType
}{styleType
}}
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.
209 \membersection{wxRichTextStyleListBox::UpdateStyles
}\label{wxrichtextstylelistboxupdatestyles
}
211 \func{void
}{UpdateStyles
}{\void}
213 Updates the list from the associated style sheet.
216 \section{\class{wxRichTextStyleListCtrl
}}\label{wxrichtextstylelistctrl
}
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
}.
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.
229 \wxheading{Window styles
}
232 \begin{twocollist
}\itemsep=
0pt
233 \twocolitem{\windowstyle{wxRICHTEXTSTYLELIST
\_HIDE\_TYPE\_SELECTOR}}{This style hides the category selection control.
}
236 \wxheading{Derived from
}
238 \helpref{wxControl
}{wxcontrol
}\\
239 \helpref{wxWindow
}{wxwindow
}\\
240 \helpref{wxEvtHandler
}{wxevthandler
}\\
241 \helpref{wxObject
}{wxobject
}
243 \wxheading{Include files
}
245 <wx/richtext/richtextstyles.h>
249 \helpref{wxRichtext
}{librarieslist
}
251 \wxheading{Data structures
}
253 \latexignore{\rtfignore{\wxheading{Members
}}}
255 \membersection{wxRichTextStyleListCtrl::wxRichTextStyleListCtrl
}\label{wxrichtextstylelistctrlwxrichtextstylelistctrl
}
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}}
259 \func{}{wxRichTextStyleListCtrl
}{\void}
263 \membersection{wxRichTextStyleListCtrl::Create
}\label{wxrichtextstylelistctrlcreate
}
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}}
269 \membersection{wxRichTextStyleListCtrl::GetRichTextCtrl
}\label{wxrichtextstylelistctrlgetrichtextctrl
}
271 \constfunc{wxRichTextCtrl*
}{GetRichTextCtrl
}{\void}
273 Returns the associated rich text control, if any.
275 \membersection{wxRichTextStyleListCtrl::GetStyleChoice
}\label{wxrichtextstylelistctrlgetstylechoice
}
277 \constfunc{wxChoice*
}{GetStyleChoice
}{\void}
279 Returns the wxChoice control used for selecting the style category.
281 \membersection{wxRichTextStyleListCtrl::GetStyleListBox
}\label{wxrichtextstylelistctrlgetstylelistbox
}
283 \constfunc{wxRichTextStyleListBox*
}{GetStyleListBox
}{\void}
285 Returns the wxListBox control used to view the style list.
287 \membersection{wxRichTextStyleListCtrl::GetStyleSheet
}\label{wxrichtextstylelistctrlgetstylesheet
}
289 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
291 Returns the associated style sheet, if any.
293 \membersection{wxRichTextStyleListCtrl::GetStyleType
}\label{wxrichtextstylelistctrlgetstyletype
}
295 \constfunc{wxRichTextStyleListBox::wxRichTextStyleType
}{GetStyleType
}{\void}
297 Returns the type of style to show in the list box.
299 \membersection{wxRichTextStyleListCtrl::SetRichTextCtrl
}\label{wxrichtextstylelistctrlsetrichtextctrl
}
301 \func{void
}{SetRichTextCtrl
}{\param{wxRichTextCtrl*
}{ctrl
}}
303 Associates the control with a wxRichTextCtrl.
305 \membersection{wxRichTextStyleListCtrl::SetStyleSheet
}\label{wxrichtextstylelistctrlsetstylesheet
}
307 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
309 Associates the control with a style sheet.
311 \membersection{wxRichTextStyleListCtrl::SetStyleType
}\label{wxrichtextstylelistctrlsetstyletype
}
313 \func{void
}{SetStyleType
}{\param{wxRichTextStyleListBox::wxRichTextStyleType
}{styleType
}}
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.
318 \membersection{wxRichTextStyleListCtrl::UpdateStyles
}\label{wxrichtextstylelistctrlupdatestyles
}
320 \func{void
}{UpdateStyles
}{\void}
322 Updates the style list box.