Skip to main content

TcxEditRepositoryRichItem Class

Declaration

TcxEditRepositoryRichItem = class(
    TcxEditRepositoryItem
)

Remarks

A rich text editor allows users to view and edit rich-formatted text.

VCL Editors Library: A Rich Text Editor Example

The TcxEditRepositoryRichItem class overrides the Properties property that allows you to access and customize rich editor settings.

Edit Repository Items and Standalone Editors

Edit repository items are useful when you need to share the same settings between multiple editors of the same type. To accomplish this goal, you can assign the same edit repository item to RepositoryItem properties of all target editors.

Edit Repository Items and Container Controls

A container control item (such as a toolbar edit item or a column (or any other data item) in a Data Grid, Vertical Grid, or Tree List control) can embed an in-place editor shipped with the ExpressEditors Library. An in-place editor exists (and, therefore, has its own WinAPI handle) only when the target container control item is being edited. Otherwise, the container control item displays a static editor image for resource usage optimization.

VCL Tree List: An In-Place Date Editor

Create a Rich Editor Repository Item at Design Time

To create a rich editor repository item at design time, double-click a TcxEditRepository component to invoke its collection editor.

VCL Editors Library: An Edit Repository Collection Editor

The collection editor dialog allows you to manage repository items. Click the Add… button to invoke a repository item creation dialog.

VCL Editors Library: An Edit Repository Item Creation Dialog

Select the RichEdit item and click the Ok button to create a rich editor repository item.

Create a Label Repository Item in Code

The following code example creates a label repository item, customizes label settings, and assigns the created repository item to two unbound labels:

uses cxEdit, cxExtEditRepositoryItems;
// ...
var
  ARichEditRepositoryItem: TcxEditRepositoryRichItem;
  ARepositoryItem: TcxEditRepositoryItem;
begin
  ARepositoryItem := cxEditRepository1.CreateItem(TcxEditRepositoryRichItem);
  ARichEditRepositoryItem := ARepositoryItem as TcxEditRepositoryRichItem;
  ARichEditRepositoryItem.Properties.ScrollBars := ssVertical; // Enables a vertical scroll bar
  ARichEditRepositoryItem.Properties.VisibleLineCount := 8; // Limits the number of simultaneously visible lines
  ALabelRepositoryItem.Properties.Angle := 45; // Rotates labels counterclockwise
  ALabelRepositoryItem.Properties.WordWrap := True; // Enables word wrap
  // Assigns the created repository item to two existing unbound rich text editors
  cxRichEdit1.RepositoryItem := ARichEditRepositoryItem;
  cxRichEdit2.RepositoryItem := ARichEditRepositoryItem;
end;

Rich Editor Repository Item Deletion

To delete all rich editor repository items in a TcxEditRepository component, call its RemoveItems procedure and pass a reference to the TcxEditRepositoryRichItem class as a parameter.

If you need to delete an individual rich editor repository item, release it directly in code (call the Free procedure in Delphi or use the delete keyword in C++Builder).

Inheritance

See Also