unit3.pas

来自「电气控制仿真软件」· PAS 代码 · 共 58 行

PAS
58
字号
unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls, vgctrl40_TLB;

type
  TForm3 = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    ListView1: TListView;
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    vgctrl : TVgctrl;
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation

{$R *.dfm}

procedure TForm3.FormShow(Sender: TObject);
var
  i, j, n : Integer;
  IsLinkLine : Boolean;
  nm, tp : String;
  li :  TListItem;
  d : IUnit;
  link : ILine;
  LinkData : ILinkData;
begin
  n := ISheet( vgctrl.ActiveSheet ).UnitCount;
  for i := 0 to n - 1 do
  begin
    d := IUnit( ISheet( vgctrl.ActiveSheet ).Units[i] );
    for j := 0 to d.LinkCount - 1 do
    begin
      LinkData := ILinkData( d.Links[j] );
      if( LinkData.LinkFrom = d )then
      begin
        li := ListView1.Items.Add;
        li.Caption := d.Name;
        li.SubItems.Add( IUnit( LinkData.LinkTo ).Name );
        li.SubItems.Add( LinkData.LinkToFoot );
      end;
    end;
  end;
end;

end.

⌨️ 快捷键说明

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