📄 sys900_01.pas.svn-base
字号:
cbRateFormatChange(cbRateFormat);
//负数格式
S:=GetSysParams('SYS0007');
if S='' then
cbNegative.ItemIndex:=0
else
cbNegative.ItemIndex:=StrToInt(S);
cbNegativeChange(cbNegative);
//负数字体颜色
S:=GetSysParams('SYS0008');
if S='' then
cbNegaColor.Selected:=clRed
else
cbNegaColor.Selected:=StrToInt(S);
cbNegaColorChange(cbNegaColor);
//关键字段显示格式
S:=GetSysParams('SYS0009');
if S='' then
begin
cbBold.Checked:=False;
cbItalic.Checked:=False;
cbUnderline.Checked:=False;
end else
begin
cbBold.Checked:=copy(S,1,1)='1';
cbItalic.Checked:=copy(S,2,1)='1';
cbUnderline.Checked:=copy(S,3,1)='1';
end;
cbBoldClick(cbBold);
//关键字段字体颜色
S:=GetSysParams('SYS0010');
if S='' then
cbKeyColor.Selected:=clBlue
else
cbKeyColor.Selected:=StrToInt(S);
cbKeyColorChange(cbKeyColor);
//预警时间间隔
S:=GetSysParams('SYS0011');
if S='' then
dxSpinEdit1.IntValue:=60
else
dxSpinEdit1.IntValue:=StrToInt(S);
//新消息到达时显示提示信息
S:=GetSysParams('SYS0012');
if S='' then
cbAlter.Checked:=True
else
cbAlter.Checked:=S='Y';
//代理服务器地址
edtAddress.Text:=GetSysParams('SYS0013');
//代理服务器端口
edtPort.Text:=GetSysParams('SYS0014');
//升级网址
edtUrl.Text:=GetSysParams('SYS0015');
//系统关闭时自动备份数据
S:=GetSysParams('SYS0016');
if S='' then
cbAutoBackupData.Checked:=True
else
cbAutoBackupData.Checked:=S='Y';
//备份数据存放目录
edtPath.Text:=GetSysParams('SYS0017');
if edtPath.Text='' then edtPath.Text:=ExtractFilePath(Application.ExeName)+'Data\';
//自动探测系统最新版本,并提示升级
S:=GetSysParams('SYS0018');
if S='' then
cbUpdate.Checked:=True
else
cbUpdate.Checked:=S='Y';
frReport1.LoadFromFile(GetReportName('SYS900.frf'));
frReport1.ShowReport;
qrySys920.Open;
PageControl1.ActivePageIndex:=0;
end;
procedure TSys900_01Form.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
qrySys900.Close;
qrySys920.Close;
end;
procedure TSys900_01Form.bbtnOkClick(Sender: TObject);
var
S,S1,S2,S3:string;
ALangNo:string;
begin
//确定(&O)
Screen.Cursor:=crHourGlass;
SetSysParams('SYS0001',IntToStr(cbSeparator.ItemIndex)); //分隔符
SetSysParams('SYS0002',IntToStr(cbDateFormat.ItemIndex)); //日期格式
SetSysParams('SYS0003',IntToStr(cbQtyFormat.ItemIndex)); //数量格式
SetSysParams('SYS0004',IntToStr(cbPriceFormat.ItemIndex)); //单价格式
SetSysParams('SYS0005',IntToStr(cbAmountFormat.ItemIndex)); //金额格式
SetSysParams('SYS0006',IntToStr(cbRateFormat.ItemIndex)); //汇率格式
SetSysParams('SYS0007',IntToStr(cbNegative.ItemIndex)); //负数格式
SetSysParams('SYS0008',IntToStr(Integer(cbNegaColor.Selected))); //负数字体颜色
//关键字段显示格式
if cbBold.Checked then S1:='1' else S1:='0';
if cbItalic.Checked then S2:='1' else S2:='0';
if cbUnderline.Checked then S3:='1' else S3:='0';
SetSysParams('SYS0009',S1+S2+S3);
SetSysParams('SYS0010',IntToStr(Integer(cbKeyColor.Selected))); //关键字段字体颜色
SetSysParams('SYS0011',IntToStr(dxSpinEdit1.IntValue)); //预警时间间隔
//新消息到达时显示提示信息
if cbAlter.Checked then
SetSysParams('SYS0012','Y')
else
SetSysParams('SYS0012','N');
//缺省语言
SYSDM.qryLanguage.Close;
SYSDM.qryLanguage.SQL.Clear;
SYSDM.qryLanguage.SQL.Add('select * from Langs');
SYSDM.qryLanguage.Open;
while not SYSDM.qryLanguage.Eof do
begin
ALangNo:=SYSDM.qryLanguage.FieldByName('LangNo').AsString;
if cbLanguage.Text=GetDBString('LANG'+ALangNo) then
begin
WriteReg('LanguageID',SYSDM.qryLanguage.FieldByName('LangNo').Value,2);
Break;
end;
SYSDM.qryLanguage.Next;
end;
//取系统参数(关键字段字体样式及颜色)
S:=GetSysParams('SYS0009');
if copy(S,1,1)='1' then AKeyStyle:=AKeyStyle+[fsBold];
if copy(S,2,1)='1' then AKeyStyle:=AKeyStyle+[fsItalic];
if copy(S,3,1)='1' then AKeyStyle:=AKeyStyle+[fsUnderline];
if GetSysParams('SYS0010')='' then
AKeyColor:=clBlue
else
AKeyColor:=TColor(StrToInt(GetSysParams('SYS0010')));
//取得缺省语言
ALanguageID:=ReadReg('LanguageID',2);
//代理服务器地址
SetSysParams('SYS0013',trim(edtAddress.Text));
//代理服务器端口
SetSysParams('SYS0014',trim(edtPort.Text));
//升级网址
SetSysParams('SYS0015',trim(edtUrl.Text));
//设置日期格式
S:=ADateFormat[StrToInt(GetSysParams('SYS0002'))]; //日期格式
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE, ASystemDate, SizeOf(ASystemDate));
if S<>ASystemDate then
begin
LockWindowUpdate(HWND_BROADCAST);
SetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE , PChar(S));
SendMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,0);
LockWindowUpdate(0);
end;
//系统关闭时自动备份数据
if cbAutoBackupData.Checked then
SetSysParams('SYS0016','Y')
else
SetSysParams('SYS0016','N');
//备份数据存放目录
if not DirectoryExists(trim(edtPath.Text)) then
begin
ShowMsg('UMS10000253'); //备份数据存放目录不存在,请重新选择
edtPath.SetFocus;
Abort;
end;
SetSysParams('SYS0017',trim(edtPath.Text));
//自动探测系统最新版本,并提示升级
if cbUpdate.Checked then
SetSysParams('SYS0018','Y')
else
SetSysParams('SYS0018','N');
Screen.Cursor:=crDefault;
ShowMsg('UMS10000051'); //系统参数设置成功
Close;
end;
procedure TSys900_01Form.bbtnExitClick(Sender: TObject);
begin
//退出(&X)
Close;
end;
procedure TSys900_01Form.cbSeparatorChange(Sender: TObject);
var
I:Integer;
begin
//日期分隔符
I:=cbDateFormat.ItemIndex;
cbDateFormat.Clear;
if cbSeparator.Text='-' then
begin
cbDateFormat.Items.Add('yyyy-mm-dd');
cbDateFormat.Items.Add('yyyy-m-d');
cbDateFormat.Items.Add('yy-mm-dd');
cbDateFormat.Items.Add('yy-m-d');
cbDateFormat.Items.Add('mm-dd-yyyy');
cbDateFormat.Items.Add('m-d-yyyy');
cbDateFormat.Items.Add('mm-dd-yy');
cbDateFormat.Items.Add('m-d-yy');
cbDateFormat.Items.Add('dd-mm-yyyy');
cbDateFormat.Items.Add('d-m-yyyy');
cbDateFormat.Items.Add('dd-mm-yy');
cbDateFormat.Items.Add('d-m-yy');
end else if cbSeparator.Text='/' then
begin
cbDateFormat.Items.Add('yyyy/mm/dd');
cbDateFormat.Items.Add('yyyy/m/d');
cbDateFormat.Items.Add('yy/mm/dd');
cbDateFormat.Items.Add('yy/m/d');
cbDateFormat.Items.Add('mm/dd/yyyy');
cbDateFormat.Items.Add('m/d/yyyy');
cbDateFormat.Items.Add('mm/dd/yy');
cbDateFormat.Items.Add('m/d/yy');
cbDateFormat.Items.Add('dd/mm/yyyy');
cbDateFormat.Items.Add('d/m/yyyy');
cbDateFormat.Items.Add('dd/mm/yy');
cbDateFormat.Items.Add('d/m/yy');
end else if cbSeparator.Text='.' then
begin
cbDateFormat.Items.Add('yyyy.mm.dd');
cbDateFormat.Items.Add('yyyy.m.d');
cbDateFormat.Items.Add('yy.mm.dd');
cbDateFormat.Items.Add('yy.m.d');
cbDateFormat.Items.Add('mm.dd.yyyy');
cbDateFormat.Items.Add('m.d.yyyy');
cbDateFormat.Items.Add('mm.dd.yy');
cbDateFormat.Items.Add('m.d.yy');
cbDateFormat.Items.Add('dd.mm.yyyy');
cbDateFormat.Items.Add('d.m.yyyy');
cbDateFormat.Items.Add('dd.mm.yy');
cbDateFormat.Items.Add('d.m.yy');
end;
cbDateFormat.ItemIndex:=I;
case cbSeparator.ItemIndex of
0:DateSeparator:='-';
1:DateSeparator:='/';
2:DateSeparator:='.';
end;
lblDate.Caption:=FormatDateTime(cbDateFormat.Text,Now);
end;
procedure TSys900_01Form.cbDateFormatChange(Sender: TObject);
begin
//日期格式
case cbSeparator.ItemIndex of
0:DateSeparator:='-';
1:DateSeparator:='/';
2:DateSeparator:='.';
end;
lblDate.Caption:=FormatDateTime(cbDateFormat.Text,Now);
end;
procedure TSys900_01Form.cbQtyFormatChange(Sender: TObject);
begin
//数量格式
lblQty.Caption:=FormatFloat(cbQtyFormat.Text,1234);
case cbNegative.ItemIndex of
0:lblNegaQty.Caption:=FormatFloat(cbQtyFormat.Text+';-'+cbQtyFormat.Text,-1234);
1:lblNegaQty.Caption:=FormatFloat(cbQtyFormat.Text+';('+cbQtyFormat.Text+')',-1234);
end;
end;
procedure TSys900_01Form.cbPriceFormatChange(Sender: TObject);
begin
//单价格式
lblPrice.Caption:=FormatFloat(cbPriceFormat.Text,1234);
case cbNegative.ItemIndex of
0:lblNegaPrice.Caption:=FormatFloat(cbPriceFormat.Text+';-'+cbPriceFormat.Text,-1234);
1:lblNegaPrice.Caption:=FormatFloat(cbPriceFormat.Text+';('+cbPriceFormat.Text+')',-1234);
end;
end;
procedure TSys900_01Form.cbAmountFormatChange(Sender: TObject);
begin
//金额格式
lblAmount.Caption:=FormatFloat(cbAmountFormat.Text,1234);
case cbNegative.ItemIndex of
0:lblNegaAmount.Caption:=FormatFloat(cbAmountFormat.Text+';-'+cbAmountFormat.Text,-1234);
1:lblNegaAmount.Caption:=FormatFloat(cbAmountFormat.Text+';('+cbAmountFormat.Text+')',-1234);
end;
end;
procedure TSys900_01Form.cbRateFormatChange(Sender: TObject);
begin
//汇率格式
lblRate.Caption:=FormatFloat(cbRateFormat.Text,1234);
case cbNegative.ItemIndex of
0:lblNegaRate.Caption:=FormatFloat(cbRateFormat.Text+';-'+cbRateFormat.Text,-1234);
1:lblNegaRate.Caption:=FormatFloat(cbRateFormat.Text+';('+cbRateFormat.Text+')',-1234);
end;
end;
procedure TSys900_01Form.cbNegativeChange(Sender: TObject);
begin
//负数格式
case cbNegative.ItemIndex of
0:
begin
lblNegaQty.Caption:=FormatFloat(cbQtyFormat.Text+';-'+cbQtyFormat.Text,-1234);
lblNegaPrice.Caption:=FormatFloat(cbPriceFormat.Text+';-'+cbPriceFormat.Text,-1234);
lblNegaAmount.Caption:=FormatFloat(cbAmountFormat.Text+';-'+cbAmountFormat.Text,-1234);
lblNegaRate.Caption:=FormatFloat(cbRateFormat.Text+';-'+cbRateFormat.Text,-1234);
end;
1:
begin
lblNegaQty.Caption:=FormatFloat(cbQtyFormat.Text+';('+cbQtyFormat.Text+')',-1234);
lblNegaPrice.Caption:=FormatFloat(cbPriceFormat.Text+';('+cbPriceFormat.Text+')',-1234);
lblNegaAmount.Caption:=FormatFloat(cbAmountFormat.Text+';('+cbAmountFormat.Text+')',-1234);
lblNegaRate.Caption:=FormatFloat(cbRateFormat.Text+';('+cbRateFormat.Text+')',-1234);
end;
end;
end;
procedure TSys900_01Form.cbNegaColorChange(Sender: TObject);
begin
//负数字体颜色
lblNegaQty.Font.Color:=cbNegaColor.Selected;
lblNegaPrice.Font.Color:=cbNegaColor.Selected;
lblNegaAmount.Font.Color:=cbNegaColor.Selected;
lblNegaRate.Font.Color:=cbNegaColor.Selected;
end;
procedure TSys900_01Form.cbBoldClick(Sender: TObject);
begin
//关键字段显示样式
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -