phoenix_title wx.richtext.RichTextFieldTypeStandard

A field type that can handle fields with text or bitmap labels, with a small range of styles for implementing rectangular fields and fields that can be used for start and end tags.

The border, text and background colours can be customised; the default is white text on a black background.

The following display styles can be used.

^^

styles Window Styles

This class supports the following styles:

  • RICHTEXT_FIELD_STYLE_COMPOSITE: Creates a composite field; you will probably need to derive a new class to implement UpdateField.

  • RICHTEXT_FIELD_STYLE_RECTANGLE: Shows a rounded rectangle background.

  • RICHTEXT_FIELD_STYLE_NO_BORDER: Suppresses the background and border; mostly used with a bitmap label.

  • RICHTEXT_FIELD_STYLE_START_TAG: Shows a start tag background, with the pointy end facing right.

  • RICHTEXT_FIELD_STYLE_END_TAG: Shows an end tag background, with the pointy end facing left. ^^

class_hierarchy Class Hierarchy

Inheritance diagram for class RichTextFieldTypeStandard:

method_summary Methods Summary

__init__

Constructor, creating a field type definition with a text label.

Copy

Copies the object.

Draw

Draw the item, within the given range.

GetBackgroundColour

Gets the colour used for drawing the field background.

GetBitmap

Gets the bitmap label for fields of this type.

GetBorderColour

Gets the colour used for drawing the field border.

GetDisplayStyle

Gets the display style for fields of this type.

GetFont

Gets the font used for drawing the text label.

GetHorizontalMargin

Gets the horizontal margin surrounding the field object.

GetHorizontalPadding

Sets the horizontal padding (the distance between the border and the text).

GetLabel

Returns the text label for fields of this type.

GetRangeSize

Returns the object size for the given range.

GetSize

Get the size of the field, given the label, font size, and so on.

GetTextColour

Gets the colour used for drawing the text label.

GetVerticalMargin

Gets the vertical margin surrounding the field object.

GetVerticalPadding

Gets the vertical padding (the distance between the border and the text).

Init

Initialises the object.

IsTopLevel

Returns True if the display type is RICHTEXT_FIELD_STYLE_COMPOSITE, False otherwise.

Layout

Lay the item out at the specified position with the given size constraint.

SetBackgroundColour

Sets the colour used for drawing the field background.

SetBitmap

Sets the bitmap label for fields of this type.

SetBorderColour

Sets the colour used for drawing the field border.

SetDisplayStyle

Sets the display style for fields of this type.

SetFont

Sets the font used for drawing the text label.

SetHorizontalMargin

Sets the horizontal margin surrounding the field object.

SetHorizontalPadding

Sets the horizontal padding (the distance between the border and the text).

SetLabel

Sets the text label for fields of this type.

SetTextColour

Sets the colour used for drawing the text label.

SetVerticalMargin

Sets the vertical margin surrounding the field object.

SetVerticalPadding

Sets the vertical padding (the distance between the border and the text).


property_summary Properties Summary

BackgroundColour

See GetBackgroundColour and SetBackgroundColour

Bitmap

See GetBitmap and SetBitmap

BorderColour

See GetBorderColour and SetBorderColour

DisplayStyle

See GetDisplayStyle and SetDisplayStyle

Font

See GetFont and SetFont

HorizontalMargin

See GetHorizontalMargin and SetHorizontalMargin

HorizontalPadding

See GetHorizontalPadding and SetHorizontalPadding

Label

See GetLabel and SetLabel

TextColour

See GetTextColour and SetTextColour

VerticalMargin

See GetVerticalMargin and SetVerticalMargin

VerticalPadding

See GetVerticalPadding and SetVerticalPadding


api Class API

class wx.richtext.RichTextFieldTypeStandard(RichTextFieldType)

Possible constructors:

RichTextFieldTypeStandard(name, label,
                          displayStyle=RICHTEXT_FIELD_STYLE_RECTANGLE)

RichTextFieldTypeStandard(name, bitmap,
                          displayStyle=RICHTEXT_FIELD_STYLE_NO_BORDER)

RichTextFieldTypeStandard()

RichTextFieldTypeStandard(field)

A field type that can handle fields with text or bitmap labels, with a small range of styles for implementing rectangular fields and fields that can be used for start and end tags.


Methods

__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self, name, label, displayStyle=RICHTEXT_FIELD_STYLE_RECTANGLE)

Constructor, creating a field type definition with a text label.

Parameters:
  • name (string) – The name of the type definition. This must be unique, and is the type name used when adding a field to a control.

  • label (string) – The text label to be shown on the field.

  • displayStyle (int) – The display style: one of RICHTEXT_FIELD_STYLE_RECTANGLE, RICHTEXT_FIELD_STYLE_NO_BORDER, RICHTEXT_FIELD_STYLE_START_TAG, RICHTEXT_FIELD_STYLE_END_TAG.



__init__ (self, name, bitmap, displayStyle=RICHTEXT_FIELD_STYLE_NO_BORDER)

Constructor, creating a field type definition with a bitmap label.

Parameters:
  • name (string) – The name of the type definition. This must be unique, and is the type name used when adding a field to a control.

  • bitmap (wx.Bitmap) – The bitmap label to be shown on the field.

  • displayStyle (int) – The display style: one of RICHTEXT_FIELD_STYLE_RECTANGLE, RICHTEXT_FIELD_STYLE_NO_BORDER, RICHTEXT_FIELD_STYLE_START_TAG, RICHTEXT_FIELD_STYLE_END_TAG.



__init__ (self)

The default constructor.



__init__ (self, field)

The copy constructor.

Parameters:

field (wx.richtext.RichTextFieldTypeStandard) –





Copy(self, field)

Copies the object.

Parameters:

field (wx.richtext.RichTextFieldTypeStandard) –



Draw(self, obj, dc, context, range, selection, rect, descent, style)

Draw the item, within the given range.

Some objects may ignore the range (for example paragraphs) while others must obey it (lines, to implement wrapping)

Parameters:
Return type:

bool



GetBackgroundColour(self)

Gets the colour used for drawing the field background.

Return type:

Colour



GetBitmap(self)

Gets the bitmap label for fields of this type.

Return type:

Bitmap



GetBorderColour(self)

Gets the colour used for drawing the field border.

Return type:

Colour



GetDisplayStyle(self)

Gets the display style for fields of this type.

Return type:

int



GetFont(self)

Gets the font used for drawing the text label.

Return type:

Font



GetHorizontalMargin(self)

Gets the horizontal margin surrounding the field object.

Return type:

int



GetHorizontalPadding(self)

Sets the horizontal padding (the distance between the border and the text).

Return type:

int



GetLabel(self)

Returns the text label for fields of this type.

Return type:

string



GetRangeSize(self, obj, range, size, descent, dc, context, flags, position=Point(0, 0), parentSize=DefaultSize, partialExtents=None)

Returns the object size for the given range.

Returns False if the range is invalid for this object.

Parameters:
Return type:

bool



GetSize(self, obj, dc, context, style)

Get the size of the field, given the label, font size, and so on.

Parameters:
Return type:

Size



GetTextColour(self)

Gets the colour used for drawing the text label.

Return type:

Colour



GetVerticalMargin(self)

Gets the vertical margin surrounding the field object.

Return type:

int



GetVerticalPadding(self)

Gets the vertical padding (the distance between the border and the text).

Return type:

int



Init(self)

Initialises the object.



IsTopLevel(self, obj)

Returns True if the display type is RICHTEXT_FIELD_STYLE_COMPOSITE, False otherwise.

Parameters:

obj (wx.richtext.RichTextField) –

Return type:

bool



Layout(self, obj, dc, context, rect, parentRect, style)

Lay the item out at the specified position with the given size constraint.

Layout must set the cached size. rect is the available space for the object, and parentRect is the container that is used to determine a relative size or position (for example if a text box must be 50% of the parent text box).

Parameters:
Return type:

bool



SetBackgroundColour(self, colour)

Sets the colour used for drawing the field background.

Parameters:

colour (wx.Colour) –



SetBitmap(self, bitmap)

Sets the bitmap label for fields of this type.

Parameters:

bitmap (wx.Bitmap) –



SetBorderColour(self, colour)

Sets the colour used for drawing the field border.

Parameters:

colour (wx.Colour) –



SetDisplayStyle(self, displayStyle)

Sets the display style for fields of this type.

Parameters:

displayStyle (int) –



SetFont(self, font)

Sets the font used for drawing the text label.

Parameters:

font (wx.Font) –



SetHorizontalMargin(self, margin)

Sets the horizontal margin surrounding the field object.

Parameters:

margin (int) –



SetHorizontalPadding(self, padding)

Sets the horizontal padding (the distance between the border and the text).

Parameters:

padding (int) –



SetLabel(self, label)

Sets the text label for fields of this type.

Parameters:

label (string) –



SetTextColour(self, colour)

Sets the colour used for drawing the text label.

Parameters:

colour (wx.Colour) –



SetVerticalMargin(self, margin)

Sets the vertical margin surrounding the field object.

Parameters:

margin (int) –



SetVerticalPadding(self, padding)

Sets the vertical padding (the distance between the border and the text).

Parameters:

padding (int) –


Properties

BackgroundColour

See GetBackgroundColour and SetBackgroundColour



Bitmap

See GetBitmap and SetBitmap



BorderColour

See GetBorderColour and SetBorderColour



DisplayStyle

See GetDisplayStyle and SetDisplayStyle



Font

See GetFont and SetFont



HorizontalMargin

See GetHorizontalMargin and SetHorizontalMargin



HorizontalPadding

See GetHorizontalPadding and SetHorizontalPadding



Label

See GetLabel and SetLabel



TextColour

See GetTextColour and SetTextColour



VerticalMargin

See GetVerticalMargin and SetVerticalMargin



VerticalPadding

See GetVerticalPadding and SetVerticalPadding