home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / Essentials / SETUP.EXE / %MAINDIR% / EsWebPE.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-11-28  |  2.5 KB  |  101 lines

  1. {*********************************************************}
  2. {*                  ESWEBPE.PAS 1.05                     *}
  3. {*      Copyright (c) 1997-98 TurboPower Software Co     *}
  4. {*                 All rights reserved.                  *}
  5. {*********************************************************}
  6.  
  7. {$I ES.INC}
  8.  
  9. {$B-} {Complete Boolean Evaluation}
  10. {$I+} {Input/Output-Checking}
  11. {$P+} {Open Parameters}
  12. {$T-} {Typed @ Operator}
  13. {$W-} {Windows Stack Frame}
  14. {$X+} {Extended Syntax}
  15.  
  16. {$IFNDEF Win32}
  17.   {$G+} {286 Instructions}
  18.   {$N+} {Numeric Coprocessor}
  19.   {$C MOVEABLE,DEMANDLOAD,DISCARDABLE}
  20. {$ENDIF}
  21.  
  22. unit EsWebPE;
  23.   {-component editor to provide web access}
  24.  
  25. interface
  26.  
  27. uses
  28.   {$IFDEF Win32} Windows, {$ELSE} WinTypes, WinProcs, {$ENDIF}
  29.   Dialogs, DsgnIntf, Classes, ShellApi,
  30.   EsData;
  31.  
  32. const
  33.   WebText1  = 'TurboPower on the Web';
  34.   WebText2  = 'Essentials Home Page';
  35.   MailText  = 'Send a Support Message';
  36.  
  37. type
  38.   TEsWebEditor = class(TDefaultEditor)
  39.   public
  40.     procedure ExecuteVerb(Index : Integer);
  41.       override;
  42.     function GetVerb(Index : Integer) : AnsiString;
  43.       override;
  44.     function GetVerbCount : Integer;
  45.       override;
  46.   end;
  47.  
  48. procedure ShellWebCall1;
  49. procedure ShellWebCall2;
  50. procedure ShellMailCall;
  51.  
  52. implementation
  53.  
  54. procedure ShellWebCall1;
  55. begin
  56.   if ShellExecute(0, 'open', 'http://www.turbopower.com', '', '', SW_SHOWNORMAL) <= 32 then
  57.     ShowMessage('Unable to start web browser. Make sure you have it properly set-up on your system.');
  58. end;
  59.  
  60. procedure ShellWebCall2;
  61. begin
  62.   if ShellExecute(0, 'open', 'http://www.turbopower.com/products/essentials', '', '', SW_SHOWNORMAL) <= 32 then
  63.     ShowMessage('Unable to start web browser. Make sure you have it properly set-up on your system.');
  64. end;
  65.  
  66. procedure ShellMailCall;
  67. begin
  68.   if ShellExecute(0, 'open', 'mailto:support@turbopower.com', '', '', SW_SHOWNORMAL) <= 32 then
  69.     ShowMessage('Unable to start mail client. Make sure you have it properly set-up on your system.');
  70. end;
  71.  
  72.  
  73. {*** TEsWebEditor ***}
  74.  
  75. procedure TEsWebEditor.ExecuteVerb(Index : Integer);
  76. begin
  77.   case Index of
  78.     0 : ShellWebCall1;
  79.     1 : ShellWebCall2;
  80.     2 : ShellMailCall;
  81.   end;
  82. end;
  83.  
  84. function TEsWebEditor.GetVerb(Index : Integer) : AnsiString;
  85. begin
  86.   case Index of
  87.     0 : Result := WebText1;
  88.     1 : Result := WebText2;
  89.     2 : Result := MailText;
  90.   else
  91.     Result := '?';
  92.   end;
  93. end;
  94.  
  95. function TEsWebEditor.GetVerbCount : Integer;
  96. begin
  97.   Result := 3;
  98. end;
  99.  
  100. end.
  101.