Phoenix Logo

phoenix_title 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 Class Hierarchy

Inheritance diagram for class RichTextStyleListBox:

method_summary Methods Summary

__init__ Constructor.
ApplyStyle Applies the ith style to the associated rich text control.
ConvertTenthsMMToPixels Converts units in tenths of a millimetre to device units.
Create Creates the window.
CreateHTML Creates a suitable HTML fragment for a definition.
GetApplyOnSelection 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.
GetRichTextCtrl Returns the wx.richtext.RichTextCtrl associated with this listbox.
GetStyle Gets a style for a listbox index.
GetStyleSheet Returns the style sheet associated with this listbox.
GetStyleType Returns the type of style to show in the list box.
OnGetItem Returns the HTML for this item.
OnLeftDown Implements left click behaviour, applying the clicked style to the wx.richtext.RichTextCtrl.
SetApplyOnSelection If applyOnSelection is True, clicking on a style name in the list will immediately apply the style to the associated rich text control.
SetRichTextCtrl Associates the listbox with a wx.richtext.RichTextCtrl.
SetStyleSheet Associates the control with a style sheet.
SetStyleType Sets the style type to display.
UpdateStyles Updates the list from the associated style sheet.

api Class API



class 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.


Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0)

Constructor.

Parameters:



__init__ (self)





ApplyStyle(self, i)

Applies the ith style to the associated rich text control.

Parameters:i (int) –


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.

Parameters:
Return type:

bool



CreateHTML(self, styleDef)

Creates a suitable HTML fragment for a definition.

Parameters:styleDef (wx.richtext.RichTextStyleDefinition) –
Return type: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.

Return type:bool


GetRichTextCtrl(self)

Returns the wx.richtext.RichTextCtrl associated with this listbox.

Return type: wx.richtext.RichTextCtrl


GetStyle(self, i)

Gets a style for a listbox index.

Parameters:i (int) –
Return type: wx.richtext.RichTextStyleDefinition


GetStyleSheet(self)

Returns the style sheet associated with this listbox.

Return type: wx.richtext.RichTextStyleSheet


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:string


OnLeftDown(self, event)

Implements left click behaviour, applying the clicked style to the wx.richtext.RichTextCtrl.

Parameters: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.

Parameters:applyOnSelection (bool) –


SetRichTextCtrl(self, ctrl)

Associates the listbox with a wx.richtext.RichTextCtrl.

Parameters:ctrl (wx.richtext.RichTextCtrl) –


SetStyleSheet(self, styleSheet)

Associates the control with a style sheet.

Parameters:styleSheet (wx.richtext.RichTextStyleSheet) –


SetStyleType(self, styleType)

Sets the style type to display.

One of

  • RichTextStyleListBox.__init__ ,
  • RichTextStyleListBox.__init__ ,
  • RichTextStyleListBox.__init__
  • RichTextStyleListBox.__init__ .
Parameters:styleType (RichTextStyleListBox.wxRichTextStyleType) –


UpdateStyles(self)

Updates the list from the associated style sheet.


Properties



ApplyOnSelection

See GetApplyOnSelection and SetApplyOnSelection



RichTextCtrl

See GetRichTextCtrl and SetRichTextCtrl



StyleSheet

See GetStyleSheet and SetStyleSheet



StyleType

See GetStyleType and SetStyleType