📄 dysz.~pas
字号:
unit dysz;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls;
type
Tf_dysz = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
kcmc: TEdit;
spdm: TEdit;
spmc: TEdit;
bzq: TEdit;
sl: TEdit;
je: TEdit;
Panel1: TPanel;
BitBtn1: TBitBtn;
GroupBox2: TGroupBox;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
btgd: TEdit;
btjj: TEdit;
Gridjj: TEdit;
dqfs: TComboBox;
GroupBox3: TGroupBox;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
FontSet: TFontDialog;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
Label14: TLabel;
SpeedButton4: TSpeedButton;
Label15: TLabel;
Label16: TLabel;
admjj: TEdit;
timejj: TEdit;
procedure kcmcKeyPress(Sender: TObject; var Key: Char);
procedure BitBtn1Click(Sender: TObject);
procedure kcmcExit(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_dysz: Tf_dysz;
implementation
uses spdy;
{$R *.dfm}
procedure Tf_dysz.kcmcKeyPress(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_dysz.BitBtn1Click(Sender: TObject);
begin
with zdkd do
begin
Rkcmc := StrToFloat(kcmc.Text);
Rspdm := StrToFloat(spdm.Text);
Rspmc := StrToFloat(spmc.Text);
Rbzq := StrToFloat(bzq.Text);
Rsl := StrToFloat(sl.Text);
Rje := StrToFloat(je.Text);
Sumzdkd := Rkcmc+Rspdm+Rspmc+Rbzq+Rsl+Rje;
end;
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_dysz.kcmcExit(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_dysz.FormCreate(Sender: TObject);
begin
kcmc.Text := FloatToStr(zdkd.Rkcmc);
spdm.Text := FloatToStr(zdkd.Rspdm);
spmc.Text := FloatToStr(zdkd.Rspmc);
bzq.Text := FloatToStr(zdkd.Rbzq);
sl.Text := FloatToStr(zdkd.Rsl);
je.Text:= FloatToStr(zdkd.Rje );
with Content do
begin
btgd.Text:= FloatToStr(TitleHeight);
btjj.Text:= FloatToStr(BtHeight);
Gridjj.Text:= FloatToStr(Bgjj);
admjj.Text:= FloatToStr(Czyjj);
timejj.Text:= FloatToStr(sjjj);
Bgdqfs:= dqfs.ItemIndex;
end;
end;
procedure Tf_dysz.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_dysz.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_dysz.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_dysz.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 + -