📄 xsthdysz.~pas
字号:
unit xsthdysz;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
Tf_xsthdysz = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label17: TLabel;
Label18: TLabel;
Label20: TLabel;
Label21: TLabel;
Label24: TLabel;
kcmc: TEdit;
spdm: TEdit;
spmc: TEdit;
bzq: TEdit;
sl: TEdit;
hzds: TEdit;
zk: TEdit;
thph: TEdit;
jbdw: TEdit;
je: TEdit;
GroupBox2: TGroupBox;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label15: TLabel;
Label16: TLabel;
btgd: TEdit;
btjj: TEdit;
Gridjj: TEdit;
dqfs: TComboBox;
admjj: TEdit;
timejj: TEdit;
GroupBox3: TGroupBox;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
Label14: TLabel;
SpeedButton4: TSpeedButton;
BitBtn1: TBitBtn;
FontSet: TFontDialog;
procedure thphKeyPress(Sender: TObject; var Key: Char);
procedure thphExit(Sender: TObject);
procedure hzdsKeyPress(Sender: TObject; var Key: Char);
procedure hzdsExit(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
f_xsthdysz: Tf_xsthdysz;
implementation
uses xsthbb;
{$R *.dfm}
procedure Tf_xsthdysz.thphKeyPress(Sender: TObject; var Key: Char);
var
i: Boolean;
begin
i := (Key<#8)or(Key>#8)and(Key<#46)or(Key>#46)and(Key<#48)or(Key>#57);
if i then
Key := #0;
end;
procedure Tf_xsthdysz.thphExit(Sender: TObject);
begin
if Sender is TEdit then
if Trim(TEdit(Sender).Text)<>'' then
begin
Try
StrToFloat(TEdit(Sender).Text);
Except
Application.MessageBox('请输入合法数据.','提示',64);
TEdit(Sender).Text := '1.0';
end;
if StrToFloat(TEdit(Sender).Text)=0 then
TEdit(Sender).Text := '1.0';
end
else
TEdit(Sender).Text := '1.0';
end;
procedure Tf_xsthdysz.hzdsKeyPress(Sender: TObject; var Key: Char);
var
i: Boolean;
begin
i := (Key<#8)or(Key>#8)and(Key<#48)or(Key>#57);
if i then
Key := #0;
end;
procedure Tf_xsthdysz.hzdsExit(Sender: TObject);
begin
if Sender is TEdit then
if Trim(TEdit(Sender).Text)<>'' then
begin
Try
StrToInt(TEdit(Sender).Text);
except
Application.MessageBox('请输入合法数据.','提示',64);
TEdit(Sender).Text := '5';
end;
if StrToFloat(TEdit(Sender).Text)=0 then
TEdit(Sender).Text := '5';
end
else
TEdit(Sender).Text := '5';
end;
procedure Tf_xsthdysz.BitBtn1Click(Sender: TObject);
var
i: Integer;
begin
Azdkd[0] := StrToFloat(thph.Text);
Azdkd[1] := StrToFloat(kcmc.Text);
Azdkd[2] := StrToFloat(spdm.Text);
Azdkd[3] := StrToFloat(spmc.Text);
Azdkd[4] := StrToFloat(jbdw.Text);
Azdkd[5] := StrToFloat(sl.Text);
Azdkd[6] := StrToFloat(zk.Text);
Azdkd[7] := StrToFloat(je.Text);
Azdkd[8] := StrToFloat(bzq.Text);
Sumzdkd := 0;
if (StrToInt(hzds.Text)<=0)or(StrToInt(hzds.Text)>zds)then
begin
Application.MessageBox('每行字段数不能大于表格字段数.','提示',64);
Cols := zds;
end
else
Cols := StrToInt(hzds.Text);
For i := 0 to 5 do
Sumzdkd := Sumzdkd+Azdkd[i];
Rowzdkd := Cols*(Sumzdkd/6);
with Content do
begin
TitleHeight:= StrToFloat(btgd.Text);
BtHeight:= StrToFloat(btjj.Text);
Bgjj:= StrToFloat(Gridjj.Text);
Czyjj:= StrToFloat(admjj.Text);
sjjj:= StrToFloat(timejj.Text);
Bgdqfs:= dqfs.ItemIndex;
end;
Close;
end;
procedure Tf_xsthdysz.FormCreate(Sender: TObject);
begin
thph.Text := FloatToStr(Azdkd[0]);
kcmc.Text := FloatToStr(Azdkd[1]);
spdm.Text := FloatToStr(Azdkd[2]);
spmc.Text := FloatToStr(Azdkd[3]);
jbdw.Text := FloatToStr(Azdkd[4]);
sl.Text := FloatToStr(Azdkd[5]);
zk.Text := FloatToStr(Azdkd[6]);
je.Text := FloatToStr(Azdkd[7]);
bzq.Text := FloatToStr(Azdkd[8]);
hzds.Text := IntToStr(Cols);
with Content do
begin
btgd.Text:= FloatToStr(TitleHeight);
btjj.Text:= FloatToStr(BtHeight);
Gridjj.Text:= FloatToStr(Bgjj);
admjj.Text:= FloatToStr(Czyjj);
timejj.Text:= FloatToStr(sjjj);
dqfs.ItemIndex:= Bgdqfs;
end;
end;
procedure Tf_xsthdysz.SpeedButton1Click(Sender: TObject);
begin
if FontSet.Execute = True then
with TitleFont do
begin
RFontName := FontSet.Font.Name;
RFontSize := FontSet.Font.Size;
RFontStyle := FontSet.Font.Style;
RFontColor := FontSet.Font.Color;
end;
end;
procedure Tf_xsthdysz.SpeedButton2Click(Sender: TObject);
begin
if FontSet.Execute = True then
with BtFont do
begin
RFontName := FontSet.Font.Name;
RFontSize := FontSet.Font.Size;
RFontStyle := FontSet.Font.Style;
RFontColor := FontSet.Font.Color;
end;
end;
procedure Tf_xsthdysz.SpeedButton3Click(Sender: TObject);
begin
if FontSet.Execute = True then
with BgTitleFont do
begin
RFontName := FontSet.Font.Name;
RFontSize := FontSet.Font.Size;
RFontStyle := FontSet.Font.Style;
RFontColor := FontSet.Font.Color;
end;
end;
procedure Tf_xsthdysz.SpeedButton4Click(Sender: TObject);
begin
if FontSet.Execute = True then
with BgFont do
begin
RFontName := FontSet.Font.Name;
RFontSize := FontSet.Font.Size;
RFontStyle := FontSet.Font.Style;
RFontColor := FontSet.Font.Color;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -