?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, PaintGrid, Mymeter;
type
TForm1 = class(TForm)
BitBtn2: TBitBtn;
Timer1: TTimer;
Panel1: TPanel;
Image1: TImage;
PaintGrid1: TPaintGrid;
Label1: TLabel;
Label2: TLabel;
Mymeter1: TMymeter;
Mymeter2: TMymeter;
Mymeter3: TMymeter;
Edit2: TEdit;
procedure BitBtn1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
iTime:integer;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
Timer1.Enabled := Not Timer1.Enabled;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
V1,V2:integer;
begin
V1 := 50+Random(200);
V2 := 50+Random(200);
PaintGrid1.PaintTime(V1,V2);
Label1.Caption := inttostr(V1);
Label2.Caption := inttostr(V2);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
//使用示范開始
with Mymeter1 do
begin
Mymeter1.A1:=75; //定義刻度第一段的角度
A2:=15; //定義刻度第二段的角度
ColorA1:=clLime; //定義刻度第一段的色彩
ColorA2:= Clred; //定義刻度第二段的色彩
minvalue := 20.0; //最小值
maxvalue := 90.0; //最大值
strUint :='Vac';
Xwidth := Width;
YHeight := Height;
Paint;
end;
// Mymeter1.wi
//使用示范開始
with Mymeter2 do
begin
A1:=65; //定義刻度第一段的角度
A2:=25; //定義刻度第二段的角度
ColorA1:=clLime; //定義刻度第一段的色彩
ColorA2:= Clred; //定義刻度第二段的色彩
minvalue := 0.0; //最小值
maxvalue := 300.0; //最大值
strUint :='A';
Xwidth := Width;
YHeight :=Height;
Paint;
end;
//使用示范開始
with Mymeter3 do
begin
A1:=65; //定義刻度第一段的角度
A2:=25; //定義刻度第二段的角度
ColorA1:=clLime; //定義刻度第一段的色彩
ColorA2:= Clred; //定義刻度第二段的色彩
minvalue := 0; //最小值
maxvalue := 100; //最大值
strUint :='A';
Xwidth := Width;
YHeight := Height;
IstemperatureMeter:= True; //溫度儀表
Paint;
end;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
Mymeter1.MyPaint(strtofloat(edit2.Text)); //畫指針
Mymeter2.MyPaint(strtofloat(edit2.Text)); //畫指針
Mymeter3.MyPaint(strtofloat(edit2.Text)); //畫指針
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -