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.

See also

wx.richtext.RichTextStyleComboCtrl, RichTextCtrl Overview


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.

GetClassDefaultAttributes

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.


property_summary Properties Summary

ApplyOnSelection

See GetApplyOnSelection and SetApplyOnSelection

RichTextCtrl

See GetRichTextCtrl and SetRichTextCtrl

StyleSheet

See GetStyleSheet and SetStyleSheet

StyleType

See GetStyleType and SetStyleType


api Class API

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


Methods

__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self, parent : Window, id: int=ID_ANY, pos: Point=DefaultPosition, size: Size=DefaultSize, style: int=0)

Constructor.

Parameters:
Return type:

None



__init__ (self)

Return type:

None





ApplyStyle(self, i : int)

Applies the ith style to the associated rich text control.

Parameters:

i (int) –

Return type:

None



ConvertTenthsMMToPixels(self, dc : DC, units : int)

Converts units in tenths of a millimetre to device units.

Parameters:
  • dc (wx.DC) –

  • units (int) –

Return type:

int



Create(self, parent : Window, id: int=ID_ANY, pos: Point=DefaultPosition, size: Size=DefaultSize, style: int=0)

Creates the window.

Parameters:
Return type:

bool



CreateHTML(self, styleDef : RichTextStyleDefinition)

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: WindowVariant=WINDOW_VARIANT_NORMAL)
Parameters:

variant (WindowVariant) –

Return type:

VisualAttributes



GetRichTextCtrl(self)

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

Return type:

wx.richtext.RichTextCtrl



GetStyle(self, i : int)

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 : int)

Returns the HTML for this item.

Parameters:

n (int) –

Return type:

str



OnLeftDown(self, event : MouseEvent)

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

Parameters:

event (wx.MouseEvent) –

Return type:

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.

Parameters:

applyOnSelection (bool) –

Return type:

None



SetRichTextCtrl(self, ctrl : RichTextCtrl)

Associates the listbox with a wx.richtext.RichTextCtrl.

Parameters:

ctrl (wx.richtext.RichTextCtrl) –

Return type:

None



SetStyleSheet(self, styleSheet : RichTextStyleSheet)

Associates the control with a style sheet.

Parameters:

styleSheet (wx.richtext.RichTextStyleSheet) –

Return type:

None



SetStyleType(self, styleType : RichTextStyleListBox.wxRichTextStyleType)

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

See GetApplyOnSelection and SetApplyOnSelection



RichTextCtrl

See GetRichTextCtrl and SetRichTextCtrl



StyleSheet

See GetStyleSheet and SetStyleSheet



StyleType

See GetStyleType and SetStyleType