| Version: 3.2.8

Public Types | Public Member Functions | Protected Attributes | List of all members
wxRichTextFieldTypeStandard Class Reference
Class List by Category » Rich Text

`#include <wx/richtext/richtextbuffer.h>`

Inheritance diagram for wxRichTextFieldTypeStandard:
[legend]

## Detailed Description

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

This class supports the following styles:

- wxRICHTEXT_FIELD_STYLE_COMPOSITE:
  Creates a composite field; you will probably need to derive a new class to implement UpdateField.
- wxRICHTEXT_FIELD_STYLE_RECTANGLE:
  Shows a rounded rectangle background.
- wxRICHTEXT_FIELD_STYLE_NO_BORDER:
  Suppresses the background and border; mostly used with a bitmap label.
- wxRICHTEXT_FIELD_STYLE_START_TAG:
  Shows a start tag background, with the pointy end facing right.
- wxRICHTEXT_FIELD_STYLE_END_TAG:
  Shows an end tag background, with the pointy end facing left.

##

Library: wxRichText
Category: Rich Text

See also
  wxRichTextFieldType, wxRichTextField, wxRichTextBuffer, wxRichTextCtrl

## Public Types
enum | { wxRICHTEXT_FIELD_STYLE_COMPOSITE = 0x01 , wxRICHTEXT_FIELD_STYLE_RECTANGLE = 0x02 , wxRICHTEXT_FIELD_STYLE_NO_BORDER = 0x04 , wxRICHTEXT_FIELD_STYLE_START_TAG = 0x08 , wxRICHTEXT_FIELD_STYLE_END_TAG = 0x10 }

## Public Member Functions
| wxRichTextFieldTypeStandard (const wxString &name, const wxString &label, int displayStyle=wxRICHTEXT_FIELD_STYLE_RECTANGLE)
| Constructor, creating a field type definition with a text label. More...
| wxRichTextFieldTypeStandard (const wxString &name, const wxBitmap &bitmap, int displayStyle=wxRICHTEXT_FIELD_STYLE_NO_BORDER)
| Constructor, creating a field type definition with a bitmap label. More...
| wxRichTextFieldTypeStandard ()
| The default constructor. More...
| wxRichTextFieldTypeStandard (const wxRichTextFieldTypeStandard &field)
| The copy constructor. More...
void | Init ()
| Initialises the object. More...
void | Copy (const wxRichTextFieldTypeStandard &field)
| Copies the object. More...
void | operator= (const wxRichTextFieldTypeStandard &field)
| The assignment operator. More...
virtual bool | Draw (wxRichTextField *obj, wxDC &dc, wxRichTextDrawingContext &context, const wxRichTextRange &range, const wxRichTextSelection &selection, const wxRect &rect, int descent, int style)
| Draw the item, within the given range. More...
virtual bool | Layout (wxRichTextField *obj, wxDC &dc, wxRichTextDrawingContext &context, const wxRect &rect, const wxRect &parentRect, int style)
| Lay the item out at the specified position with the given size constraint. More...
virtual bool | GetRangeSize (wxRichTextField *obj, const wxRichTextRange &range, wxSize &size, int &descent, wxDC &dc, wxRichTextDrawingContext &context, int flags, const wxPoint &position=wxPoint(0, 0), const wxSize &parentSize=wxDefaultSize, wxArrayInt *partialExtents=NULL) const
| Returns the object size for the given range. More...
wxSize | GetSize (wxRichTextField *obj, wxDC &dc, wxRichTextDrawingContext &context, int style) const
| Get the size of the field, given the label, font size, and so on. More...
virtual bool | IsTopLevel (wxRichTextField *obj) const
| Returns true if the display type is wxRICHTEXT_FIELD_STYLE_COMPOSITE, false otherwise. More...
void | SetLabel (const wxString &label)
| Sets the text label for fields of this type. More...
const wxString & | GetLabel () const
| Returns the text label for fields of this type. More...
void | SetBitmap (const wxBitmap &bitmap)
| Sets the bitmap label for fields of this type. More...
const wxBitmap & | GetBitmap () const
| Gets the bitmap label for fields of this type. More...
int | GetDisplayStyle () const
| Gets the display style for fields of this type. More...
void | SetDisplayStyle (int displayStyle)
| Sets the display style for fields of this type. More...
const wxFont & | GetFont () const
| Gets the font used for drawing the text label. More...
void | SetFont (const wxFont &font)
| Sets the font used for drawing the text label. More...
const wxColour & | GetTextColour () const
| Gets the colour used for drawing the text label. More...
void | SetTextColour (const wxColour &colour)
| Sets the colour used for drawing the text label. More...
const wxColour & | GetBorderColour () const
| Gets the colour used for drawing the field border. More...
void | SetBorderColour (const wxColour &colour)
| Sets the colour used for drawing the field border. More...
const wxColour & | GetBackgroundColour () const
| Gets the colour used for drawing the field background. More...
void | SetBackgroundColour (const wxColour &colour)
| Sets the colour used for drawing the field background. More...
void | SetVerticalPadding (int padding)
| Sets the vertical padding (the distance between the border and the text). More...
int | GetVerticalPadding () const
| Gets the vertical padding (the distance between the border and the text). More...
void | SetHorizontalPadding (int padding)
| Sets the horizontal padding (the distance between the border and the text). More...
int | GetHorizontalPadding () const
| Sets the horizontal padding (the distance between the border and the text). More...
void | SetHorizontalMargin (int margin)
| Sets the horizontal margin surrounding the field object. More...
int | GetHorizontalMargin () const
| Gets the horizontal margin surrounding the field object. More...
void | SetVerticalMargin (int margin)
| Sets the vertical margin surrounding the field object. More...
int | GetVerticalMargin () const
| Gets the vertical margin surrounding the field object. More...
Public Member Functions inherited from wxRichTextFieldType
| wxRichTextFieldType (const wxString &name=wxEmptyString)
| Creates a field type definition. More...
| wxRichTextFieldType (const wxRichTextFieldType &fieldType)
| Copy constructor. More...
void | Copy (const wxRichTextFieldType &fieldType)
virtual bool | CanEditProperties (wxRichTextField *obj) const
| Returns true if we can edit the object's properties via a GUI. More...
virtual bool | EditProperties (wxRichTextField *obj, wxWindow *parent, wxRichTextBuffer *buffer)
| Edits the object's properties via a GUI. More...
virtual wxString | GetPropertiesMenuLabel (wxRichTextField *obj) const
| Returns the label to be used for the properties context menu item. More...
virtual bool | UpdateField (wxRichTextBuffer *buffer, wxRichTextField *obj)
| Update the field. More...
void | SetName (const wxString &name)
| Sets the field type name. More...
wxString | GetName () const
| Returns the field type name. More...
Public Member Functions inherited from wxObject
| wxObject ()
| Default ctor; initializes to NULL the internal reference data. More...
| wxObject (const wxObject &other)
| Copy ctor. More...
virtual | ~wxObject ()
| Destructor. More...
virtual wxClassInfo * | GetClassInfo () const
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). More...
wxObjectRefData * | GetRefData () const
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. More...
bool | IsKindOf (const wxClassInfo *info) const
| Determines whether this class is a subclass of (or the same class as) the given class. More...
bool | IsSameAs (const wxObject &obj) const
| Returns true if this object has the same data pointer as obj. More...
void | Ref (const wxObject &clone)
| Makes this object refer to the data in clone. More...
void | SetRefData (wxObjectRefData *data)
| Sets the wxObject::m_refData pointer. More...
void | UnRef ()
| Decrements the reference count in the associated data, and if it is zero, deletes the data. More...
void | UnShare ()
| This is the same of AllocExclusive() but this method is public. More...
void | operator delete (void *buf)
| The delete operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...
void * | operator new (size_t size, const wxString &filename=NULL, int lineNum=0)
| The new operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...

## Protected Attributes
wxString | m_label
int | m_displayStyle
wxFont | m_font
wxColour | m_textColour
wxColour | m_borderColour
wxColour | m_backgroundColour
int | m_verticalPadding
int | m_horizontalPadding
int | m_horizontalMargin
int | m_verticalMargin
wxBitmap | m_bitmap
Protected Attributes inherited from wxRichTextFieldType
wxString | m_name
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data. More...

## Additional Inherited Members
Protected Member Functions inherited from wxObject
void | AllocExclusive ()
| Ensure that this object's data is not shared with any other object. More...
virtual wxObjectRefData * | CreateRefData () const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. More...
virtual wxObjectRefData * | CloneRefData (const wxObjectRefData *data) const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data. More...

## Member Enumeration Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
wxRICHTEXT_FIELD_STYLE_COMPOSITE |
wxRICHTEXT_FIELD_STYLE_RECTANGLE |
wxRICHTEXT_FIELD_STYLE_NO_BORDER |
wxRICHTEXT_FIELD_STYLE_START_TAG |
wxRICHTEXT_FIELD_STYLE_END_TAG |

## Constructor & Destructor Documentation

## ◆ wxRichTextFieldTypeStandard() [1/4]

wxRichTextFieldTypeStandard::wxRichTextFieldTypeStandard | ( | const wxString & | name,
|  | const wxString & | label,
|  | int | displayStyle = `wxRICHTEXT_FIELD_STYLE_RECTANGLE`
| ) |  |

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

