vcl-cxedit-caa0dd24.md
The base class for all edit repository items.
TcxEditRepositoryItem = class(
TComponent,
IdxScaleFactor
)
An edit repository item is a non-visual component designed to define an editor and store its settings. All TcxEditRepositoryItem class descendants override the Properties property to store settings specific to corresponding 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.
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.
The list below outlines key members of the TcxEditRepositoryItem class that allow you to configure repository items.
GetBaseNameGenerates the base part of the repository item name. You can override this function in custom descendants of the TcxEditRepositoryItem class to define a custom repository item name.GetEditPropertiesClassReturns the type of stored editor settings. Override this method in a TcxEditRepositoryItem class descendant to create and register a repository item component for a custom editor (a TcxCustomEdit class descendant).NameSpecifies the repository item name.PropertiesAllows you to customize stored editor settings. Override this property in a TcxEditRepositoryItem class descendant to implement type-specific settings of a custom editor derived from the TcxCustomEdit class.RepositoryProvides access to the repository component to which the current repository item belongs.
To create a repository item at design time, double-click an edit repository component to invoke its collection editor.
The collection editor dialog allows you to manage repository items. Click the Add… button to invoke a repository item creation dialog.
Select any item type and click the Ok button to create a repository item.
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;
#include "cxEdit.hpp"
#include "cxEditRepositoryItems.hpp"
// ...
TcxGridColumn *AColumn1, *AColumn2;
TcxEditRepositoryMemoItem *ARepositoryItem;
// ...
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 = dynamic_cast<TcxEditRepositoryMemoItem*>(cxEditRepository->CreateItem(__classid(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;
To store, share, and manage settings of custom TcxCustomEdit descendants in a TcxEditRepository component, you need to derive a custom descendant from the TcxEditRepositoryItem class and override the following API members:
GetEditPropertiesClassReturns the type of stored editor settings. Override this method in a TcxEditRepositoryItem class descendant to create and register a repository item component for a custom editor (a TcxCustomEdit class descendant).PropertiesAllows you to customize stored editor settings. Override this property in a TcxEditRepositoryItem class descendant to implement type-specific settings of a custom editor derived from the TcxCustomEdit class.GetBaseNameOptional. Generates the base part of the repository item name. You can override this function in custom descendants of the TcxEditRepositoryItem class to define a custom repository item name.
Do not use the TcxEditRepositoryItem class directly. Use the following descendants instead:
TcxEditRepositoryBarCodeItemA repository item that stores barcode editor settings.TcxEditRepositoryBlobItemA repository item that stores BLOB (Binary Large Object) editor settings.TcxEditRepositoryButtonItemA repository item that stores button editor settings.
TcxEditRepositoryCalcItemA repository item that stores calculator editor settings.TcxEditRepositoryCheckBoxItemA repository item that stores check box editor settings.TcxEditRepositoryCheckComboBoxA repository item that stores check combo box settings.TcxEditRepositoryCheckGroupItemA repository item that stores check group settings.TcxEditRepositoryColorComboBoxA repository item that stores color combo box settings.TcxEditRepositoryColorEditA repository item that stores color editor settings.TcxEditRepositoryComboBoxItemA repository item that stores combo box settings.TcxEditRepositoryCurrencyItemA repository item that stores currency editor settings.
TcxEditRepositoryDateItemA repository item that stores date editor settings.TcxEditRepositoryDateTimeWheelPickerItemA repository item that stores date/time wheel picker settings.
TcxEditRepositoryExtLookupComboBoxItem
A repository item that stores extended lookup combo box settings.
Warning
Do not use the TcxEditRepositoryExtLookupComboBoxItem component to share settings between multiple lookup editors. A repository item shared between multiple lookup editors binds them to the same dataset. Data update and synchronization issues may occur if two or more editors are bound to the same dataset and manage the same records.
TcxEditRepositoryFontNameComboBoxA repository item that stores font name combo box settings.TcxEditRepositoryFormattedLabelA repository item that stores formatted label settings.
TcxEditRepositoryHyperLinkItemA repository item that stores hyperlink editor settings.
TcxEditRepositoryImageComboBoxItemAn edit repository item that stores image combo box settings.TcxEditRepositoryImageItemA repository item that stores image editor settings.
TcxEditRepositoryLabelA repository item that stores unformatted label settings.TcxEditRepositoryLookupComboBoxItem
A repository item that stores lookup combo box settings.
Warning
Do not use the TcxEditRepositoryLookupComboBoxItem component to share settings between multiple lookup editors. A repository item shared between multiple lookup editors binds them to the same dataset. Data update and synchronization issues may occur if two or more editors are bound to the same dataset and manage the same records.
TcxEditRepositoryLookupSparklineItemA repository item containing settings that are specific to sparkline lookup editors (TdxLookupSparklineEdit and TdxDBLookupSparklineEdit).
TcxEditRepositoryMRUItemA repository item that stores MRU editor settings.TcxEditRepositoryMaskItemA repository item that stores mask editor settings.TcxEditRepositoryMemoItemA repository item that stores memo editor settings.
TcxEditRepositoryNumericWheelPickerItemA repository item that stores numeric wheel picker settings.
TcxEditRepositoryPopupItemA repository item that stores pop-up editor settings.TcxEditRepositoryProgressBarA repository item that stores progress bar settings.
TcxEditRepositoryRadioGroupItemA repository item that stores radio group settings.TcxEditRepositoryRangeTrackBarA repository item that stores range track bar settings.TcxEditRepositoryRatingControlA repository item that stores rating control settings.TcxEditRepositoryRichItemA repository item that stores rich editor settings.
TcxEditRepositorySparklineItemA repository item that stores sparkline settings.TcxEditRepositorySpinItemA repository item that stores spin editor settings.
TcxEditRepositoryTextItemA repository item that stores single-line text editor settings.TcxEditRepositoryTimeItemA repository item that stores time editor settings.TcxEditRepositoryToggleSwitchItemA repository item that stores toggle switch settings.TcxEditRepositoryTokenItemA repository item that stores token editor settings.TcxEditRepositoryTrackBarA repository item that stores track bar settings.
TObject TPersistent TComponent TcxEditRepositoryItem
See Also