home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 September / Chip_2001-09_cd1.bin / zkuste / delphi / kolekce / d123456 / DFS.ZIP / PgSetupReg.pas < prev    next >
Pascal/Delphi Source File  |  2001-06-27  |  2KB  |  73 lines

  1. {$I DFS.INC}
  2.  
  3. unit PgSetupReg;
  4.  
  5. interface
  6.  
  7. uses
  8.   {$IFDEF DFS_NO_DSGNINTF}
  9.   DesignIntf,
  10.   DesignEditors,
  11.   {$ELSE}
  12.   DsgnIntf,
  13.   {$ENDIF}
  14.   Classes;
  15.  
  16. {$IFDEF DFS_COMPILER_3_UP}
  17. type
  18.   TdfsPageSetupDialogEditor = class(TDefaultEditor)
  19.   public
  20.     procedure ExecuteVerb(Index : Integer); override;
  21.     function GetVerb(Index : Integer): string; override;
  22.     function GetVerbCount : Integer; override;
  23.     procedure Edit; override;
  24.   end;
  25. {$ENDIF}
  26.  
  27. procedure Register;
  28.  
  29. implementation
  30.  
  31. uses
  32.   PgSetup, DFSAbout;
  33.  
  34.   
  35. {$IFDEF DFS_COMPILER_3_UP}
  36.  
  37. procedure TdfsPageSetupDialogEditor.ExecuteVerb(Index: Integer);
  38. begin
  39.   if Index <> 0 then Exit; { We only have one verb, so exit if this ain't it }
  40.   Edit;  { Invoke the Edit function the same as if double click had happened }
  41. end;
  42.  
  43. function TdfsPageSetupDialogEditor.GetVerb(Index: Integer): String;
  44. begin
  45.   Result := 'Test Dialog';  { Menu item caption for context menu }
  46. end;
  47.  
  48. function TdfsPageSetupDialogEditor.GetVerbCount: Integer;
  49. begin
  50.   Result := 1;
  51. end;
  52.  
  53. procedure TdfsPageSetupDialogEditor.Edit;
  54. begin
  55.   if Component is TdfsPageSetupDialog then
  56.     TdfsPageSetupDialog(Component).Execute;
  57. end;
  58.  
  59. {$ENDIF}
  60.  
  61.  
  62. procedure Register;
  63. begin
  64.   RegisterComponents('DFS', [TdfsPageSetupDialog]);
  65. {$IFDEF DFS_COMPILER_3_UP}
  66.   RegisterComponentEditor(TdfsPageSetupDialog, TdfsPageSetupDialogEditor);
  67. {$ENDIF}
  68.   RegisterPropertyEditor(TypeInfo(string), TdfsPageSetupDialog, 'Version',
  69.      TDFSVersionProperty);
  70. end;
  71.  
  72. end.
  73.