(TBarcode1D_Code128, TBarcode1D_EAN128)
For the TBarcode1D_Code128 and TBarcode1D_EAB128 components, occurs when the value of Barcode property is changed and the component is updating its barcode symbol, or one of the Clear, Draw, Size, DrawTo, DrawToSize, Print, PrintSize method is called.
The TBarcode1D_Code128 and TBarcode1D_EAB128 components can be used to encode any character, by default, the ANSI encoding scheme is used. The event is useful if you want to encode the barcode text in your own encoding scheme before generate the barcode symbol. See also the "How to encode the UNICODE text in a Code128/EAN128 symbol" article.
type
{ Defined in the pCode128 unit }
TOnEncode = procedure (Sender: TObject; var Data: AnsiString; Barcode: string) of object;
property OnEncode: TOnEncode;
The initial value is the barcode text in AnsiString (the barcode text will be converted to AnsiSring if the UNICODE string is supported by the Delphi or C++ Builder). By default, it's in ANSI encoding scheme.
Its value is equal to the Barcode property if the Clear, Draw, Size, DrawTo (syntax 1), DrawToSize (syntax 1), Print (syntax 1), or PrintSize (syntax 1) method is called or a component is updating its barcode symbol. And the value of the parameter is equal to the Barcode parameter if the DrawTo (syntax 2), DrawToSize (syntax 2), Print (syntax 2), or PrintSize (syntax 2) method is called.
The event doesn't occur when the DrawTo (syntax 3), DrawToSize (syntax 3), Print (syntax 3), or PrintSize (syntax 3) method is called.