Parameters

  name | The name of the type definition. This must be unique, and is the type name used when adding a field to a control.
  label | The text label to be shown on the field.
  displayStyle | The display style: one of wxRICHTEXT_FIELD_STYLE_RECTANGLE, wxRICHTEXT_FIELD_STYLE_NO_BORDER, wxRICHTEXT_FIELD_STYLE_START_TAG, wxRICHTEXT_FIELD_STYLE_END_TAG.

## ◆ wxRichTextFieldTypeStandard() [2/4]

wxRichTextFieldTypeStandard::wxRichTextFieldTypeStandard | ( | const wxString & | name,
|  | const wxBitmap & | bitmap,
|  | int | displayStyle = `wxRICHTEXT_FIELD_STYLE_NO_BORDER`
| ) |  |

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

Parameters

  name | The name of the type definition. This must be unique, and is the type name used when adding a field to a control.
  bitmap | The bitmap label to be shown on the field.
  displayStyle | The display style: one of wxRICHTEXT_FIELD_STYLE_RECTANGLE, wxRICHTEXT_FIELD_STYLE_NO_BORDER, wxRICHTEXT_FIELD_STYLE_START_TAG, wxRICHTEXT_FIELD_STYLE_END_TAG.

## ◆ wxRichTextFieldTypeStandard() [3/4]

wxRichTextFieldTypeStandard::wxRichTextFieldTypeStandard | ( |  | ) |
| inline

The default constructor.

## ◆ wxRichTextFieldTypeStandard() [4/4]

wxRichTextFieldTypeStandard::wxRichTextFieldTypeStandard | ( | const wxRichTextFieldTypeStandard & | field | ) |
| inline

The copy constructor.

## Member Function Documentation

## ◆ Copy()

void wxRichTextFieldTypeStandard::Copy | ( | const wxRichTextFieldTypeStandard & | field | ) |

Copies the object.

## ◆ Draw()

virtual bool wxRichTextFieldTypeStandard::Draw | ( | wxRichTextField * | obj,
|  | wxDC & | dc,
|  | wxRichTextDrawingContext & | context,
|  | const wxRichTextRange & | range,
|  | const wxRichTextSelection & | selection,
|  | const wxRect & | rect,
|  | int | descent,
|  | int | style
| ) |  |
| virtual

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)

Implements wxRichTextFieldType.

## ◆ GetBackgroundColour()

const wxColour& wxRichTextFieldTypeStandard::GetBackgroundColour | ( |  | ) | const
| inline

Gets the colour used for drawing the field background.

## ◆ GetBitmap()

const wxBitmap& wxRichTextFieldTypeStandard::GetBitmap | ( |  | ) | const
| inline

Gets the bitmap label for fields of this type.

## ◆ GetBorderColour()

const wxColour& wxRichTextFieldTypeStandard::GetBorderColour | ( |  | ) | const
| inline

Gets the colour used for drawing the field border.

## ◆ GetDisplayStyle()

int wxRichTextFieldTypeStandard::GetDisplayStyle | ( |  | ) | const
| inline

Gets the display style for fields of this type.

## ◆ GetFont()

const wxFont& wxRichTextFieldTypeStandard::GetFont | ( |  | ) | const
| inline

Gets the font used for drawing the text label.

## ◆ GetHorizontalMargin()

int wxRichTextFieldTypeStandard::GetHorizontalMargin | ( |  | ) | const
| inline

Gets the horizontal margin surrounding the field object.

## ◆ GetHorizontalPadding()

int wxRichTextFieldTypeStandard::GetHorizontalPadding | ( |  | ) | const
| inline

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

## ◆ GetLabel()

const wxString& wxRichTextFieldTypeStandard::GetLabel | ( |  | ) | const
| inline

Returns the text label for fields of this type.

## ◆ GetRangeSize()

virtual bool wxRichTextFieldTypeStandard::GetRangeSize | ( | wxRichTextField * | obj,
|  | const wxRichTextRange & | range,
|  | wxSize & | size,
|  | int & | descent,
|  | wxDC & | dc,
|  | wxRichTextDrawingContext & | context,
|  | int | flags,
|  | const wxPoint & | position = `wxPoint(0, 0)`,
|  | const wxSize & | parentSize = `wxDefaultSize`,
|  | wxArrayInt * | partialExtents = `NULL`
| ) |  | const
| virtual

Returns the object size for the given range.

Returns false if the range is invalid for this object.

Implements wxRichTextFieldType.

## ◆ GetSize()

wxSize wxRichTextFieldTypeStandard::GetSize | ( | wxRichTextField * | obj,
|  | wxDC & | dc,
|  | wxRichTextDrawingContext & | context,
|  | int | style
| ) |  | const

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

## ◆ GetTextColour()

