#include </home/zeitlin/src/wx/github/interface/wx/richtext/richtextbuffer.h>
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 wxRichTextParagraphLayoutBox::AddFieldType. They will be deleted automatically on application exit.
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, wxPoint position=wxPoint(0, 0), wxArrayInt *partialExtents=NULL) const =0 |
Returns the object size for the given range. | |
virtual bool | CanEditProperties (wxRichTextField *WXUNUSED(obj)) const |
Returns true if we can edit the object's properties via a GUI. | |
virtual bool | EditProperties (wxRichTextField *WXUNUSED(obj), wxWindow *WXUNUSED(parent), wxRichTextBuffer *WXUNUSED(buffer)) |
Edits the object's properties via a GUI. | |
virtual wxString | GetPropertiesMenuLabel (wxRichTextField *WXUNUSED(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 *WXUNUSED(obj)) const |
Returns true if this object is top-level, i.e. | |
void | SetName (const wxString &name) |
Sets the field type name. | |
wxString | GetName () const |
Returns the field type name. | |
Protected Attributes | |
wxString | m_name |
wxRichTextFieldType::wxRichTextFieldType | ( | const wxString & | name = wxEmptyString | ) | [inline] |
Creates a field type definition.
wxRichTextFieldType::wxRichTextFieldType | ( | const wxRichTextFieldType & | fieldType | ) | [inline] |
Copy constructor.
virtual bool wxRichTextFieldType::CanEditProperties | ( | wxRichTextField * | WXUNUSEDobj | ) | const [inline, virtual] |
Returns true if we can edit the object's properties via a GUI.
void wxRichTextFieldType::Copy | ( | const wxRichTextFieldType & | fieldType | ) | [inline] |
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.
virtual bool wxRichTextFieldType::EditProperties | ( | wxRichTextField * | WXUNUSEDobj, |
wxWindow * | WXUNUSEDparent, | ||
wxRichTextBuffer * | WXUNUSEDbuffer | ||
) | [inline, virtual] |
Edits the object's properties via a GUI.
wxString wxRichTextFieldType::GetName | ( | ) | const [inline] |
Returns the field type name.
There should be a unique name per field type object.
virtual wxString wxRichTextFieldType::GetPropertiesMenuLabel | ( | wxRichTextField * | WXUNUSEDobj | ) | const [inline, virtual] |
Returns the label to be used for the properties context menu item.
virtual bool wxRichTextFieldType::GetRangeSize | ( | wxRichTextField * | obj, |
const wxRichTextRange & | range, | ||
wxSize & | size, | ||
int & | descent, | ||
wxDC & | dc, | ||
wxRichTextDrawingContext & | context, | ||
int | flags, | ||
wxPoint | position = wxPoint(0, 0) , |
||
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.
virtual bool wxRichTextFieldType::IsTopLevel | ( | wxRichTextField * | WXUNUSEDobj | ) | const [inline, virtual] |
Returns true if this object is top-level, i.e.
contains its own paragraphs, such as a text box.
Reimplemented in wxRichTextFieldTypeStandard.
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. 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.
void wxRichTextFieldType::SetName | ( | const wxString & | name | ) | [inline] |
Sets the field type name.
There should be a unique name per field type object.
virtual bool wxRichTextFieldType::UpdateField | ( | wxRichTextBuffer * | buffer, |
wxRichTextField * | obj | ||
) | [inline, virtual] |
Update the field.
This would typically expand the field to its value, if this is a dynamically changing and/or composite field.
wxString wxRichTextFieldType::m_name [protected] |