Skip to main content

TcxEditRepositoryMemoItem Class

Declaration

TcxEditRepositoryMemoItem = class(
    TcxEditRepositoryItem
)

Remarks

A memo editor is a multi-line box that allows users to edit plain text.

VCL Editors Library: A Memo Editor Example

The TcxEditRepositoryMemoItem class overrides the Properties property that allows you to access and customize memo 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 Memo Editor Repository Item at Design Time

To create a memo 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 Memo item and click the Ok button to create a memo editor repository item.

Code Example: Shared In-Place Editor Settings

The following code example creates two unbound Table View columns in a Data Grid control and uses a memo repository item to assign an in-place memo editor to them:

uses cxEdit, cxEditRepositoryItems;
// ...
var
  AColumn1, AColumn2: TcxGridColumn;
  ARepositoryItem: TcxEditRepositoryMemoItem;
begin
  AColumn1 := cxGrid1TableView1.CreateColumn; // Creates a new unbound column
  AColumn2 := cxGrid1TableView1.CreateColumn; // Creates another unbound column
  // Creates a repository item that defines a memo editor and stores its settings
  ARepositoryItem := cxEditRepository1.CreateItem(TcxEditRepositoryMemoItem) as TcxEditRepositoryMemoItem;
  ARepositoryItem.Properties.ScrollBars := ssVertical; // Enables a vertical scroll bar
  ARepositoryItem.Properties.VisibleLineCount := 8; // Limits the number of simultaneously visible lines
  // Assigns the created repository item to both new columns
  AColumn1.RepositoryItem := ARepositoryItem;
  AColumn2.RepositoryItem := ARepositoryItem;
end;

Memo Editor Repository Item Deletion

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

If you need to delete an individual memo 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