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 : Window, id: int=ID_ANY, pos:
Point=DefaultPosition, size: Size=DefaultSize, style: int=0) -> None
RichTextStyleListBox() -> None
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 : Window, id: int=ID_ANY, pos: Point=DefaultPosition, size: Size=DefaultSize, style: int=0)
Constructor.
None
__init__ (self)
None
ApplyStyle(self, i : int)¶Applies the ith style to the associated rich text control.
i (int) –
None
ConvertTenthsMMToPixels(self, dc : DC, units : int)¶Converts units in tenths of a millimetre to device units.
dc (wx.DC) –
units (int) –
int
Create(self, parent : Window, id: int=ID_ANY, pos: Point=DefaultPosition, size: Size=DefaultSize, style: int=0)¶Creates the window.
CreateHTML(self, styleDef : RichTextStyleDefinition)¶Creates a suitable HTML fragment for a definition.
styleDef (wx.richtext.RichTextStyleDefinition) –
str
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: WindowVariant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
VisualAttributes
GetRichTextCtrl(self)¶Returns the wx.richtext.RichTextCtrl associated with this listbox.
GetStyle(self, i : int)¶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 : int)¶Returns the HTML for this item.
n (int) –
str
OnLeftDown(self, event : MouseEvent)¶Implements left click behaviour, applying the clicked style to the wx.richtext.RichTextCtrl.
event (wx.MouseEvent) –
None
SetApplyOnSelection(self, applyOnSelection : bool)¶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) –
None
SetRichTextCtrl(self, ctrl : RichTextCtrl)¶Associates the listbox with a wx.richtext.RichTextCtrl.
ctrl (wx.richtext.RichTextCtrl) –
None
SetStyleSheet(self, styleSheet : RichTextStyleSheet)¶Associates the control with a style sheet.
styleSheet (wx.richtext.RichTextStyleSheet) –
None
SetStyleType(self, styleType : RichTextStyleListBox.wxRichTextStyleType)¶Sets the style type to display.
One of
RichTextStyleListBox.__init__ ,
RichTextStyleListBox.__init__ ,
RichTextStyleListBox.__init__
RichTextStyleListBox.__init__ .
styleType (RichTextStyleListBox.wxRichTextStyleType) –
None
UpdateStyles(self)¶Updates the list from the associated style sheet.
None
ApplyOnSelection¶RichTextCtrl¶See GetRichTextCtrl and SetRichTextCtrl
StyleSheet¶See GetStyleSheet and SetStyleSheet
StyleType¶See GetStyleType and SetStyleType