//---------------------------------------------------------------------
//
// Barcode Component
//
// Copyright (c) 2014-2022 WINSOFT
//
//---------------------------------------------------------------------

unit FBarcodeE;

interface

procedure Register;

implementation

uses System.Classes, DesignEditors, DesignIntf, FBarcode;

//---------------------------------------------------------------------
//
// TSymbologyNameProperty
//

type
  TSymbologyNameProperty = class(TStringProperty)
  public
    function GetAttributes: TPropertyAttributes; override;
    procedure GetValues(Proc: TGetStrProc); override;
  end;

function TSymbologyNameProperty.GetAttributes: TPropertyAttributes;
begin
  Result := [paValueList];
end;

procedure TSymbologyNameProperty.GetValues(Proc: TGetStrProc);
var
  Barcode: TFBarcode;
  Symbology: TSymbology;
begin
  Barcode := GetComponent(0) as TFBarcode;
  for Symbology := Low(Symbology) to High(Symbology) do
    Proc(Barcode.SymbologyNames[Symbology]);
end;

procedure Register;
begin
  RegisterComponents('System', [TFBarcode]);
  RegisterPropertyEditor(TypeInfo(string), TFBarcode, 'SymbologyName', TSymbologyNameProperty);
end;

end.