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{wxRichTextStyleListBox
}{wxrichtextstylelistbox
},
\helpref{wxRichTextCtrl overview
}{wxrichtextctrloverview
}
20 \latexignore{\rtfignore{\wxheading{Members
}}}
22 \membersection{wxRichTextStyleComboCtrl::wxRichTextStyleComboCtrl
}\label{wxrichtextstylecomboctrlwxrichtextstylecomboctrl
}
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}}
28 \membersection{wxRichTextStyleComboCtrl::
\destruct{wxRichTextStyleComboCtrl
}}\label{wxrichtextstylecomboctrldtor
}
30 \func{}{\destruct{wxRichTextStyleComboCtrl
}}{\void}
34 \membersection{wxRichTextStyleComboCtrl::GetRichTextCtrl
}\label{wxrichtextstylecomboctrlgetrichtextctrl
}
36 \constfunc{wxRichTextCtrl*
}{GetRichTextCtrl
}{\void}
38 Returns the
\helpref{wxRichTextCtrl
}{wxrichtextctrl
} associated with this control.
40 \membersection{wxRichTextStyleComboCtrl::GetStyleSheet
}\label{wxrichtextstylecomboctrlgetstylesheet
}
42 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
44 Returns the style sheet associated with this control.
46 \membersection{wxRichTextStyleComboCtrl::SetRichTextCtrl
}\label{wxrichtextstylecomboctrlsetrichtextctrl
}
48 \func{void
}{SetRichTextCtrl
}{\param{wxRichTextCtrl*
}{ctrl
}}
50 Associates the control with a
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}.
52 \membersection{wxRichTextStyleComboCtrl::SetStyleSheet
}\label{wxrichtextstylecomboctrlsetstylesheet
}
54 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
56 Associates the control with a style sheet.
58 \membersection{wxRichTextStyleComboCtrl::UpdateStyles
}\label{wxrichtextstylecomboctrlupdatestyles
}
60 \func{void
}{UpdateStyles
}{\void}
62 Updates the combo control from the associated style sheet.
65 \section{\class{wxRichTextStyleListBox
}}\label{wxrichtextstylelistbox
}
67 This is a listbox that can display the styles in a
\helpref{wxRichTextStyleSheet
}{wxrichtextstylesheet
},
68 and apply the selection to an associated
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}.
70 See
{\tt samples/richtext
} for an example of how to use it.
72 \wxheading{Derived from
}
74 \helpref{wxHtmlListBox
}{wxhtmllistbox
}
76 \wxheading{Include files
}
78 <wx/richtext/richtextstyles.h>
82 \helpref{wxRichTextStyleComboCtrl
}{wxrichtextstylecomboctrl
},
\helpref{wxRichTextCtrl overview
}{wxrichtextctrloverview
}
84 \latexignore{\rtfignore{\wxheading{Members
}}}
86 \membersection{wxRichTextStyleListBox::wxRichTextStyleListBox
}\label{wxrichtextstylelistboxwxrichtextstylelistbox
}
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}}
92 \membersection{wxRichTextStyleListBox::
\destruct{wxRichTextStyleListBox
}}\label{wxrichtextstylelistboxdtor
}
94 \func{}{\destruct{wxRichTextStyleListBox
}}{\void}
98 \membersection{wxRichTextStyleListBox::ApplyStyle
}\label{wxrichtextstylelistboxapplystyle
}
100 \func{void
}{ApplyStyle
}{\param{int
}{i
}}
102 Applies the
{\it i
}th style to the associated rich text control.
104 \membersection{wxRichTextStyleListBox::ConvertTenthsMMToPixels
}\label{wxrichtextstylelistboxconverttenthsmmtopixels
}
106 \constfunc{int
}{ConvertTenthsMMToPixels
}{\param{wxDC\&
}{dc
},
\param{int
}{units
}}
108 Converts units in tenths of a millimetre to device units.
110 \membersection{wxRichTextStyleListBox::CreateHTML
}\label{wxrichtextstylelistboxcreatehtml
}
112 \constfunc{wxString
}{CreateHTML
}{\param{wxRichTextStyleDefinition*
}{def
}}
114 Creates a suitable HTML fragment for a definition.
116 \membersection{wxRichTextStyleListBox::GetApplyOnSelection
}\label{wxrichtextstylelistboxgetapplyonselection
}
118 \constfunc{bool
}{GetApplyOnSelection
}{\void}
120 If the return value is
\true, clicking on a style name in the list will immediately
121 apply the style to the associated rich text control.
123 \membersection{wxRichTextStyleListBox::GetRichTextCtrl
}\label{wxrichtextstylelistboxgetrichtextctrl
}
125 \constfunc{wxRichTextCtrl*
}{GetRichTextCtrl
}{\void}
127 Returns the
\helpref{wxRichTextCtrl
}{wxrichtextctrl
} associated with this listbox.
129 \membersection{wxRichTextStyleListBox::GetStyle
}\label{wxrichtextstylelistboxgetstyle
}
131 \constfunc{wxRichTextStyleDefinition*
}{GetStyle
}{\param{size
\_t }{i
}}
133 Gets a style for a listbox index.
135 \membersection{wxRichTextStyleListBox::GetStyleSheet
}\label{wxrichtextstylelistboxgetstylesheet
}
137 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
139 Returns the style sheet associated with this listbox.
141 \membersection{wxRichTextStyleListBox::GetStyleType
}\label{wxrichtextstylelistboxgetstyletype
}
143 \constfunc{wxRichTextStyleListBox::wxRichTextStyleType
}{GetStyleType
}{\void}
145 Returns the type of style to show in the list box.
147 \membersection{wxRichTextStyleListBox::OnGetItem
}\label{wxrichtextstylelistboxongetitem
}
149 \constfunc{wxString
}{OnGetItem
}{\param{size
\_t }{n
}}
151 Returns the HTML for this item.
153 \membersection{wxRichTextStyleListBox::OnLeftDown
}\label{wxrichtextstylelistboxonleftdown
}
155 \func{void
}{OnLeftDown
}{\param{wxMouseEvent\&
}{event
}}
157 Implements left click behaviour, applying the clicked style to the wxRichTextCtrl.
159 \membersection{wxRichTextStyleListBox::OnSelect
}\label{wxrichtextstylelistboxonselect
}
161 \func{void
}{OnSelect
}{\param{wxCommandEvent\&
}{event
}}
165 \membersection{wxRichTextStyleListBox::SetApplyOnSelection
}\label{wxrichtextstylelistboxsetapplyonselection
}
167 \func{void
}{SetApplyOnSelection
}{\param{bool
}{applyOnSelection
}}
169 If
{\it applyOnSelection
} is
\true, clicking on a style name in the list will immediately
170 apply the style to the associated rich text control.
172 \membersection{wxRichTextStyleListBox::SetRichTextCtrl
}\label{wxrichtextstylelistboxsetrichtextctrl
}
174 \func{void
}{SetRichTextCtrl
}{\param{wxRichTextCtrl*
}{ctrl
}}
176 Associates the listbox with a
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}.
178 \membersection{wxRichTextStyleListBox::SetStyleSheet
}\label{wxrichtextstylelistboxsetstylesheet
}
180 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
182 Associates the control with a style sheet.
184 \membersection{wxRichTextStyleListBox::SetStyleType
}\label{wxrichtextstylelistboxsetstyletype
}
186 \func{void
}{SetStyleType
}{\param{wxRichTextStyleListBox::wxRichTextStyleType
}{styleType
}}
188 Sets the style type to display. One of wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_ALL, wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_PARAGRAPH,
189 wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_CHARACTER and wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_LIST.
191 \membersection{wxRichTextStyleListBox::UpdateStyles
}\label{wxrichtextstylelistboxupdatestyles
}
193 \func{void
}{UpdateStyles
}{\void}
195 Updates the list from the associated style sheet.
198 \section{\class{wxRichTextStyleListCtrl
}}\label{wxrichtextstylelistctrl
}
200 This class incorporates a
\helpref{wxRichTextStyleListBox
}{wxrichtextstylelistbox
} and
201 a choice control that allows the user to select the category of style to view.
202 It is demonstrated in the wxRichTextCtrl sample in
{\tt samples/richtext
}.
204 To use wxRichTextStyleListCtrl, add the control to your window hierarchy and
205 call
\helpref{SetStyleType
}{wxrichtextstylelistctrlsetstyletype
} with
206 one of wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_ALL, wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_PARAGRAPH,
207 wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_CHARACTER and wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_LIST to set the current view.
208 Associate the control with a style sheet and rich text control with SetStyleSheet and SetRichTextCtrl,
209 so that when a style is double-clicked, it is applied to the selection.
211 \wxheading{Window styles
}
214 \begin{twocollist
}\itemsep=
0pt
215 \twocolitem{\windowstyle{wxRICHTEXTSTYLELIST
\_HIDE\_TYPE\_SELECTOR}}{This style hides the category selection control.
}
218 \wxheading{Derived from
}
220 \helpref{wxControl
}{wxcontrol
}
222 \wxheading{Include files
}
224 <wx/richtext/richtextstyles.h>
226 \wxheading{Data structures
}
228 \latexignore{\rtfignore{\wxheading{Members
}}}
230 \membersection{wxRichTextStyleListCtrl::wxRichTextStyleListCtrl
}\label{wxrichtextstylelistctrlwxrichtextstylelistctrl
}
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}}
234 \func{}{wxRichTextStyleListCtrl
}{\void}
238 \membersection{wxRichTextStyleListCtrl::Create
}\label{wxrichtextstylelistctrlcreate
}
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}}
244 \membersection{wxRichTextStyleListCtrl::GetRichTextCtrl
}\label{wxrichtextstylelistctrlgetrichtextctrl
}
246 \constfunc{wxRichTextCtrl*
}{GetRichTextCtrl
}{\void}
248 Returns the associated rich text control, if any.
250 \membersection{wxRichTextStyleListCtrl::GetStyleChoice
}\label{wxrichtextstylelistctrlgetstylechoice
}
252 \constfunc{wxChoice*
}{GetStyleChoice
}{\void}
254 Returns the wxChoice control used for selecting the style category.
256 \membersection{wxRichTextStyleListCtrl::GetStyleListBox
}\label{wxrichtextstylelistctrlgetstylelistbox
}
258 \constfunc{wxRichTextStyleListBox*
}{GetStyleListBox
}{\void}
260 Returns the wxListBox control used to view the style list.
262 \membersection{wxRichTextStyleListCtrl::GetStyleSheet
}\label{wxrichtextstylelistctrlgetstylesheet
}
264 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
266 Returns the associated style sheet, if any.
268 \membersection{wxRichTextStyleListCtrl::GetStyleType
}\label{wxrichtextstylelistctrlgetstyletype
}
270 \constfunc{wxRichTextStyleListBox::wxRichTextStyleType
}{GetStyleType
}{\void}
272 Returns the type of style to show in the list box.
274 \membersection{wxRichTextStyleListCtrl::SetRichTextCtrl
}\label{wxrichtextstylelistctrlsetrichtextctrl
}
276 \func{void
}{SetRichTextCtrl
}{\param{wxRichTextCtrl*
}{ctrl
}}
278 Associates the control with a wxRichTextCtrl.
280 \membersection{wxRichTextStyleListCtrl::SetStyleSheet
}\label{wxrichtextstylelistctrlsetstylesheet
}
282 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
284 Associates the control with a style sheet.
286 \membersection{wxRichTextStyleListCtrl::SetStyleType
}\label{wxrichtextstylelistctrlsetstyletype
}
288 \func{void
}{SetStyleType
}{\param{wxRichTextStyleListBox::wxRichTextStyleType
}{styleType
}}
290 Sets the style type to display. One of wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_ALL, wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_PARAGRAPH,
291 wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_CHARACTER and wxRichTextStyleListBox::wxRICHTEXT
\_STYLE\_LIST.
293 \membersection{wxRichTextStyleListCtrl::UpdateStyles
}\label{wxrichtextstylelistctrlupdatestyles
}
295 \func{void
}{UpdateStyles
}{\void}
297 Updates the style list box.