📄 ug_dcd.pas
字号:
unit ug_dcd;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, Grids, DBGrids, DBCtrls, StdCtrls, ExtCtrls, Buttons,u_main,
Db, DBTables;
type
Tg_dcd = class(TForm)
SpeedButton1: TSpeedButton;
Panel1: TPanel;
Shape9: TShape;
Label1: TLabel;
Label2: TLabel;
sj: TDBText;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label9: TLabel;
Label10: TLabel;
Shape2: TShape;
Shape3: TShape;
Shape4: TShape;
Shape5: TShape;
Shape6: TShape;
Label8: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Shape7: TShape;
Shape8: TShape;
Label15: TLabel;
Label16: TLabel;
Label18: TLabel;
SpeedButton2: TSpeedButton;
DBText1: TDBText;
db: TDBGrid;
sb: TStatusBar;
th: TLabel;
tht: TLabel;
krs: TLabel;
fwyh: TLabel;
skyh: TLabel;
ycrq: TLabel;
ycsj: TLabel;
xj: TLabel;
cdmx: TTable;
cdmxBh: TIntegerField;
cdmxCDBH: TStringField;
cdmxCLH: TStringField;
cdmxCh: TStringField;
cdmxCm: TStringField;
cdmxDj: TFloatField;
cdmxSl: TFloatField;
cdmxDzl: TFloatField;
cdmxHj: TFloatField;
cdmxGG: TStringField;
cdmxSRLB: TStringField;
cdmxCz: TStringField;
cdmxTcyyh: TStringField;
cdmxTCYY: TStringField;
cdmxPzrh: TStringField;
cdmxTsl: TFloatField;
cdmxLbh: TStringField;
cdmxcz1: TStringField;
d_cdmx: TDataSource;
cdmx1: TTable;
cdmx1Bh: TIntegerField;
cdmx1CDBH: TStringField;
StringField24: TStringField;
StringField25: TStringField;
StringField26: TStringField;
FloatField12: TFloatField;
FloatField13: TFloatField;
cdmx1hj: TFloatField;
cdmx1Dzl: TFloatField;
StringField27: TStringField;
StringField28: TStringField;
StringField29: TStringField;
StringField30: TStringField;
StringField31: TStringField;
cdmx1Pzrh: TStringField;
FloatField14: TFloatField;
StringField33: TStringField;
StringField34: TStringField;
d_cdmx1: TDataSource;
cdmx_cz: TTable;
cdmx_czBh: TStringField;
cdmx_czCz: TStringField;
procedure FormShow(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure dbDrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
g_dcd: Tg_dcd;
implementation
{$R *.DFM}
procedure Tg_dcd.FormShow(Sender: TObject);
begin
if not cdmx_cz.Active then cdmx_cz.Active:=true;
if not cdmx.Active then cdmx.Active:=true;
if not cdmx1.Active then cdmx1.Active:=true;
th.caption:=s_th;
tht.caption:=s_tht;
krs.caption:=s_krs;
fwyh.caption:=s_fwyh;
skyh.caption:=s_czyh;
ycrq.caption:=s_ycrq;
ycsj.caption:=s_ycsj;
xj.caption:=Format('%*.*f', [8, 2,c_xj]);;
sb.Panels[2].text:=Format('%*.*f', [8, 2,c_zj]);
sb.Panels[4].text:=Format('%*.*f', [8, 2,c_fwf]);
sb.Panels[6].text:=Format('%*.*f', [8, 2,c_zkf]);
sb.Panels[8].text:=Format('%*.*f', [8, 2,c_zsje]);
end;
procedure Tg_dcd.SpeedButton2Click(Sender: TObject);
begin
close;
end;
procedure Tg_dcd.dbDrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if db.datasource=d_cdmx1 then
begin
if cdmx1.fieldbyname('cz').value='1' then
begin
DB.Canvas.Font.Color:=clteal;
DB.DefaultDrawColumnCell(rect,datacol,column,state);
end;
if cdmx1.fieldbyname('cz').value='2' then
begin
DB.Canvas.Font.Color:=clred;
DB.DefaultDrawColumnCell(rect,datacol,column,state);
end;
if cdmx1.fieldbyname('cz').value='3' then
begin
DB.Canvas.Font.Color:=clblue;
DB.DefaultDrawColumnCell(rect,datacol,column,state);
end;
end
else
begin
if cdmx.fieldbyname('cz').value='1' then
begin
DB.Canvas.Font.Color:=clteal;
DB.DefaultDrawColumnCell(rect,datacol,column,state);
end;
if cdmx.fieldbyname('cz').value='2' then
begin
DB.Canvas.Font.Color:=clred;
DB.DefaultDrawColumnCell(rect,datacol,column,state);
end;
if cdmx.fieldbyname('cz').value='3' then
begin
DB.Canvas.Font.Color:=clblue;
DB.DefaultDrawColumnCell(rect,datacol,column,state);
end;
end;
end;
procedure Tg_dcd.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Release;
g_dcd:=NIL;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -