?? 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 + -