Skip to main content

TcxEditRepositoryBarCodeItem Class

Declaration

TcxEditRepositoryBarCodeItem = class(
    TcxEditRepositoryItem
)

Remarks

A barcode editor allows you to generate a barcode or QR code from a source text string according to the selected barcode type and its settings. A barcode control has no user interaction functionality.

VCL Editors Library: A Barcode Editor Example

The TcxEditRepositoryBarCodeItem class overrides the Properties property that allows you to access and customize barcode 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 Barcode Repository Item at Design Time

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

Create a Barcode Repository Item in Code

The following code example creates a barcode repository item, selects QR Code as the barcode type, customizes its settings, and assigns the created repository item to two existing unbound barcode editors:

uses cxEdit, cxEditRepositoryItems;
// ...
var
  ABarCodeRepositoryItem: TcxEditRepositoryBarCodeItem;
  ARepositoryItem: TcxEditRepositoryItem;
  AQRCodeSymbology: TdxBarCodeQRCodeSymbology;
begin
  ARepositoryItem := cxEditRepository1.CreateItem(TcxEditRepositoryBarCodeItem);
  ABarCodeRepositoryItem := ARepositoryItem as TcxEditRepositoryBarCodeItem;
  ABarCodeRepositoryItem.Properties.BarCodeSymbologyClass := TdxBarCodeQRCodeSymbology;
  AQRCodeSymbology := ABarCodeRepositoryItem.Properties.Symbology as TdxBarCodeQRCodeSymbology;
  AQRCodeSymbology.ErrorCorrectionLevel := eclH; // Increases encoded information redundancy
  AQRCodeSymbology.CompactionMode := qrmAlphaNumeric; // Changes the information encoding mode
  // Assigns the created repository item to two existing unbound barcode editors
  dxBarCode1.RepositoryItem := ABarCodeRepositoryItem;
  dxBarCode2.RepositoryItem := ABarCodeRepositoryItem;
end;

Barcode Repository Item Deletion

To delete all barcode repository items in an edit repository component, call its RemoveItems procedure and pass a reference to the TcxEditRepositoryBarCodeItem class as a parameter.

If you need to delete an individual barcode repository item, release it directly in code (call the Free procedure in Delphi or use the delete keyword in C++Builder).

Inheritance

See Also