const wxColour& wxRichTextFieldTypeStandard::GetTextColour | ( |  | ) | const
| inline

Gets the colour used for drawing the text label.

## ◆ GetVerticalMargin()

int wxRichTextFieldTypeStandard::GetVerticalMargin | ( |  | ) | const
| inline

Gets the vertical margin surrounding the field object.

## ◆ GetVerticalPadding()

int wxRichTextFieldTypeStandard::GetVerticalPadding | ( |  | ) | const
| inline

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

## ◆ Init()

void wxRichTextFieldTypeStandard::Init | ( |  | ) |

Initialises the object.

## ◆ IsTopLevel()

virtual bool wxRichTextFieldTypeStandard::IsTopLevel | ( | wxRichTextField * | obj | ) | const
| inline virtual

Returns true if the display type is wxRICHTEXT_FIELD_STYLE_COMPOSITE, false otherwise.

Reimplemented from wxRichTextFieldType.

## ◆ Layout()

virtual bool wxRichTextFieldTypeStandard::Layout | ( | wxRichTextField * | obj,
|  | wxDC & | dc,
|  | wxRichTextDrawingContext & | context,
|  | const wxRect & | rect,
|  | const wxRect & | parentRect,
|  | int | style
| ) |  |
| virtual

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

Implements wxRichTextFieldType.

## ◆ operator=()

void wxRichTextFieldTypeStandard::operator= | ( | const wxRichTextFieldTypeStandard & | field | ) |
| inline

The assignment operator.

## ◆ SetBackgroundColour()

void wxRichTextFieldTypeStandard::SetBackgroundColour | ( | const wxColour & | colour | ) |
| inline

Sets the colour used for drawing the field background.

## ◆ SetBitmap()

void wxRichTextFieldTypeStandard::SetBitmap | ( | const wxBitmap & | bitmap | ) |
| inline

Sets the bitmap label for fields of this type.

## ◆ SetBorderColour()

void wxRichTextFieldTypeStandard::SetBorderColour | ( | const wxColour & | colour | ) |
| inline

Sets the colour used for drawing the field border.

## ◆ SetDisplayStyle()

void wxRichTextFieldTypeStandard::SetDisplayStyle | ( | int | displayStyle | ) |
| inline

Sets the display style for fields of this type.

## ◆ SetFont()

void wxRichTextFieldTypeStandard::SetFont | ( | const wxFont & | font | ) |
| inline

Sets the font used for drawing the text label.

## ◆ SetHorizontalMargin()

void wxRichTextFieldTypeStandard::SetHorizontalMargin | ( | int | margin | ) |
| inline

Sets the horizontal margin surrounding the field object.

## ◆ SetHorizontalPadding()

void wxRichTextFieldTypeStandard::SetHorizontalPadding | ( | int | padding | ) |
| inline

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

## ◆ SetLabel()

void wxRichTextFieldTypeStandard::SetLabel | ( | const wxString & | label | ) |
| inline

Sets the text label for fields of this type.

## ◆ SetTextColour()

void wxRichTextFieldTypeStandard::SetTextColour | ( | const wxColour & | colour | ) |
| inline

Sets the colour used for drawing the text label.

## ◆ SetVerticalMargin()

void wxRichTextFieldTypeStandard::SetVerticalMargin | ( | int | margin | ) |
| inline

Sets the vertical margin surrounding the field object.

## ◆ SetVerticalPadding()

void wxRichTextFieldTypeStandard::SetVerticalPadding | ( | int | padding | ) |
| inline

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

## Member Data Documentation

## ◆ m_backgroundColour

wxColour wxRichTextFieldTypeStandard::m_backgroundColour
| protected

## ◆ m_bitmap

wxBitmap wxRichTextFieldTypeStandard::m_bitmap
| protected

## ◆ m_borderColour

wxColour wxRichTextFieldTypeStandard::m_borderColour
| protected

## ◆ m_displayStyle

int wxRichTextFieldTypeStandard::m_displayStyle
| protected

## ◆ m_font

wxFont wxRichTextFieldTypeStandard::m_font
| protected

## ◆ m_horizontalMargin

int wxRichTextFieldTypeStandard::m_horizontalMargin
| protected

## ◆ m_horizontalPadding

int wxRichTextFieldTypeStandard::m_horizontalPadding
| protected

## ◆ m_label

wxString wxRichTextFieldTypeStandard::m_label
| protected

## ◆ m_textColour

wxColour wxRichTextFieldTypeStandard::m_textColour
| protected

## ◆ m_verticalMargin

int wxRichTextFieldTypeStandard::m_verticalMargin
| protected

## ◆ m_verticalPadding

int wxRichTextFieldTypeStandard::m_verticalPadding
| protected