⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.~pas

📁 《Kylix程序设计》一书中附带的例程源代码
💻 ~PAS
字号:
unit Main;interfaceuses  SysUtils, Types, Classes, Variants, QGraphics, QControls, QForms, QDialogs,  QStdCtrls, QExtCtrls;type  TFrmMain = class(TForm)    BtnShow: TButton;    RadGrpClassType: TRadioGroup;    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;  Point, ToPoint: TPoint;  Rect: TRect;  Shape: TGeoShape;begin  X := 10;  Y := 10;  case RadGrpClassType.ItemIndex of    0: // TGeoShape    begin      Shape := TGeoShape.Create();      Shape.Draw( Canvas );      FreeAndNil( Shape );    end;    1: // TGeoPoint    begin      Point.X := 10;      Point.Y := 50;      Shape := TGeoPoint.Create();      TGeoPoint( Shape ).SetValue( Point );      Shape.Draw( Canvas );      FreeAndNil( Shape );    end;    2: // TGeoLine    begin      Point.X := 10;      Point.Y := 50;      ToPoint.X := 200;      ToPoint.Y := 50;      Shape := TGeoLine.Create();      TGeoLine( Shape ).SetValue( Point, ToPoint );      Shape.Draw( Canvas );      FreeAndNil( Shape );    end;    3: // TGeoRect    begin      Rect.Left := 10;      Rect.Top := 10;      Rect.Right := 200;      Rect.Bottom := 200;      Shape := TGeoRect.Create();      TGeoRect( Shape ).SetValue( Rect );      Shape.Draw( Canvas );      FreeAndNil( Shape );    end;  end;end;end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -