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.
Class Hierarchy¶
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¶
- class wx.richtext.RichTextStyleListBox(HtmlListBox)¶
Possible constructors:
RichTextStyleListBox(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0) -> None RichTextStyleListBox() -> None
This is a listbox that can display the styles in a RichTextStyleSheet, and apply the selection to an associated RichTextCtrl.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0)
Constructor.
- Parameters:
- Return type:
None
__init__ (self)
- Return type:
None
- ApplyStyle(self, i)¶
Applies the ith style to the associated rich text control.
- Parameters:
i (int)
- Return type:
None
- ConvertTenthsMMToPixels(self, dc, units)¶
Converts units in tenths of a millimetre to device units.
- Parameters:
dc (wx.DC)
units (int)
- Return type:
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.
- Parameters:
styleDef (wx.richtext.RichTextStyleDefinition)
- Return type:
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.- Return type:
bool
- static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
- Parameters:
variant (WindowVariant)
- Return type:
VisualAttributes
- GetRichTextCtrl(self)¶
Returns the wx.richtext.RichTextCtrl associated with this listbox.
- Return type:
- GetStyle(self, i)¶
Gets a style for a listbox index.
- Parameters:
i (int)
- Return type:
- GetStyleSheet(self)¶
Returns the style sheet associated with this listbox.
- Return type:
- GetStyleType(self)¶
Returns the type of style to show in the list box.
- Return type:
wx.richtext.RichTextStyleListBox.wxRichTextStyleType
- OnGetItem(self, n)¶
Returns the HTML for this item.
- Parameters:
n (int)
- Return type:
str
- OnLeftDown(self, event)¶
Implements left click behaviour, applying the clicked style to the wx.richtext.RichTextCtrl.
- Parameters:
event (wx.MouseEvent)
- Return type:
None
- 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.- Parameters:
applyOnSelection (bool)
- Return type:
None
- SetRichTextCtrl(self, ctrl)¶
Associates the listbox with a wx.richtext.RichTextCtrl.
- Parameters:
ctrl (wx.richtext.RichTextCtrl)
- Return type:
None
- SetStyleSheet(self, styleSheet)¶
Associates the control with a style sheet.
- Parameters:
styleSheet (wx.richtext.RichTextStyleSheet)
- Return type:
None
- SetStyleType(self, styleType)¶
Sets the style type to display.
One of
RichTextStyleListBox.__init__
,RichTextStyleListBox.__init__
,RichTextStyleListBox.__init__
RichTextStyleListBox.__init__
.
- Parameters:
styleType (RichTextStyleListBox.wxRichTextStyleType)
- Return type:
None
- UpdateStyles(self)¶
Updates the list from the associated style sheet.
- Return type:
None
Properties¶
- ApplyOnSelection¶
- RichTextCtrl¶
See
GetRichTextCtrl
andSetRichTextCtrl
- StyleSheet¶
See
GetStyleSheet
andSetStyleSheet
- StyleType¶
See
GetStyleType
andSetStyleType