home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 March / Chip_2002-03_cd1.bin / zkuste / delphi / kompon / d3456 / EHS.ZIP / setup.exe / {app} / ehs_reg.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-04-24  |  3.3 KB  |  125 lines

  1. { EC Software Help Suite (EHS)
  2.  
  3.   ⌐ 2000-2001 EC Software. All rights reserved.
  4.  
  5.   This product and it's source code is protected by patents, copyright laws and
  6.   international copyright treaties, as well as other intellectual property
  7.   laws and treaties. The product is licensed, not sold.
  8.  
  9.   The source code and sample programs in this package or parts hereof
  10.   as well as the documentation shall not be copied, modified or redistributed
  11.   without permission, explicit or implied, of the author.
  12.  
  13.  
  14.   EMail: info@ec-software.com
  15.   Internet: http://www.ec-software.com
  16.  
  17.  
  18.   Registration of components in the Delphi IDE
  19.   --------------------------------------------
  20.   This unit registers one or more components of EHS. If you want to register
  21.   all components included, simply compile it. To exclude components from
  22.   registration, insert a dot before the $DEFINE EHS_xxx statement below.
  23.  
  24.  
  25.   Disclaimer of Warranty
  26.   ----------------------
  27.   THIS SOFTWARE AND THE ACCOMPANYING FILES ARE PROVIDED "AS IS" AND
  28.   WITHOUT WARRANTIES OF ANY KIND WHETHER EXPRESSED OR IMPLIED.
  29.  
  30.   In no event shall the author be held liable for any damages whatsoever,
  31.   including without limitation, damages for loss of business profits,
  32.   business interruption, loss of business information, or any other loss
  33.   arising from the use or inability to use the software. }
  34.  
  35.  
  36.   {$DEFINE EHS_WHATSTHIS}
  37.   {$DEFINE EHS_HELPROUTER}
  38.   {$DEFINE EHS_TRAININGCARD}
  39.  
  40. unit ehs_reg;
  41.  
  42. interface
  43.  
  44. uses SysUtils, Classes, Dialogs,
  45.      {$IFDEF VER100} DsgnIntf {$ENDIF}  //D3
  46.      {$IFDEF VER120} DsgnIntf {$ENDIF}  //D4
  47.      {$IFDEF VER130} DsgnIntf {$ENDIF}  //D5
  48.      {$IFDEF VER140} DesignIntf, DesignEditors {$ENDIF}  //D6
  49.      ;
  50.  
  51. type
  52.   { property editor for THelpContextMap.FileName }
  53.   THPJFileNameProperty = class(TPropertyEditor)
  54.   public
  55.     procedure Edit; override;
  56.     function GetAttributes: TPropertyAttributes; override;
  57.     function GetValue: string; override;
  58.     procedure SetValue(const Value: string); override;
  59.   end;
  60.  
  61.  
  62. procedure Register;
  63.  
  64. implementation
  65.  
  66. {$R *.dcr}
  67.  
  68. uses
  69. {$IFDEF EHS_WHATSTHIS}
  70.   ehswhatsthis,
  71. {$ENDIF}
  72. {$IFDEF EHS_HELPROUTER}
  73.   ehshelprouter,
  74. {$ENDIF}
  75. {$IFDEF EHS_TRAININGCARD}
  76.   ehstcard,
  77. {$ENDIF}
  78.   ehscontextmap;
  79.  
  80. procedure Register;
  81. begin
  82. {$IFDEF EHS_WHATSTHIS}
  83.   RegisterComponents('EHS', [TWhatsThis, THelpContextMap]);
  84.   RegisterPropertyEditor(TypeInfo(TFileName), THelpContextMap, 'FileName', THPJFileNameProperty);
  85. {$ENDIF}
  86. {$IFDEF EHS_HELPROUTER}
  87.   RegisterComponents('EHS', [THelpRouter]);
  88. {$ENDIF}
  89. {$IFDEF EHS_TRAININGCARD}
  90.   RegisterComponents('EHS', [TTrainingCard]);
  91. {$ENDIF}
  92. end;
  93.  
  94. { THPJFileNameProperty editor }
  95.  
  96. procedure THPJFileNameProperty.Edit;
  97. begin
  98.      with TOpenDialog.Create(nil) do
  99.      try
  100.         FileName := GetValue;
  101.         Filter := 'Help project files (*.hpj; *.hhp)|*.hpj;*.hhp|All files (*.*)|*.*';
  102.         if execute then SetValue(filename);
  103.      finally
  104.         free;
  105.      end;
  106. end;
  107.  
  108. function THPJFileNameProperty.GetValue: string;
  109. begin
  110.   Result := GetStrValue;
  111. end;
  112.  
  113. procedure THPJFileNameProperty.SetValue(const Value: string);
  114. begin
  115.   SetStrValue(Value);
  116. end;
  117.  
  118. function THPJFileNameProperty.GetAttributes: TPropertyAttributes;
  119. begin
  120.   Result := [paDialog];
  121. end;
  122.  
  123.  
  124. end.
  125.