Skip to main content
A newer version of this page is available. .

TcxEditRepository Class

A collection of repository items that define editors and their settings.

Declaration

TcxEditRepository = class(
    TcxScalableComponent
)

Remarks

The TcxEditRepository class implements a non-visual component designed to store and manage edit repository items that store 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

Available Edit Repository Item Types

Every repository item type (a TcxEditRepositoryItem class descendant) defines the corresponding in-place editor type and stores its settings accessible through the Properties property. The following table lists all available edit repository items and corresponding in-place editor classes:

Repository Item Type In-Place Editor Description
TcxEditRepositoryBarCodeItem TdxBarCode A barcode control without user input functionality.
TcxEditRepositoryBlobItem TcxBlobEdit A Binary Large Object (BLOB) editor.
TcxEditRepositoryButtonItem TcxButtonEdit A single-line text editor with embedded buttons.
TcxEditRepositoryCalcItem TcxCalcEdit A single-line editor with a drop-down calculator window.
TcxEditRepositoryCheckBoxItem TcxCheckBox A check box editor with support for three states.
TcxEditRepositoryCheckComboBox TcxCheckComboBox A combo box editor that can display items with check boxes.
TcxEditRepositoryCheckGroupItem TcxCheckGroup An editor designed to display a set of check boxes.
TcxEditRepositoryColorComboBox TcxColorComboBox A color combo box editor.
TcxEditRepositoryColorEdit TdxColorEdit An editor designed to select a color in a color gallery embedded into a drop-down window.
TcxEditRepositoryComboBoxItem TcxComboBox A general-purpose combo box editor.
TcxEditRepositoryCurrencyItem TcxCurrencyEdit A numeric editor for currency values.
TcxEditRepositoryDateItem TcxDateEdit A date editor with a drop-down calendar.
TcxEditRepositoryDateTimeWheelPickerItem TdxDateTimeWheelPicker A date/time wheel picker editor.
TcxEditRepositoryExtLookupComboBoxItem TcxExtLookupComboBox A lookup editor that displays a Data Grid View in a drop-down window.
TcxEditRepositoryFontNameComboBox TcxFontNameComboBox A combo box that allows users to switch between font typefaces.
TcxEditRepositoryFormattedLabel TdxFormattedLabel A formatted label editor without user input functionality.
TcxEditRepositoryHyperLinkItem TcxHyperLinkEdit A hyperlink editor that can execute custom commands.
TcxEditRepositoryImageComboBoxItem TcxImageComboBox A combo box whose items can display text and images.
TcxEditRepositoryImageItem TcxImage An editor designed to display images.
TcxEditRepositoryLabel TcxLabel An unformatted label editor without user input functionality.
TcxEditRepositoryLookupComboBoxItem TcxLookupComboBox A lookup combo box populated with values from a data source.
TcxEditRepositoryLookupSparklineItem TdxLookupSparklineEdit A lookup sparkline editor.
TcxEditRepositoryMRUItem TcxMRUEdit A single-line text editor that displays a list of most recently used (MRU) items in a drop-down window.
TcxEditRepositoryMaskItem TcxMaskEdit A single-line text editor with support for input masks.
TcxEditRepositoryMemoItem TcxMemo A multi-line editor for plain text.
TcxEditRepositoryNumericWheelPickerItem TdxNumericWheelPicker A numeric value wheel picker editor.
TcxEditRepositoryPopupItem TcxPopupEdit A text editor that can embed a control in a drop-down window.
TcxEditRepositoryProgressBar TcxProgressBar A progress bar without user input functionality.
TcxEditRepositoryRadioGroupItem TcxRadioGroup A container for radio buttons.
TcxEditRepositoryRangeTrackBar TdxRangeTrackBar A track bar editor with two sliders that allow users to select a value range.
TcxEditRepositoryRatingControl TdxRatingControl A rating control.
TcxEditRepositoryRichItem TcxRichEdit A multi-line rich text editor.
TcxEditRepositorySparklineItem TdxSparklineEdit An editor that visualizes data as lightweight charts without axes and labels.
TcxEditRepositorySpinItem TcxSpinEdit A general-purpose numeric spin editor.
TcxEditRepositoryTextItem TcxTextEdit A simple single-line text editor.
TcxEditRepositoryTimeItem TcxTimeEdit A spin editor for time values.
TcxEditRepositoryToggleSwitchItem TdxToggleSwitch A toggle switch editor.
TcxEditRepositoryTokenItem TdxTokenEdit A token editor.
TcxEditRepositoryTrackBar TcxTrackBar A track bar editor with two sliders for value range selection.

Main API Members

The list below outlines key members of the TcxEditRepository class that allow you to manage edit repository items.

  • Create new repository items (CreateItem and CreateItemEx).
  • Obtain the number of stored repository items (Count).
  • Access individual repository items by their indexes (Items).
  • Search stored repository items by their names (ItemByName).
  • Destroy all repository items of the specified type (RemoveItems).
  • Clear the repository (Clear).

Create a Repository Item at Design Time

To create a repository item at design time, double-click an edit repository 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 any item type and click the Ok button to create a 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 := TcxEditRepositoryMemoItem(cxEditRepository1.CreateItem(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;
See Also