📄 pset.pas
字号:
unit pSet;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Mask, Db, ADODB;
type
TFormSet = class(TForm)
RadioGroupPrinter: TRadioGroup;
GroupBox1: TGroupBox;
MaskEditTwo: TMaskEdit;
MaskEditThree: TMaskEdit;
MaskEditPoint: TMaskEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
ButtonCancle: TButton;
ButtonOK: TButton;
ADOTableSet: TADOTable;
RadioGroupBarCode: TRadioGroup;
RadioGroupPort: TRadioGroup;
EditCompanyCode: TEdit;
Label4: TLabel;
procedure FormCreate(Sender: TObject);
procedure ButtonCancleClick(Sender: TObject);
procedure ButtonOKClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
sPrinter,sBarCode:String;
procedure RefreshInfo();
public
{ Public declarations }
end;
var
FormSet: TFormSet;
implementation
uses PDataModuleMain, PBarCodePrinter, PPublic;
{$R *.DFM}
procedure TFormSet.FormCreate(Sender: TObject);
begin
ADOTableSet.Connection:=DataModuleMain.ADOConnectionBarCode;;
ADOTableSet.TableName:='system';
ADOTableSet.Open;
MaskEditTwo.Text:=ADOTableSet.FieldByName('HeNo1').AsString;
MaskEditThree.Text:=ADOTableSet.FieldByName('HeNo2').AsString;
MaskEditPoint.Text:=ADOTableSet.FieldByName('Point').AsString;
RadioGroupBarCode.ItemIndex:=ADOTableSet.FieldByName('BarCode').AsInteger;
RadioGroupPrinter.ItemIndex:=ADOTableSet.FieldByName('Printer').AsInteger;
RadioGroupPort.ItemIndex:=ADOTableSet.FieldByName('Port').AsInteger;
EditCompanyCode.Text:=BarCodePrinter.sCompanyCode;
end;
procedure TFormSet.ButtonCancleClick(Sender: TObject);
begin
Close;
end;
procedure TFormSet.ButtonOKClick(Sender: TObject);
begin
ADOTableSet.Edit;
ADOTableSet.FieldByName('HeNo1').AsString:=MaskEditTwo.EditText;
ADOTableSet.FieldByName('HeNo2').AsString:=MaskEditThree.EditText;
ADOTableSet.FieldByName('Point').AsString:=MaskEditPoint.EditText;
ADOTableSet.FieldByName('BarCode').AsInteger:=RadioGroupBarCode.ItemIndex;
ADOTableSet.FieldByName('Printer').AsInteger:=RadioGroupPrinter.ItemIndex;
ADOTableSet.FieldByName('Port').AsInteger:=RadioGroupPort.ItemIndex;
ADOTableSet.Post;
RefreshInfo();
Close;
end;
procedure TFormSet.RefreshInfo();
begin
BarCodePrinter.nBarCode:=RadioGroupBarCode.ItemIndex;
BarCodePrinter.nPort:=RadioGroupPort.ItemIndex;
BarCodePrinter.nPrinter:=RadioGroupPrinter.ItemIndex;
BarCodePrinter.sCompanyCode:=UpperCase(EditCompanyCode.Text);
if RadioGroupPrinter.ItemIndex=1 then
sPrinter:='条码打印机'
else
sPrinter:='普通打印机';
if RadioGroupBarCode.ItemIndex=1 then
sBarCode:='128码'
else
sBarCode:='39码';
BarCodePrinter.StatusBarMain.SimpleText:=UserName+'***'+sPrinter+'***'+sBarCode;
end;
procedure TFormSet.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ADOTableSet.Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -