📄 main.pas
字号:
unit Main;interfaceuses SysUtils, Types, Classes, Variants, QGraphics, QControls, QForms, QDialogs, QStdCtrls, QExtCtrls;type TFrmMain = class(TForm) BtnShow: TButton; procedure BtnShowClick(Sender: TObject); private { Private declarations } public { Public declarations } end;var FrmMain: TFrmMain;implementationuses Shapes;{$R *.xfm}procedure TFrmMain.BtnShowClick(Sender: TObject);var X, Y: Integer; str: string; Shape: TGeoShape; Point: TGeoPoint; Line: TGeoLine;begin X := 10; Y := 10; Shape := TGeoShape.Create(); str := Shape.Draw(); Canvas.TextOut( X, Y, '(TGeoShape)Shape:' ); Canvas.TextOut( X+270, Y, str ); FreeAndNil( Shape ); Inc( Y, 25 ); Point := TGeoPoint.Create(); str := Point.Draw(); Canvas.TextOut( X, Y, '(TGeoPoint)Point:' ); Canvas.TextOut( X+270, Y, str ); FreeAndNil( Point ); Inc( Y, 25 ); Line := TGeoLine.Create(); str := Line.Draw(); Canvas.TextOut( X, Y, '(TGeoLine)Line:' ); Canvas.TextOut( X+270, Y, str ); FreeAndNil( Line ); Inc( Y, 25 ); Shape := TGeoPoint.Create(); str := Shape.Draw(); Canvas.TextOut( X, Y, '(TGeoPoint)Shape:' ); Canvas.TextOut( X+270, Y, str ); FreeAndNil( Shape ); Inc( Y, 25 ); Shape := TGeoPoint.Create(); str := TGeoPoint( Shape ).Draw(); Canvas.TextOut( X, Y, '(TGeoPoint)TGeoPoint(Shape):' ); Canvas.TextOut( X+270, Y, str ); FreeAndNil( TGeoPoint( Shape ) ); Inc( Y, 25 );end;end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -