TcxEditRepositoryItem Class
The base class for all edit repository items.
Declaration
TcxEditRepositoryItem = class(
TComponent,
IdxScaleFactor
)
Remarks
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 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.
Main API Members
The list below outlines key members of the TcxEditRepositoryItem
class that allow you to configure repository items.
- GetBaseName
- 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. - GetEditPropertiesClass
- Returns 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). - Name
- Specifies the repository item name.
- Properties
- Allows 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. - Repository
- Provides access to the repository component to which the current repository item belongs.
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.
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.
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;
Custom Editors and Repository Items
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:
- GetEditPropertiesClass
- Returns 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). - Properties
- Allows 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. - GetBaseName
- Optional. 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.
Terminal TcxEditRepositoryItem Class Descendants
Do not use the TcxEditRepositoryItem
class directly. Use the following descendants instead:
B
- TcxEditRepositoryBarCodeItem
- A repository item that stores barcode editor settings.
- TcxEditRepositoryBlobItem
- A repository item that stores BLOB (Binary Large Object) editor settings.
- TcxEditRepositoryButtonItem
- A repository item that stores button editor settings.
C
- TcxEditRepositoryCalcItem
- A repository item that stores calculator editor settings.
- TcxEditRepositoryCheckBoxItem
- A repository item that stores check box editor settings.
- TcxEditRepositoryCheckComboBox
- A repository item that stores check combo box settings.
- TcxEditRepositoryCheckGroupItem
- A repository item that stores check group settings.
- TcxEditRepositoryColorComboBox
- A repository item that stores color combo box settings.
- TcxEditRepositoryColorEdit
- A repository item that stores color editor settings.
- TcxEditRepositoryComboBoxItem
- A repository item that stores combo box settings.
- TcxEditRepositoryCurrencyItem
- A repository item that stores currency editor settings.
D
- TcxEditRepositoryDateItem
- A repository item that stores date editor settings.
- TcxEditRepositoryDateTimeWheelPickerItem
- A repository item that stores date/time wheel picker settings.
E
- 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.
F
- TcxEditRepositoryFontNameComboBox
- A repository item that stores font name combo box settings.
- TcxEditRepositoryFormattedLabel
- A repository item that stores formatted label settings.
H
I
- TcxEditRepositoryImageComboBoxItem
- An edit repository item that stores image combo box settings.
- TcxEditRepositoryImageItem
- A repository item that stores image editor settings.
L
- TcxEditRepositoryLabel
- A 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.
- TcxEditRepositoryLookupSparklineItem
- A repository item containing settings that are specific to sparkline lookup editors (TdxLookupSparklineEdit and TdxDBLookupSparklineEdit).
M
- TcxEditRepositoryMRUItem
- A repository item that stores MRU editor settings.
- TcxEditRepositoryMaskItem
- A repository item that stores mask editor settings.
- TcxEditRepositoryMemoItem
- A repository item that stores memo editor settings.
N
- TcxEditRepositoryNumericWheelPickerItem
- A repository item that stores numeric wheel picker settings.
P
- TcxEditRepositoryPopupItem
- A repository item that stores pop-up editor settings.
- TcxEditRepositoryProgressBar
- A repository item that stores progress bar settings.
R
- TcxEditRepositoryRadioGroupItem
- A repository item that stores radio group settings.
- TcxEditRepositoryRangeTrackBar
- A repository item that stores range track bar settings.
- TcxEditRepositoryRatingControl
- A repository item that stores rating control settings.
- TcxEditRepositoryRichItem
- A repository item that stores rich editor settings.
S
- TcxEditRepositorySparklineItem
- A repository item that stores sparkline settings.
- TcxEditRepositorySpinItem
- A repository item that stores spin editor settings.
T
- TcxEditRepositoryTextItem
- A repository item that stores single-line text editor settings.
- TcxEditRepositoryTimeItem
- A repository item that stores time editor settings.
- TcxEditRepositoryToggleSwitchItem
- A repository item that stores toggle switch settings.
- TcxEditRepositoryTokenItem
- A repository item that stores token editor settings.
- TcxEditRepositoryTrackBar
- A repository item that stores track bar settings.