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.
^^
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. ^^
Constructor, creating a field type definition with a text label. |
|
Copies the object. |
|
Draw the item, within the given range. |
|
Gets the colour used for drawing the field background. |
|
Gets the bitmap label for fields of this type. |
|
Gets the colour used for drawing the field border. |
|
Gets the display style for fields of this type. |
|
Gets the font used for drawing the text label. |
|
Gets the horizontal margin surrounding the field object. |
|
Sets the horizontal padding (the distance between the border and the text). |
|
Returns the text label for fields of this type. |
|
Returns the object size for the given range. |
|
Get the size of the field, given the label, font size, and so on. |
|
Gets the colour used for drawing the text label. |
|
Gets the vertical margin surrounding the field object. |
|
Gets the vertical padding (the distance between the border and the text). |
|
Initialises the object. |
|
Returns |
|
Lay the item out at the specified position with the given size constraint. |
|
Sets the colour used for drawing the field background. |
|
Sets the bitmap label for fields of this type. |
|
Sets the colour used for drawing the field border. |
|
Sets the display style for fields of this type. |
|
Sets the font used for drawing the text label. |
|
Sets the horizontal margin surrounding the field object. |
|
Sets the horizontal padding (the distance between the border and the text). |
|
Sets the text label for fields of this type. |
|
Sets the colour used for drawing the text label. |
|
Sets the vertical margin surrounding the field object. |
|
Sets the vertical padding (the distance between the border and the text). |
See |
|
See |
|
See |
|
See |
|
See |
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.
__init__
(self, *args, **kw)¶__init__ (self, name, label, displayStyle=RICHTEXT_FIELD_STYLE_RECTANGLE)
Constructor, creating a field type definition with a text label.
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.
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.
field (wx.richtext.RichTextFieldTypeStandard) –
Copy
(self, field)¶Copies the object.
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)
obj (wx.richtext.RichTextField) –
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
range (wx.richtext.RichTextRange) –
selection (wx.richtext.RichTextSelection) –
rect (wx.Rect) –
descent (int) –
style (int) –
bool
GetBackgroundColour
(self)¶Gets the colour used for drawing the field background.
Colour
GetBorderColour
(self)¶Gets the colour used for drawing the field border.
Colour
GetDisplayStyle
(self)¶Gets the display style for fields of this type.
int
GetHorizontalMargin
(self)¶Gets the horizontal margin surrounding the field object.
int
GetHorizontalPadding
(self)¶Sets the horizontal padding (the distance between the border and the text).
int
GetLabel
(self)¶Returns the text label for fields of this 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.
obj (wx.richtext.RichTextField) –
range (wx.richtext.RichTextRange) –
size (wx.Size) –
descent (int) –
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
flags (int) –
position (wx.Point) –
parentSize (wx.Size) –
partialExtents (list of integers) –
bool
GetSize
(self, obj, dc, context, style)¶Get the size of the field, given the label, font size, and so on.
obj (wx.richtext.RichTextField) –
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
style (int) –
Size
GetTextColour
(self)¶Gets the colour used for drawing the text label.
Colour
GetVerticalMargin
(self)¶Gets the vertical margin surrounding the field object.
int
GetVerticalPadding
(self)¶Gets the vertical padding (the distance between the border and the text).
int
Init
(self)¶Initialises the object.
IsTopLevel
(self, obj)¶Returns True
if the display type is RICHTEXT_FIELD_STYLE_COMPOSITE
, False
otherwise.
obj (wx.richtext.RichTextField) –
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).
obj (wx.richtext.RichTextField) –
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
rect (wx.Rect) –
parentRect (wx.Rect) –
style (int) –
bool
SetBackgroundColour
(self, colour)¶Sets the colour used for drawing the field background.
colour (wx.Colour) –
SetBitmap
(self, bitmap)¶Sets the bitmap label for fields of this type.
bitmap (wx.Bitmap) –
SetBorderColour
(self, colour)¶Sets the colour used for drawing the field border.
colour (wx.Colour) –
SetDisplayStyle
(self, displayStyle)¶Sets the display style for fields of this type.
displayStyle (int) –
SetHorizontalMargin
(self, margin)¶Sets the horizontal margin surrounding the field object.
margin (int) –
SetHorizontalPadding
(self, padding)¶Sets the horizontal padding (the distance between the border and the text).
padding (int) –
SetLabel
(self, label)¶Sets the text label for fields of this type.
label (string) –
SetTextColour
(self, colour)¶Sets the colour used for drawing the text label.
colour (wx.Colour) –
SetVerticalMargin
(self, margin)¶Sets the vertical margin surrounding the field object.
margin (int) –
SetVerticalPadding
(self, padding)¶Sets the vertical padding (the distance between the border and the text).
padding (int) –
BackgroundColour
¶BorderColour
¶See GetBorderColour
and SetBorderColour
DisplayStyle
¶See GetDisplayStyle
and SetDisplayStyle
HorizontalMargin
¶HorizontalPadding
¶TextColour
¶See GetTextColour
and SetTextColour
VerticalMargin
¶See GetVerticalMargin
and SetVerticalMargin
VerticalPadding
¶See GetVerticalPadding
and SetVerticalPadding