TreeForm.pas
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:4k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit TreeForm;
  2. interface
  3. uses
  4.   SysUtils, Qt, Classes, QGraphics, QControls, QForms, QDialogs,
  5.   QStdCtrls, QComCtrls, QMenus, QTypes;
  6. type
  7.   TForm1 = class(TForm)
  8.     TreeView1: TTreeView;
  9.     MainMenu1: TMainMenu;
  10.     Options1: TMenuItem;
  11.     File1: TMenuItem;
  12.     Exit1: TMenuItem;
  13.     Help1: TMenuItem;
  14.     About1: TMenuItem;
  15.     Root1: TMenuItem;
  16.     Buttons1: TMenuItem;
  17.     Lines1: TMenuItem;
  18.     N1: TMenuItem;
  19.     Font1: TMenuItem;
  20.     FontDialog1: TFontDialog;
  21.     procedure FormCreate(Sender: TObject);
  22.     procedure About1Click(Sender: TObject);
  23.     procedure Root1Click(Sender: TObject);
  24.     procedure Buttons1Click(Sender: TObject);
  25.     procedure Lines1Click(Sender: TObject);
  26.     procedure Exit1Click(Sender: TObject);
  27.     procedure Font1Click(Sender: TObject);
  28.     procedure TreeView1DragOver(Sender, Source: TObject; X, Y: Integer;
  29.       State: TDragState; var Accept: Boolean);
  30.     procedure TreeView1DragDrop(Sender, Source: TObject; X, Y: Integer);
  31.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  32.     procedure TreeView1MouseDown(Sender: TObject; Button: TMouseButton;
  33.       Shift: TShiftState; X, Y: Integer);
  34.   private
  35.     { Private declarations }
  36.   public
  37.     { Public declarations }
  38.   end;
  39. var
  40.   Form1: TForm1;
  41. implementation
  42. {$R *.xfm}
  43. procedure TForm1.FormCreate(Sender: TObject);
  44. begin
  45.   TreeView1.LoadFromFile (
  46.     ExtractFilePath (Application.ExeName) + 'TreeText.txt');
  47. end;
  48. procedure TForm1.About1Click(Sender: TObject);
  49. begin
  50.   MessageDlg ('DragTree Example'#13'by Marco Cant