home *** CD-ROM | disk | FTP | other *** search
/ Freelog 11 / Freelog011.iso / BestOf / PhoenixMail / Source / comps / DFSAbout.pas < prev    next >
Pascal/Delphi Source File  |  1999-01-06  |  3KB  |  81 lines

  1. {*****************************************************************************
  2.  *
  3.  *  Parts of this code were changed by Michael Haller
  4.  *  E-mail:     michael@discountdrive.com
  5.  *  Homepage:   http://www.discountdrive.com/sunrise/
  6.  *
  7.  *  The copyright has the original author of this code.
  8.  *
  9.  *****************************************************************************}
  10.  
  11.  
  12. {$I DFS.INC}  { Standard defines for all Delphi Free Stuff components }
  13.  
  14. {-----------------------------------------------------------------------------}
  15. { DFSAbout unit v1.00                                                         }
  16. {-----------------------------------------------------------------------------}
  17. { This unit provides a property editor that I use for the version property in }
  18. { all of my components.                                                       }
  19. { Copyright 1998, Brad Stowers.  All Rights Reserved.                         }
  20. { This unit can be freely used and distributed in commercial and private      }
  21. { environments, provied this notice is not modified in any way and there is   }
  22. { no charge for it other than nomial handling fees.  Contact me directly for  }
  23. { modifications to this agreement.                                            }
  24. {-----------------------------------------------------------------------------}
  25. { Feel free to contact me if you have any questions, comments or suggestions  }
  26. { at bstowers@pobox.com.                                                      }
  27. { The lateset version of my components are always available on the web at:    }
  28. {   http://www.pobox.com/~bstowers/delphi/                                    }
  29. {-----------------------------------------------------------------------------}
  30. { Date last modified:  June 2, 1998                                           }
  31. {-----------------------------------------------------------------------------}
  32.  
  33. unit DFSAbout;
  34.  
  35. interface
  36.  
  37. uses
  38.   DsgnIntf;
  39.  
  40. type
  41.   TDFSVersion = {$IFNDEF DFS_DELPHI_1} type {$ENDIF} string;
  42.  
  43.   TDFSVersionProperty = class(TStringProperty)
  44.   public
  45.     procedure Edit; override;
  46.     function GetValue: string; override;
  47.     function GetAttributes: TPropertyAttributes; override;
  48.   end;
  49.  
  50. implementation
  51.  
  52. uses
  53.   Dialogs, SysUtils;
  54.  
  55. procedure TDFSVersionProperty.Edit;
  56. const
  57.   ABOUT_TEXT = '%s'#13#13 +
  58.      'Copyright 1998, Brad Stowers, All Rights Reserved.'#13 +
  59.      'This component is distributed as freeware.'#13#13 +
  60.      'The latest version of this component can be found on'#13 +
  61.      'my web site, Delphi Free Stuff, at:'#13 +
  62.      '  http://www.pobox.com/~bstowers/delphi/'#13;
  63. begin
  64.   MessageDlg(Format(ABOUT_TEXT, [GetStrValue]), mtInformation, [mbOK], 0);
  65. end;
  66.  
  67. function TDFSVersionProperty.GetValue: string;
  68. var
  69.   i: integer;
  70. begin
  71.   i := Pos(' v', GetStrValue);
  72.   Result := Copy(GetStrValue, i + 2, Length(GetStrValue)-i);
  73. end;
  74.  
  75. function TDFSVersionProperty.GetAttributes: TPropertyAttributes;
  76. begin
  77.   Result := inherited GetAttributes + [paDialog, paReadOnly];
  78. end;
  79.  
  80. end.
  81.