Back to Devexpress

TdxRichEditControlBase Class

vcl-dxrichedit-dot-control-dot-core.md

latest9.7 KB
Original Source

TdxRichEditControlBase Class

The base class for the Rich Edit control.

Declaration

delphi
TdxRichEditControlBase = class abstract(TdxVCLControl, IdxBatchUpdatable, IDropTarget, IDropSource, IdxInnerRichEditDocumentServerOwner, IdxInnerRichEditControlOwner, IdxRichEditControl, IdxRichEditDocumentLayoutProvider, IdxAITextControl)

Remarks

TdxRichEditControl is designed to create an application with a user experience inspired by Microsoft Word®.

Main API Members

The list below outlines key members of the TdxRichEditControlBase class. These members allow you to modify control appearance and behavior as well as manage documents.

Appearance and User Interaction APIs

ActiveViewProvides access to the active document View.ActiveViewTypeAllows you to switch between document Views.OnActiveViewChangedAllows you to track document View changes.OnGetAICommands

Allows you to modify the list of AI-powered commands available to users.

Note

The OnGetAICommands event can occur only if an AI service provider is registered and AI user commands are initialized.

OnReadOnlyChangedAllows you to track read-only status changes.OptionsProvides access to general appearance and behavior settings (including import/export settings for all supported document formats).ReadOnlySpecifies if the Rich Edit control is in read-only mode.ShowCaretInReadOnlySpecifies if the caret is visible in read-only mode.ViewsProvides access to all document View settings.WantTabs | WantReturnsSpecify if the Rich Edit control processes Tab and Enter keystrokes.

Action History Management

CanUndo | CanRedoIdentify if undo/redo operations are available.ClearUndoClears action history.Undo | RedoUndo/redo content changes.

Content-Related APIs

DocumentProvides access to document content. You can use this property to edit the current document in code – add/remove text, tables, floating shapes, modify formatting, etc.Copy | Cut | PastePerform clipboard operations on selected content.MeasurementUnitAllows you to switch between supported measurement units.

Selection Management APIs

DeselectAllClears selection.IsFloatingObjectSelected | IsSelectionInFooter | IsSelectionInHeader | IsSelectionInHeaderOrFooter | IsSelectionInTable | IsSelectionInTextBoxAllow you to identify selected content locations.OnSelectionChangedAllows you to track selection changes.SelectAllSelects all content.

Document Management APIs

CreateNewDocumentCloses the current document and creates a blank document.OnContentChanged | DocumentModelModifiedAllow you to track document content changes.OnDocumentClosingAllows you to respond to document close operations. For example, you can prevent users from closing a document.OnDocumentLoadedNotifies the application of a successful document load operation. A document may contain references to external resources (images, for example) that take a significant amount of time to load. You can handle this event to ensure that the document is loaded completely.OnEmptyDocumentCreatedAllows you to respond to a document create operation. For example, you can handle this event to load a specific document template as a new document.OnDocumentProtectionChangedAllows you to track document protection status changes.

Template-Based Document Generation

TdxRichEditControl and TdxRichEditDocumentServer components can generate documents based on a template with placeholders (DOCVARIABLE fields).

Tip

You can use the Options.MailMerge.DataSource property to associate the control with a dataset and use it to populate placeholders with numeric values, text, and images.

CreateMailMergeOptions | MailMergeGenerate a set of documents based on a template.OnMailMergeFinished | OnMailMergeGetTargetDocument | OnMailMergeRecordFinished | OnMailMergeRecordStarted | OnMailMergeStartedAllow you to modify template-based document generation.

Document Import and Export

The Rich Edit control allows you to import and export documents in the following formats: DOCX, RTF, DOC, HTML, and TXT.

Note

TdxRichEditControl initially includes support only for RTF and TXT formats to reduce the size of a built executable file. To add support for other formats, you need to explicitly include corresponding units in your project.

LoadDocument | LoadDocumentTemplateImport a document from a file or stream in any supported format.SaveDocumentExports the current document to a file or stream in any supported format.

Terminal TdxRichEditControlBase Class Descendant

Do not use the TdxRichEditControlBase class directly. Use TdxRichEditControl instead.

Implements

IDropTarget

IDropSource

IdxRichEditControl

Inheritance

TObject TPersistent TComponent TControl TWinControl TCustomControl TcxCustomControl TdxVCLControl TdxRichEditControlBase

See Also

TdxRichEditDocumentServer Class

TdxRichEditControlBase Members

dxRichEdit.Control.Core Unit