home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / ysfl12.zip / FILES1.ZIP / youseful.pas < prev    next >
Pascal/Delphi Source File  |  1995-08-10  |  3KB  |  89 lines

  1. unit Youseful;
  2.  
  3. interface
  4.  
  5. uses
  6.   Classes,SysUtils,DsgnIntF,Install,IdWG,IdRS,IdFG,IdCF,IdGI,RptMan,Rpt2,
  7.   UI,UiDF,YsflTool,Dialogs,WinProcs,WinTypes,Forms,IdCS;
  8.  
  9. procedure Register;
  10.  
  11. implementation
  12.  
  13. uses
  14.   FileCtrl;
  15.  
  16. type
  17.   TRptManDirProperty = class(TStringProperty)
  18.   public
  19.     function GetAttributes: TPropertyAttributes; override;
  20.     procedure Edit; override;
  21.   end;
  22.  
  23.   TDLLFileNameProperty = class(TStringProperty)
  24.   public
  25.     function GetAttributes: TPropertyAttributes; override;
  26.     procedure Edit; override;
  27.   end;
  28.  
  29. function TRptManDirProperty.GetAttributes: TPropertyAttributes;
  30. begin
  31.   Result := (inherited GetAttributes) + [paDialog];
  32. end;
  33.  
  34. procedure TRptManDirProperty.Edit;
  35. var
  36.   Dir: String;
  37. begin
  38.   Dir := GetStrValue;
  39.   if SelectDirectory(Dir,[],0) then
  40.     SetStrValue(Dir);
  41. end;
  42.  
  43. function TDLLFileNameProperty.GetAttributes: TPropertyAttributes;
  44. begin
  45.   Result := (inherited GetAttributes) + [paDialog];
  46. end;
  47.  
  48. procedure TDLLFileNameProperty.Edit;
  49. var
  50.   OpenDialog: TOpenDialog;
  51.   szSystemDir: array[0..255] of Char;
  52.   SystemDir: String;
  53. begin
  54.   OpenDialog := TOpenDialog.Create(Application);
  55.   try
  56.     GetSystemDirectory(szSystemDir,255);
  57.     SystemDir := StrPas(szSystemDir);
  58.     OpenDialog.DefaultExt := 'DLL';
  59.     OpenDialog.Filter := 'DLL Files|*.DLL';
  60.     OpenDialog.InitialDir := SystemDir;
  61.     if OpenDialog.Execute then SetValue(OpenDialog.FileName);
  62.   finally
  63.     OpenDialog.Free;
  64.   end;
  65. end;
  66.  
  67. procedure Register;
  68. begin
  69.   RegisterClasses([TInstall,TInstallAlias,TInstallFile,TInstallFileGroup,TProgramItem,TInstallRSConnection]);
  70.   RegisterClasses([TSelectWindowGroupDlg,TInstallRSConnectionDlg,TInstallFileGroupsDlg,TInstallINIFile]);
  71.   RegisterClasses([TInstallODBC,TCopyFileDlg]);
  72.   RegisterClasses([TGoodInstallationDlg,TReportManager,TModifiedReport,TUnInstall,TUnInstallingFileDlg]);
  73.   RegisterComponents('Youseful', [TInstall,TInstallAlias,TInstallFileGroup,TInstallODBC,TProgramItem,TInstallRSConnection]);
  74.   RegisterComponents('Youseful',[TInstallINIFile,TSelectWindowGroupDlg,TInstallRSConnectionDlg,TInstallFileGroupsDlg]);
  75.   RegisterComponents('Youseful',[TCopyFileDlg,TGoodInstallationDlg,TComponentConflictDlg,TUnInstall]);
  76.   RegisterComponents('Youseful',[TUnInstallingFileDlg,TColorFade]);
  77.   RegisterComponents('Ysfl(Misc)',[TReportManager,TModifiedReport]);
  78.   RegisterNoIcon([TInstallFile]);
  79.   RegisterComponentEditor(TInstallFileGroup, TInstallFileGroupEditor);
  80.   RegisterComponentEditor(TInstall, TInstallEditor);
  81.   RegisterPropertyEditor(TypeInfo(string),TReportManager,'Directory',TRptManDirProperty);
  82.   RegisterPropertyEditor(TypeInfo(string),TReportManager,'ININame',TININameProperty);
  83.   RegisterPropertyEditor(TypeInfo(string),TReportManager,'FileGroup',TFileGroupProperty);
  84.   RegisterPropertyEditor(TypeInfo(TFileName),TInstallODBC,'DriverDLL',TDLLFileNameProperty);
  85.   RegisterPropertyEditor(TypeInfo(TFileName),TInstallODBC,'SetupDLL',TDLLFileNameProperty);
  86. end;
  87.  
  88. end.
  89.