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

  1. {$I DFS.INC}  { Standard defines for all Delphi Free Stuff components }
  2.  
  3. {------------------------------------------------------------------------------}
  4. { dfsAbout unit v1.03                                                          }
  5. {------------------------------------------------------------------------------}
  6. { This unit provides a property editor that I use for the version property in  }
  7. { all of my components.                                                        }
  8. {                                                                              }
  9. { Copyright 1999-2001, Brad Stowers.  All Rights Reserved.                     }
  10. {                                                                              }
  11. { Copyright:                                                                   }
  12. { All Delphi Free Stuff (hereafter "DFS") source code is copyrighted by        }
  13. { Bradley D. Stowers (hereafter "author"), and shall remain the exclusive      }
  14. { property of the author.                                                      }
  15. {                                                                              }
  16. { Distribution Rights:                                                         }
  17. { You are granted a non-exlusive, royalty-free right to produce and distribute }
  18. { compiled binary files (executables, DLLs, etc.) that are built with any of   }
  19. { the DFS source code unless specifically stated otherwise.                    }
  20. { You are further granted permission to redistribute any of the DFS source     }
  21. { code in source code form, provided that the original archive as found on the }
  22. { DFS web site (http://www.delphifreestuff.com) is distributed unmodified. For }
  23. { example, if you create a descendant of TdfsColorButton, you must include in  }
  24. { the distribution package the colorbtn.zip file in the exact form that you    }
  25. { downloaded it from http://www.delphifreestuff.com/mine/files/colorbtn.zip.   }
  26. {                                                                              }
  27. { Restrictions:                                                                }
  28. { Without the express written consent of the author, you may not:              }
  29. {   * Distribute modified versions of any DFS source code by itself. You must  }
  30. {     include the original archive as you found it at the DFS site.            }
  31. {   * Sell or lease any portion of DFS source code. You are, of course, free   }
  32. {     to sell any of your own original code that works with, enhances, etc.    }
  33. {     DFS source code.                                                         }
  34. {   * Distribute DFS source code for profit.                                   }
  35. {                                                                              }
  36. { Warranty:                                                                    }
  37. { There is absolutely no warranty of any kind whatsoever with any of the DFS   }
  38. { source code (hereafter "software"). The software is provided to you "AS-IS", }
  39. { and all risks and losses associated with it's use are assumed by you. In no  }
  40. { event shall the author of the softare, Bradley D. Stowers, be held           }
  41. { accountable for any damages or losses that may occur from use or misuse of   }
  42. { the software.                                                                }
  43. {                                                                              }
  44. { Support:                                                                     }
  45. { All DFS source code is provided free of charge. As such, I can not guarantee }
  46. { any support whatsoever. While I do try to answer all questions that I        }
  47. { receive, and address all problems that are reported to me, you must          }
  48. { understand that I simply can not guarantee that this will always be so.      }
  49. {                                                                              }
  50. { Clarifications:                                                              }
  51. { If you need any further information, please feel free to contact me directly.}
  52. { This agreement can be found online at my site in the "Miscellaneous" section.}
  53. {------------------------------------------------------------------------------}
  54. { Feel free to contact me if you have any questions, comments or suggestions   }
  55. { at bstowers@pobox.com.                                                       }
  56. { The lateset version of my components are always available on the web at:     }
  57. {   http://www.delphifreestuff.com/                                            }
  58. {------------------------------------------------------------------------------}
  59. { Date last modified:  June 27, 2001                                           }
  60. {------------------------------------------------------------------------------}
  61.  
  62. {$IFDEF DFS_COMPILER_3_UP}
  63. {$WEAKPACKAGEUNIT ON} { Allow unit to exist in multiple packages }
  64. {$ENDIF}
  65.  
  66. unit dfsAbout;
  67.  
  68. interface
  69.  
  70. uses
  71.   {$IFDEF DFS_NO_DSGNINTF}
  72.   DesignIntf,
  73.   DesignEditors;
  74.   {$ELSE}
  75.   DsgnIntf;
  76.   {$ENDIF}
  77.  
  78. type
  79.   TdfsVersionProperty = class(TStringProperty)
  80.   public
  81.     procedure Edit; override;
  82.     function GetValue: string; override;
  83.     function GetAttributes: TPropertyAttributes; override;
  84.   end;
  85.  
  86. implementation
  87.  
  88. uses
  89.   Dialogs, SysUtils;
  90.  
  91. procedure TdfsVersionProperty.Edit;
  92. const
  93.   ABOUT_TEXT = '%s'#13#13 +
  94.      'Copyright 1999, Brad Stowers, All Rights Reserved.'#13 +
  95.      'This component is distributed as freeware.'#13#13 +
  96.      'The latest version of this component can be found on'#13 +
  97.      'my web site, Delphi Free Stuff, at:'#13 +
  98.      '  http://www.delphifreestuff.com/'#13;
  99. begin
  100.   MessageDlg(Format(ABOUT_TEXT, [GetStrValue]), mtInformation, [mbOK], 0);
  101. end;
  102.  
  103. function TdfsVersionProperty.GetValue: string;
  104. var
  105.   i: integer;
  106. begin
  107.   i := Pos(' v', GetStrValue);
  108.   Result := Copy(GetStrValue, i + 2, Length(GetStrValue)-i);
  109. end;
  110.  
  111. function TdfsVersionProperty.GetAttributes: TPropertyAttributes;
  112. begin
  113.   Result := inherited GetAttributes + [paDialog, paReadOnly];
  114. end;
  115.  
  116. end.
  117.