home *** CD-ROM | disk | FTP | other *** search
- unit Infoform;
- interface
- uses
- {$IFDEF WIN32}
- Windows,
- {$ELSE}
- WinTypes, WinProcs,
- {$ENDIF}
- SysUtils, Messages, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls,
- StdCtrls, Buttons, Grids;
-
- Type
- TInformationFrm = class(TForm)
- Panel1: TPanel;
- Image1: TImage;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- StringGrid1: TStringGrid;
- BitBtn1: TBitBtn;
- BitBtn2: TBitBtn;
- procedure FormActivate(Sender: TObject);
- procedure CheckOut(Sender: TObject);
- end;
-
- {$IFDEF WIN32}
- Var
- {$ELSE}
- Const
- {$ENDIF}
- InformationFrm: TInformationFrm = nil;
-
- implementation
- uses ExptIntf;
-
- {$R *.DFM}
-
- procedure TInformationFrm.FormActivate(Sender: TObject);
- var FormCount,UnitCount,i,j: Integer;
- FormName,UnitName: String;
- begin
- StringGrid1.RowCount := 10;
- StringGrid1.Cells[0,0] := 'units: 0';
- StringGrid1.Cells[1,0] := 'forms: 0';
- if ToolServices <> nil then
- begin
- FormCount := ToolServices.GetFormCount;
- UnitCount := ToolServices.GetUnitCount;
- if UnitCount >= StringGrid1.RowCount then
- StringGrid1.RowCount := Succ(Succ(UnitCount));
- FormName := ToolServices.GetProjectName
- end
- else
- begin
- FormCount := 0;
- UnitCount := -1;
- FormName := ''
- end;
- StringGrid1.Cells[1,0] := Format('forms: %d',[FormCount]);
- Label3.Caption := ExtractFileName(FormName);
- Label4.Caption := FormName;
- {$IFDEF WIN32}
- StringGrid1.Cells[0,0] := Format('units: %d',[UnitCount-1]);
- for i:=1 to Pred(UnitCount) do
- {$ELSE}
- StringGrid1.Cells[0,0] := Format('units: %d',[UnitCount+1]);
- for i:=0 to UnitCount do
- {$ENDIF}
- begin
- UnitName := ToolServices.GetUnitName(i);
- UnitName := UpperCase(ExtractFileName(UnitName));
- StringGrid1.Cells[0,i+1] := UnitName;
- if (Pos('.PAS',UnitName) > 0) then
- begin
- j := 0;
- repeat
- FormName := ToolServices.GetFormName(j);
- FormName := UpperCase(ExtractFileName(FormName));
- if FormName = ChangeFileExt(UnitName,'.DFM') then
- begin
- StringGrid1.Cells[1,i+1] := FormName;
- j := FormCount
- end
- else Inc(j)
- until j >= FormCount
- end
- else
- StringGrid1.Cells[1,i+1] := '-'
- end
- end;
-
- procedure TInformationFrm.CheckOut(Sender: TObject);
- begin
- { CheckOutViCiouS(StringGrid1.Row) }
- end;
-
- end.
-