This is a listbox that can display the styles in a wxRichTextStyleSheet, and apply the selection to an associated wxRichTextCtrl.
See samples/richtext for an example of how to use it.
Derived from
Include files
<wx/richtext/richtextstyles.h>
Data structures
Members
wxRichTextStyleListBox::wxRichTextStyleListBox
wxRichTextStyleListBox::~wxRichTextStyleListBox
wxRichTextStyleListBox::ConvertTenthsMMToPixels
wxRichTextStyleListBox::CreateHTML
wxRichTextStyleListBox::GetRichTextCtrl
wxRichTextStyleListBox::GetStyle
wxRichTextStyleListBox::GetStyleSheet
wxRichTextStyleListBox::OnGetItem
wxRichTextStyleListBox::OnLeftDown
wxRichTextStyleListBox::OnSelect
wxRichTextStyleListBox::SetRichTextCtrl
wxRichTextStyleListBox::SetStyleSheet
wxRichTextStyleListBox::UpdateStyles
wxRichTextStyleListBox(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0)
Constructor.
~wxRichTextStyleListBox()
Destructor.
int ConvertTenthsMMToPixels(wxDC& dc, int units) const
Converts units in tenths of a millimetre to device units.
wxString CreateHTML(wxRichTextStyleDefinition* def) const
Creates a suitable HTML fragment for a definition.
wxRichTextCtrl* GetRichTextCtrl() const
Returns the wxRichTextCtrl associated with this listbox.
wxRichTextStyleDefinition* GetStyle(size_t i) const
Gets a style for a listbox index.
wxRichTextStyleSheet* GetStyleSheet() const
Returns the style sheet associated with this listbox.
wxString OnGetItem(size_t n) const
Returns the HTML for this item.
void OnLeftDown(wxMouseEvent& event)
Implements left click behaviour, applying the clicked style to the wxRichTextCtrl.
void OnSelect(wxCommandEvent& event)
Reacts to selection.
void SetRichTextCtrl(wxRichTextCtrl* ctrl)
Associates the listbox with a wxRichTextCtrl.
void SetStyleSheet(wxRichTextStyleSheet* styleSheet)
Associates the control with a style sheet.
void UpdateStyles()
Updates the list from the associated style sheet.