vcl-cxeditrepositoryitems-2e10d42b.md
A repository item that stores image editor settings.
TcxEditRepositoryImageItem = class(
TcxEditRepositoryItem
)
An image editor can store and display an image. Image editors support clipboard operations and allow users to manage the displayed image.
The TcxEditRepositoryImageItem class overrides the Properties property that allows you to access and customize image editor settings.
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.
To create an image editor 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 the Image item and click the Ok button to create an image editor repository item.
The following code example creates an image editor repository item, customizes editor settings, and assigns the created repository item to two existing unbound image editors:
uses cxEdit, cxEditRepositoryItems;
// ...
var
AImageRepositoryItem: TcxEditRepositoryImageItem;
ARepositoryItem: TcxEditRepositoryItem;
begin
ARepositoryItem := cxEditRepository1.CreateItem(TcxEditRepositoryImageItem);
AImageRepositoryItem := ARepositoryItem as TcxEditRepositoryImageItem;
AImageRepositoryItem.FitMode := ifmFill; // Fills an editor with an image
AImageRepositoryItem.ShowFocusRect := False; // Hides the focus rectangle
// Assigns the created repository item to two existing unbound image editors
cxImage1.RepositoryItem := AImageRepositoryItem;
cxImage2.RepositoryItem := AImageRepositoryItem;
end;
#include "cxEdit.hpp"
#include "cxEditRepositoryItems.hpp"
// ...
TcxEditRepositoryImageItem *AImageRepositoryItem;
TcxEditRepositoryItem *ARepositoryItem;
// ...
ARepositoryItem = cxEditRepository1->CreateItem(__classid(TcxEditRepositoryImageItem));
AImageRepositoryItem = dynamic_cast<TcxEditRepositoryImageItem*>(ARepositoryItem);
AImageRepositoryItem->Properties->FitMode = ifmFill; // Fills an editor with an image
AImageRepositoryItem->Properties->ShowFocusRect = false; // Hides the focus rectangle
// Assigns the created repository item to two existing unbound image editors
cxImage1->RepositoryItem = AImageRepositoryItem;
cxImage2->RepositoryItem = AImageRepositoryItem;
To delete all image editor repository items in a TcxEditRepository component, call its RemoveItems procedure and pass a reference to the TcxEditRepositoryImageItem class as a parameter.
If you need to delete an individual image editor repository item, release it directly in code (call the Free procedure in Delphi or use the delete keyword in C++Builder).
TObject TPersistent TComponent TcxEditRepositoryItem TcxEditRepositoryImageItem
See Also