wx.richtext.RichTextStyleListBox¶This is a listbox that can display the styles in a wx.richtext.RichTextStyleSheet, and apply the selection to an associated wx.richtext.RichTextCtrl.
See samples/richtext for an example of how to use it.
See also
wx.richtext.RichTextStyleComboCtrl, RichTextCtrl Overview
Class Hierarchy¶
Inheritance diagram for class RichTextStyleListBox:

Methods Summary¶Constructor. |
|
Applies the ith style to the associated rich text control. |
|
Converts units in tenths of a millimetre to device units. |
|
Creates the window. |
|
Creates a suitable HTML fragment for a definition. |
|
If the return value is |
|
Returns the wx.richtext.RichTextCtrl associated with this listbox. |
|
Gets a style for a listbox index. |
|
Returns the style sheet associated with this listbox. |
|
Returns the type of style to show in the list box. |
|
Returns the HTML for this item. |
|
Implements left click behaviour, applying the clicked style to the wx.richtext.RichTextCtrl. |
|
If applyOnSelection is |
|
Associates the listbox with a wx.richtext.RichTextCtrl. |
|
Associates the control with a style sheet. |
|
Sets the style type to display. |
|
Updates the list from the associated style sheet. |
Properties Summary¶See |
|
See |
|
See |
Class API¶wx.richtext.RichTextStyleListBox(HtmlListBox)¶Possible constructors:
RichTextStyleListBox(parent, id=ID_ANY, pos=DefaultPosition,
size=DefaultSize, style=0)
RichTextStyleListBox()
This is a listbox that can display the styles in a RichTextStyleSheet, and apply the selection to an associated RichTextCtrl.
__init__(self, *args, **kw)¶__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0)
Constructor.
__init__ (self)
ApplyStyle(self, i)¶Applies the ith style to the associated rich text control.
i (int) –
ConvertTenthsMMToPixels(self, dc, units)¶Converts units in tenths of a millimetre to device units.
dc (wx.DC) –
units (int) –
int
Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0)¶Creates the window.
CreateHTML(self, styleDef)¶Creates a suitable HTML fragment for a definition.
styleDef (wx.richtext.RichTextStyleDefinition) –
string
GetApplyOnSelection(self)¶If the return value is True, clicking on a style name in the list will immediately apply the style to the associated rich text control.
bool
GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
VisualAttributes
GetRichTextCtrl(self)¶Returns the wx.richtext.RichTextCtrl associated with this listbox.
GetStyle(self, i)¶Gets a style for a listbox index.
i (int) –
GetStyleSheet(self)¶Returns the style sheet associated with this listbox.
GetStyleType(self)¶Returns the type of style to show in the list box.
wx.richtext.RichTextStyleListBox.wxRichTextStyleType
OnGetItem(self, n)¶Returns the HTML for this item.
n (int) –
string
OnLeftDown(self, event)¶Implements left click behaviour, applying the clicked style to the wx.richtext.RichTextCtrl.
event (wx.MouseEvent) –
SetApplyOnSelection(self, applyOnSelection)¶If applyOnSelection is True, clicking on a style name in the list will immediately apply the style to the associated rich text control.
applyOnSelection (bool) –
SetRichTextCtrl(self, ctrl)¶Associates the listbox with a wx.richtext.RichTextCtrl.
ctrl (wx.richtext.RichTextCtrl) –
SetStyleSheet(self, styleSheet)¶Associates the control with a style sheet.
styleSheet (wx.richtext.RichTextStyleSheet) –
SetStyleType(self, styleType)¶Sets the style type to display.
One of
RichTextStyleListBox.__init__ ,
RichTextStyleListBox.__init__ ,
RichTextStyleListBox.__init__
RichTextStyleListBox.__init__ .
styleType (RichTextStyleListBox.wxRichTextStyleType) –
UpdateStyles(self)¶Updates the list from the associated style sheet.
ApplyOnSelection¶RichTextCtrl¶See GetRichTextCtrl and SetRichTextCtrl
StyleSheet¶See GetStyleSheet and SetStyleSheet
StyleType¶See GetStyleType and SetStyleType