wxRichTextFieldType Class Reference | wxWidgets

| Version: 3.2.11

Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
wxRichTextFieldType Class Referenceabstract
Class List by Category » Rich Text

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.2/wxWidgets3.2-3.2.11-1.x86_64/src/wxWidgets-3.2.11/interface/wx/richtext/richtextbuffer.h>`

Inheritance diagram for wxRichTextFieldType:
[legend]

## Detailed Description

The base class for custom field types.

Each type definition handles one field type. Override functions to provide drawing, layout, updating and property editing functionality for a field.

Register field types on application initialisation with the static function wxRichTextBuffer::AddFieldType. They will be deleted automatically on application exit.

##

Library: wxRichText
Category: Rich Text

See also
  wxRichTextFieldTypeStandard, wxRichTextField, wxRichTextCtrl

## Public Member Functions
| wxRichTextFieldType (const wxString &name=wxEmptyString)
| Creates a field type definition.
| wxRichTextFieldType (const wxRichTextFieldType &fieldType)
| Copy constructor.
void | Copy (const wxRichTextFieldType &fieldType)
virtual bool | Draw (wxRichTextField *obj, wxDC &dc, wxRichTextDrawingContext &context, const wxRichTextRange &range, const wxRichTextSelection &selection, const wxRect &rect, int descent, int style)=0
| Draw the item, within the given range.
virtual bool | Layout (wxRichTextField *obj, wxDC &dc, wxRichTextDrawingContext &context, const wxRect &rect, const wxRect &parentRect, int style)=0
| Lay the item out at the specified position with the given size constraint.
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 =0
| Returns the object size for the given range.
virtual bool | CanEditProperties (wxRichTextField *obj) const
| Returns true if we can edit the object's properties via a GUI.
virtual bool | EditProperties (wxRichTextField *obj, wxWindow *parent, wxRichTextBuffer *buffer)
| Edits the object's properties via a GUI.
virtual wxString | GetPropertiesMenuLabel (wxRichTextField *obj) const
| Returns the label to be used for the properties context menu item.
virtual bool | UpdateField (wxRichTextBuffer *buffer, wxRichTextField *obj)
| Update the field.
virtual bool | IsTopLevel (wxRichTextField *obj) const
| Returns true if this object is top-level, i.e. contains its own paragraphs, such as a text box.
void | SetName (const wxString &name)
| Sets the field type name.
wxString | GetName () const
| Returns the field type name.
Public Member Functions inherited from wxObject
| wxObject ()
| Default ctor; initializes to NULL the internal reference data.
| wxObject (const wxObject &other)
| Copy ctor.
virtual | ~wxObject ()
| Destructor.
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).
wxObjectRefData * | GetRefData () const
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
bool | IsKindOf (const wxClassInfo *info) const
| Determines whether this class is a subclass of (or the same class as) the given class.
bool | IsSameAs (const wxObject &obj) const
| Returns true if this object has the same data pointer as obj.
void | Ref (const wxObject &clone)
| Makes this object refer to the data in clone.
void | SetRefData (wxObjectRefData *data)
| Sets the wxObject::m_refData pointer.
void | UnRef ()
| Decrements the reference count in the associated data, and if it is zero, deletes the data.
void | UnShare ()
| This is the same of AllocExclusive() but this method is public.
void | operator delete (void *buf)
| The delete operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined.
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.

## Protected Attributes
wxString | m_name
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data.

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

## Constructor & Destructor Documentation

## ◆ wxRichTextFieldType() [1/2]

wxRichTextFieldType::wxRichTextFieldType | ( | const wxString & | name = wxEmptyString | ) |
| inline

Creates a field type definition.

## ◆ wxRichTextFieldType() [2/2]

wxRichTextFieldType::wxRichTextFieldType | ( | const wxRichTextFieldType & | fieldType | ) |
| inline

Copy constructor.

## Member Function Documentation

## ◆ CanEditProperties()

virtual bool wxRichTextFieldType::CanEditProperties | ( | wxRichTextField * | obj | ) | const
| inlinevirtual

Returns true if we can edit the object's properties via a GUI.

## ◆ Copy()

void wxRichTextFieldType::Copy | ( | const wxRichTextFieldType & | fieldType | ) |
| inline

## ◆ Draw()

virtual bool wxRichTextFieldType::Draw | ( | wxRichTextField * | obj,
|  | wxDC & | dc,
|  | wxRichTextDrawingContext & | context,
|  | const wxRichTextRange & | range,
|  | const wxRichTextSelection & | selection,
|  | const wxRect & | rect,
|  | int | descent,
|  | int | style )
| pure 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)

Implemented in wxRichTextFieldTypeStandard.

## ◆ EditProperties()

virtual bool wxRichTextFieldType::EditProperties | ( | wxRichTextField * | obj,
|  | wxWindow * | parent,
|  | wxRichTextBuffer * | buffer )
| inlinevirtual

Edits the object's properties via a GUI.

## ◆ GetName()

wxString wxRichTextFieldType::GetName | ( |  | ) | const
| inline

Returns the field type name.

There should be a unique name per field type object.

## ◆ GetPropertiesMenuLabel()

virtual wxString wxRichTextFieldType::GetPropertiesMenuLabel | ( | wxRichTextField * | obj | ) | const
| inlinevirtual

Returns the label to be used for the properties context menu item.

## ◆ GetRangeSize()

virtual bool wxRichTextFieldType::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
| pure virtual

Returns the object size for the given range.

Returns false if the range is invalid for this object.

Implemented in wxRichTextFieldTypeStandard.

## ◆ IsTopLevel()

virtual bool wxRichTextFieldType::IsTopLevel | ( | wxRichTextField * | obj | ) | const
| inlinevirtual

Returns true if this object is top-level, i.e. contains its own paragraphs, such as a text box.

Reimplemented in wxRichTextFieldTypeStandard.

## ◆ Layout()

virtual bool wxRichTextFieldType::Layout | ( | wxRichTextField * | obj,
|  | wxDC & | dc,
|  | wxRichTextDrawingContext & | context,
|  | const wxRect & | rect,
|  | const wxRect & | parentRect,
|  | int | style )
| pure 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).

Implemented in wxRichTextFieldTypeStandard.

## ◆ SetName()

void wxRichTextFieldType::SetName | ( | const wxString & | name | ) |
| inline

Sets the field type name.

There should be a unique name per field type object.

## ◆ UpdateField()

virtual bool wxRichTextFieldType::UpdateField | ( | wxRichTextBuffer * | buffer,
|  | wxRichTextField * | obj )
| inlinevirtual

Update the field.

This would typically expand the field to its value, if this is a dynamically changing and/or composite field.

## Member Data Documentation

## ◆ m_name

wxString wxRichTextFieldType::m_name
| protected