Commit 81d01dcc authored by kravtsov's avatar kravtsov

[+] Добавлены TntUnicodeControls

parent 15581d87
......@@ -4,6 +4,13 @@
Company : SHTRIH-M, Russia, Moscow, Masterkova 4
(495) 787-60-90, www.shtrih-m.ru
*******************************************************************
OposShtrih_1.13_490.exe
24 мая 2018 15:20
[+] Добавлен перевод
*******************************************************************
OposShtrih_1.13_489.exe
......
......@@ -5,6 +5,8 @@ interface
Uses
// VCL
Windows, Classes, Registry, SysUtils, ComObj,
// Tnt
TntSysUtils, TntClasses, TntRegistry,
// Opos
Oposhi, VersionInfo;
......@@ -54,8 +56,8 @@ type
procedure Add(const DeviceName: WideString);
procedure Delete(const DeviceName: WideString);
procedure GetDeviceNames(DeviceNames: TStrings);
procedure GetDeviceNames2(DeviceNames: TStrings);
procedure GetDeviceNames(DeviceNames: TTntStrings);
procedure GetDeviceNames2(DeviceNames: TTntStrings);
function ReadServiceName(const DeviceName: WideString): WideString;
function ReadServiceVersion(const ProgID: WideString): WideString;
class function ProgIDToFileVersion(const ProgID: WideString): WideString;
......@@ -83,11 +85,11 @@ end;
function CLSIDToFileName(const CLSID: TGUID): String;
var
Reg: TRegistry;
Reg: TTntRegistry;
strCLSID: String;
begin
Result := '';
Reg := TRegistry.Create;
Reg := TTntRegistry.Create;
try
Reg.RootKey:= HKEY_CLASSES_ROOT;
strCLSID := GUIDToString(CLSID);
......@@ -193,10 +195,10 @@ end;
procedure TOposDevice.Add(const DeviceName: WideString);
var
Reg: TRegistry;
Reg: TTntRegistry;
KeyName: WideString;
begin
Reg := TRegistry.Create;
Reg := TTntRegistry.Create;
try
Reg.Access := KEY_ALL_ACCESS;
Reg.RootKey := HKEY_LOCAL_MACHINE;
......@@ -218,10 +220,10 @@ end;
procedure TOposDevice.Delete(const DeviceName: WideString);
var
Reg: TRegistry;
Reg: TTntRegistry;
KeyName: WideString;
begin
Reg := TRegistry.Create;
Reg := TTntRegistry.Create;
try
Reg.Access := KEY_ALL_ACCESS;
Reg.RootKey := HKEY_LOCAL_MACHINE;
......@@ -235,12 +237,12 @@ begin
end;
end;
procedure TOposDevice.GetDeviceNames(DeviceNames: TStrings);
procedure TOposDevice.GetDeviceNames(DeviceNames: TTntStrings);
var
Reg: TRegistry;
Reg: TTntRegistry;
KeyName: WideString;
begin
Reg := TRegistry.Create;
Reg := TTntRegistry.Create;
try
Reg.Access := KEY_READ;
Reg.RootKey := HKEY_LOCAL_MACHINE;
......@@ -254,11 +256,11 @@ end;
function TOposDevice.ReadServiceName(const DeviceName: WideString): WideString;
var
Reg: TRegistry;
Reg: TTntRegistry;
KeyName: WideString;
begin
Result := '';
Reg := TRegistry.Create;
Reg := TTntRegistry.Create;
try
Reg.Access := KEY_READ;
Reg.RootKey := HKEY_LOCAL_MACHINE;
......@@ -298,14 +300,14 @@ begin
end;
end;
procedure TOposDevice.GetDeviceNames2(DeviceNames: TStrings);
procedure TOposDevice.GetDeviceNames2(DeviceNames: TTntStrings);
var
i: Integer;
Reg: TRegistry;
Reg: TTntRegistry;
KeyName: WideString;
DeviceName: WideString;
begin
Reg := TRegistry.Create;
Reg := TTntRegistry.Create;
try
Reg.Access := KEY_READ;
Reg.RootKey := HKEY_LOCAL_MACHINE;
......@@ -319,7 +321,7 @@ begin
for i := 0 to DeviceNames.Count-1 do
begin
DeviceName := DeviceNames[i];
DeviceNames[i] := Format('%s, %s', [DeviceName,
DeviceNames[i] := Tnt_WideFormat('%s, %s', [DeviceName,
ReadServiceVersion(DeviceName)]);
end;
finally
......
......@@ -6,7 +6,7 @@ uses
// VCL
SysUtils,
// This
OPOS, OPOShi, WException, gnugettext;
OPOS, OPOShi, WException, TntSysUtils, gnugettext;
type
{ TOPOSError }
......@@ -76,13 +76,13 @@ implementation
procedure InvalidParameterValue(const ParamName, ParamValue: WideString);
begin
RaiseOposException(OPOS_E_ILLEGAL, Format('%s, %s=''%s''',
RaiseOposException(OPOS_E_ILLEGAL, Tnt_WideFormat('%s, %s=''%s''',
[_('Invalid parameter value'), ParamName]));
end;
procedure InvalidPropertyValue(const PropName, PropValue: WideString);
begin
RaiseOposException(OPOS_E_ILLEGAL, Format('%s, %s=''%s''',
RaiseOposException(OPOS_E_ILLEGAL, Tnt_WideFormat('%s, %s=''%s''',
[_('Invalid property value'), PropName, PropValue]));
end;
......
......@@ -6,7 +6,8 @@ uses
// VCL
SysUtils,
// This
Opos, OposUtils, Oposhi, OposFptr, OposFptrhi, OposException, gnugettext;
Opos, OposUtils, Oposhi, OposFptr, OposFptrhi, OposException, TntSysUtils,
gnugettext;
function PrinterStateToStr(Value: Integer): string;
function EncodeOposDate(const Date: TOposDate): string;
......@@ -50,10 +51,10 @@ end;
function OposFptrGetErrorText(Driver: OleVariant): string;
begin
if Driver.ResultCode = OPOS_E_EXTENDED then
Result := Format('%s %s', [
Result := Tnt_WideFormat('%s %s', [
GetResultCodeExtendedText(Driver.ResultCodeExtended), Driver.ErrorString])
else
Result := Format('%s %s', [
Result := Tnt_WideFormat('%s %s', [
GetResultCodeText(Driver.ResultCode), Driver.ErrorString])
end;
......@@ -206,7 +207,7 @@ end;
function EncodeOposDate(const Date: TOposDate): string;
begin
Result := Format('%.2d%.2d%.4d%.2d%.2d',[
Result := Tnt_WideFormat('%.2d%.2d%.4d%.2d%.2d',[
Date.Day, Date.Month, Date.Year, Date.Hour, Date.Min]);
end;
......
......@@ -9,7 +9,7 @@ uses
Opos, Oposhi, OposFptr, OposEvents, OposException, OposFptrUtils,
OposUtils,
// This
OposSemaphore, NotifyThread, LogFile, PrinterTypes, gnugettext;
OposSemaphore, NotifyThread, LogFile, PrinterTypes, TntSysUtils, gnugettext;
type
{ TOposServiceDevice19 }
......@@ -171,7 +171,7 @@ begin
FDeviceClass := ADeviceClass;
FDeviceName := ADeviceName;
FLongDeviceName := Format('%s/%s', [ADeviceClass, ADeviceName]);
FLongDeviceName := Tnt_WideFormat('%s/%s', [ADeviceClass, ADeviceName]);
FOposEvents := AOposEvents;
// State is changed to S_IDLE when the open method is successfully called.
......@@ -458,7 +458,7 @@ begin
FResultCodeExtended := OPOSError.ResultCodeExtended;
Result := FResultCode;
Line := Format('%s, %s, "%s"', [GetResultCodeText(FResultCode),
Line := Tnt_WideFormat('%s, %s, "%s"', [GetResultCodeText(FResultCode),
GetResultCodeExtendedText(FResultCodeExtended), FErrorString]);
Logger.Error(Line);
......
......@@ -5,6 +5,8 @@ interface
uses
// VCL
Windows, Classes, SysUtils, IniFiles,
// Tnt
TntClasses,
// This
StatisticItem, OposStat, MSXML, LogFile, FileUtils;
......@@ -27,7 +29,7 @@ type
function SaveToXml: string;
function GetIniFileName: string;
procedure SetItems(const Value: TStatisticItems);
procedure ParseNames(const Names: string; Strings: TStrings);
procedure ParseNames(const Names: string; Strings: TTntStrings);
function ValidItem(Item: TStatisticItem; const StatName: string): Boolean;
property Logger: ILogFile read FLogger;
......@@ -91,7 +93,7 @@ begin
Items.Add(StatisticName, stOpos);
end;
procedure TOposStatistics.ParseNames(const Names: string; Strings: TStrings);
procedure TOposStatistics.ParseNames(const Names: string; Strings: TTntStrings);
var
S: string;
P: Integer;
......@@ -130,10 +132,10 @@ end;
procedure TOposStatistics.Reset(const StatisticsBuffer: WideString);
var
i, j: Integer;
StatNames: TStrings;
StatNames: TTntStrings;
Item: TStatisticItem;
begin
StatNames := TStringList.Create;
StatNames := TTntStringList.Create;
try
ParseNames(StatisticsBuffer, StatNames);
for i := 0 to StatNames.Count-1 do
......@@ -221,11 +223,11 @@ procedure TOposStatistics.Retrieve(var StatisticsBuffer: WideString);
var
i, j: Integer;
StatName: string;
StatNames: TStrings;
StatNames: TTntStrings;
Item: TStatisticItem;
Statistics: TOposStatistics;
begin
StatNames := TStringList.Create;
StatNames := TTntStringList.Create;
Statistics := TOposStatistics.Create(Logger);
try
Statistics.Assign(Self);
......@@ -290,10 +292,10 @@ var
StatPair: string;
StatName: string;
StatValue: string;
Strings: TStrings;
Strings: TTntStrings;
Item: TStatisticItem;
begin
Strings := TStringList.Create;
Strings := TTntStringList.Create;
try
ParseNames(StatisticsBuffer, Strings);
for i := 0 to Strings.Count-1 do
......
......@@ -5,6 +5,8 @@ interface
uses
// VCL
Windows, SysUtils, Variants, ComObj,
// Tnt
TntSysUtils,
// This
Opos, PrinterEncoding, PrinterParameters, PrinterParametersX, DirectIOAPI,
OposFiscalPrinter_1_12_Lib_TLB, OposFiscalPrinter_1_13_Lib_TLB, StringUtils,
......@@ -1928,7 +1930,7 @@ var
pString: WideString;
begin
pData := Barcode.BarcodeType;
pString := Format('%s;%s;%d;%d;%d;', [
pString := Tnt_WideFormat('%s;%s;%d;%d;%d;', [
Barcode.Data,
Barcode.Text,
Barcode.Height,
......@@ -1943,7 +1945,7 @@ var
pString: WideString;
begin
pData := Barcode.BarcodeType;
pString := Format('%s;%s;%d;%d;%d;', [
pString := Tnt_WideFormat('%s;%s;%d;%d;%d;', [
StrToHexText(Barcode.Data),
Barcode.Text,
Barcode.Height,
......@@ -1958,7 +1960,7 @@ var
pString: WideString;
begin
pData := Barcode.BarcodeType;
pString := Format('%s;%s;%d;%d;%d;', [
pString := Tnt_WideFormat('%s;%s;%d;%d;%d;', [
StrToHexText(Barcode.Data),
StrToHexText(Barcode.Text),
Barcode.Height,
......@@ -2035,7 +2037,7 @@ var
pData: Integer;
begin
pData := 0;
Value := Format('%d;%d;%d', [Table, Row, Field]);
Value := Tnt_WideFormat('%d;%d;%d', [Table, Row, Field]);
Result := Driver.DirectIO(DIO_READ_TABLE, pData, Value);
end;
......
......@@ -20,28 +20,28 @@ object fmCashDrawer: TfmCashDrawer
173)
PixelsPerInch = 96
TextHeight = 13
object lblDrawerNumber: TLabel
object lblDrawerNumber: TTntLabel
Left = 8
Top = 16
Width = 100
Height = 13
Caption = 'Cash drawer number:'
end
object lblFiscalPrinterDeviceName: TLabel
object lblFiscalPrinterDeviceName: TTntLabel
Left = 8
Top = 48
Width = 127
Height = 13
Caption = 'Fiscal printer DeviceName:'
end
object lblCCOType: TLabel
object lblCCOType: TTntLabel
Left = 8
Top = 80
Width = 48
Height = 13
Caption = 'CCO type:'
end
object cbFiscalPrinterDeviceName: TComboBox
object cbFiscalPrinterDeviceName: TTntComboBox
Left = 144
Top = 48
Width = 281
......@@ -51,7 +51,7 @@ object fmCashDrawer: TfmCashDrawer
TabOrder = 1
Text = 'cbFiscalPrinterDeviceName'
end
object cbCCOType: TComboBox
object cbCCOType: TTntComboBox
Left = 144
Top = 80
Width = 281
......@@ -75,7 +75,7 @@ object fmCashDrawer: TfmCashDrawer
TabOrder = 0
Value = 0
end
object OpenDialog: TOpenDialog
object OpenDialog: TTntOpenDialog
Filter =
'Log files (*.log)|*.log|Text files (*.txt)|*.txt|All files (*.*)' +
'|*.*'
......
......@@ -6,22 +6,24 @@ uses
// VCL
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Registry, ExtCtrls, ComCtrls, Spin,
// Tnt
TntDialogs,
// Opos
OposDevice,
// This
untPages, BaseForm, untUtil, CashDrawerParameters,
PrinterParameters, CashDrawerDevice;
PrinterParameters, CashDrawerDevice, TntStdCtrls;
type
{ TfmCashDrawer }
TfmCashDrawer = class(TCashPage)
OpenDialog: TOpenDialog;
lblDrawerNumber: TLabel;
lblFiscalPrinterDeviceName: TLabel;
cbFiscalPrinterDeviceName: TComboBox;
lblCCOType: TLabel;
cbCCOType: TComboBox;
OpenDialog: TTntOpenDialog;
lblDrawerNumber: TTntLabel;
lblFiscalPrinterDeviceName: TTntLabel;
cbFiscalPrinterDeviceName: TTntComboBox;
lblCCOType: TTntLabel;
cbCCOType: TTntComboBox;
seDrawerNumber: TSpinEdit;
procedure btnDefaultsClick(Sender: TObject);
procedure btnOKClick(Sender: TObject);
......@@ -96,3 +98,5 @@ begin
end;
end.
......@@ -19,14 +19,14 @@ object fmCashInProcessing: TfmCashInProcessing
102)
PixelsPerInch = 96
TextHeight = 13
object lblCashInTextPattern: TLabel
object lblCashInTextPattern: TTntLabel
Left = 16
Top = 48
Width = 92
Height = 13
Caption = 'CashIn text pattern:'
end
object chbCashInProcessingEnabled: TCheckBox
object chbCashInProcessingEnabled: TTntCheckBox
Left = 8
Top = 8
Width = 289
......
......@@ -6,15 +6,15 @@ uses
// VCL
Controls, StdCtrls, Classes, SysUtils, ComCtrls,
// This
FiscalPrinterDevice, MalinaParams;
FiscalPrinterDevice, MalinaParams, TntStdCtrls;
type
{ TfmFptrUnipos }
TfmCashInProcessing = class(TFptrPage)
chbCashInProcessingEnabled: TCheckBox;
lblCashInTextPattern: TLabel;
edtCashInTextPattern: TEdit;
chbCashInProcessingEnabled: TTntCheckBox;
lblCashInTextPattern: TTntLabel;
edtCashInTextPattern: TTntEdit;
procedure PageChange(Sender: TObject);
public
procedure UpdatePage; override;
......@@ -46,3 +46,4 @@ end;
end.
......@@ -15,14 +15,14 @@ object fmDevice: TfmDevice
Position = poScreenCenter
PixelsPerInch = 96
TextHeight = 13
object lblDeviceName: TLabel
object lblDeviceName: TTntLabel
Left = 8
Top = 20
Width = 66
Height = 13
Caption = 'Device name:'
end
object btnOK: TButton
object btnOK: TTntButton
Left = 136
Top = 56
Width = 75
......@@ -32,7 +32,7 @@ object fmDevice: TfmDevice
ModalResult = 1
TabOrder = 1
end
object btnCancel: TButton
object btnCancel: TTntButton
Left = 216
Top = 56
Width = 75
......@@ -42,7 +42,7 @@ object fmDevice: TfmDevice
ModalResult = 2
TabOrder = 2
end
object edtDeviceName: TEdit
object edtDeviceName: TTntEdit
Left = 88
Top = 16
Width = 201
......
......@@ -7,14 +7,14 @@ uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,
// This
BaseForm;
BaseForm, TntStdCtrls;
type
TfmDevice = class(TBaseForm)
btnOK: TButton;
btnCancel: TButton;
lblDeviceName: TLabel;
edtDeviceName: TEdit;
btnOK: TTntButton;
btnCancel: TTntButton;
lblDeviceName: TTntLabel;
edtDeviceName: TTntEdit;
end;
function EditDeviceName(var DeviceName: string): Boolean;
......@@ -42,3 +42,4 @@ begin
end;
end.
......@@ -7,6 +7,8 @@ uses
StdCtrls, Controls, Classes, ComObj, SysUtils, Spin, ExtCtrls,
// 3'd
SynMemo, SynEdit,
// Tnt
TntClasses, TntStdCtrls, TntRegistry,
// This
PrinterParameters, FiscalPrinterDevice, FptrTypes, DirectIOAPI;
......@@ -15,9 +17,9 @@ type
{ TfmFiscalStorage }
TfmFiscalStorage = class(TFptrPage)
chbFSBarcodeEnabled: TCheckBox;
chbFSAddressEnabled: TCheckBox;
chbFSUpdatePrice: TCheckBox;
chbFSBarcodeEnabled: TTntCheckBox;
chbFSAddressEnabled: TTntCheckBox;
chbFSUpdatePrice: TTntCheckBox;
procedure PageChange(Sender: TObject);
public
procedure UpdatePage; override;
......@@ -48,3 +50,4 @@ begin
end;
end.
......@@ -14,21 +14,21 @@ object fmFptrBarcode: TfmFptrBarcode
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object lblBarLinePrintDelay: TLabel
object lblBarLinePrintDelay: TTntLabel
Left = 8
Top = 16
Width = 108
Height = 13
Caption = 'Bar line print delay, ms:'
end
object lblBarLineByteMode: TLabel
object lblBarLineByteMode: TTntLabel
Left = 8
Top = 48
Width = 67
Height = 13
Caption = 'Bar line mode:'
end
object Label1: TLabel
object Label1: TTntLabel
Left = 8
Top = 80
Width = 226
......@@ -42,56 +42,56 @@ object fmFptrBarcode: TfmFptrBarcode
Height = 17
Shape = bsTopLine
end
object lblBarcodePrefix: TLabel
object lblBarcodePrefix: TTntLabel
Left = 8
Top = 120
Width = 71
Height = 13
Caption = 'Barcode prefix:'
end
object lblBarcodeHeight: TLabel
object lblBarcodeHeight: TTntLabel
Left = 8
Top = 152
Width = 75
Height = 13
Caption = 'Barcode height:'
end
object lblBarcodeType: TLabel
object lblBarcodeType: TTntLabel
Left = 8
Top = 184
Width = 66
Height = 13
Caption = 'Barcode type:'
end
object lblBarcodeModuleWidth: TLabel
object lblBarcodeModuleWidth: TTntLabel
Left = 8
Top = 216
Width = 108
Height = 13
Caption = 'Barcode module width:'
end
object lblBarcodeAlignment: TLabel
object lblBarcodeAlignment: TTntLabel
Left = 8
Top = 248
Width = 91