home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / delphi / kolekce / d345 / JWTOOL.ZIP / jwtool / JOEREG.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-09-29  |  7.0 KB  |  164 lines

  1. {
  2. JwPackage - v1.02
  3.  
  4.         When I started learning how to do components, I really did start with
  5. a Corriolis book and a few "stupid" ideas.  Namely, the TSmilie and the TLinez.
  6. (I actually started using the TLinez because I didn't like the behavior of the
  7. TBevel--And I was able to get a nice 3-D look out of it...).  Then I started
  8. moving on to making components that actually solved a problem of some sort.  At
  9. first I was working as if I wasn't sure if I was going to be "backwards compatable"
  10. with Delphi 1 and Delphi 3-5, but over time it became ridiculous.  Also, I was
  11. unsure if I was going to use each one over another, so I did actually duplicate
  12. a lot of code between each unit--it took me some time to decide on a "Package"
  13. solution.  But I have actually used many of these components in my software, so
  14. I hope other might find them useful.  I packed the "register" unit here so that if
  15. there is any one that is "undesired" (you know, I would LOVE for someone to use
  16. my JwSmile in some sort of application--even as an easter egg...) just comment it
  17. out here, and your done.
  18.    Here's a breif overview of what I did and what I was thinking:
  19.  
  20.      JwAutAbt:
  21.   This is a non-visual component to encapsulate an "About" box.  At the time, I was
  22. attempting to meet a ISO900X standard, so I added lotsa of info.
  23.  
  24.      JwBinRES:
  25.   I really never liked Res files and there are some cases where it's much easier to
  26. just drop a extra file into a component so it can just be included into the DFM file.
  27. That was exactly what I did with the BMPRes and such, but for the longest time I couldn't
  28. figure out how.  Now this component will not only take ANY file even if it is binary
  29. and allow it to be converted to a TMemoryStream.  PERFECT for the Abrevia unit and
  30. zip files (that's from Turbo Power if you didn't know--it ain't cheap either!)
  31.  
  32.      JwBmpRes:
  33.   I never liked the idea of dropping components just to set the component to VISIBLE=False.
  34. It just seemed too sloppy for me.  So I created this non-visual component that just stored
  35. the TGraphic, since Delphi came with all sorts of component editors for that sort of thing
  36. already.
  37.  
  38.      JwByPs:
  39.   One programmer who worked for me needed to have a checkbox that had a behavior that would
  40. allow him to prevent a "Click" even tho it was enabled.  The exact reason escapes me right
  41. now, but it made sence then.  You must admit, ENABLED=FALSE on TWinControls behave very
  42. differently.
  43.  
  44.      JwFshCl:
  45.   I kept seeing these CD Menus that had static labels that behaved like url links--they
  46. "Flared" out when the mouse was over it.  I really liked the idea, since you can always
  47. add an event to a TLabel, but how's the user going to know it has that behavior?  By
  48. having this event, the user has some sort of signal.  I used this 3-Staged event
  49. behavior on a lot of cases.
  50.  
  51.      Jwfshpn:
  52.   I did this one just like the JwFshCl except on a TPanel so I could create an ActiveX
  53. control to import into Access.  I did it, but I wasn't able to make it work with the
  54. Access reports...ah well.
  55.  
  56.      JwLabel:
  57.   This is just a TLabel, but with total access to the font itself.  I didn't really want
  58. to mess to much with it, so I added some.. fixes.. to make a rotated font in the window.
  59.  
  60.      JwLinez:
  61.   I think in every example or book on Components starts with the drawing of a line.  I
  62. actually started using this in apps to created a sort of 3-D effect.
  63.  
  64.      JwPopbtn:
  65.   This one didn't turn out that well, but it was supposed to "Popup" whenever the mouse
  66. was over the component.  It was a bit messy with "unexpected" or "random" events.
  67.  
  68.      JwRotPan:
  69.   This just made a JwLabel for a TPanel.  Again, for ActiveX stuff.
  70.  
  71.      Jwrtfsh:
  72.   This is a Combination of JwLabel and JwFshCl.
  73.  
  74.      jwShellBrowseFolder:
  75.   This is a browse for folder using the call to SHBrowseForFolder.  Unfortunatly, it doesn't
  76. work exactly as I wanted.  I need more research into the whole conversion of C++ to Delphi.
  77.  
  78.      JwSmile:
  79.   You know, I just wanted to know if I could do it.
  80.  
  81.      JwStgPnl:
  82.   I wanted a 3-staged button, or at least a panel that had three states that I could
  83. test easily.  It could be easily done in code, but I figured that I should make it into
  84. a component.
  85.  
  86.      JwStrRes:
  87.   Much like the BinRes and BmpRes, this is a non-visual component to store text.
  88.  
  89.      JwWrpbtn:
  90.   I really wanted to have a button that had some of the behaviors of the TLabel, so I
  91. created a TLabel that had the painting behaviors of the TButton.   Again, this didn't work
  92. out as close as I would have liked.
  93.  
  94.   I give this source as freeware with no assurances or warentees involved.  Use at your own risk.
  95. Anyone can use this code for any project you wish, however I humbly request that my name and email
  96. address be given somewhere in the credits.
  97.   My contact info is:
  98.  
  99. Joseph Wilcock
  100. Coockoo@hotmail.com
  101. http://msnhomepages.talkcity.com/RedmondAve/coockoo/
  102.  
  103.   PS:  When you read the comments in the source, please remember that I did these over
  104.     a great span of time--I've changed my styles and "Programming Superstions" since.
  105. }
  106.  
  107. {
  108.         ** OVERALL VERSION History   **
  109.    Version     Date     Notes
  110.     v1.00  - 01APR99    Original Release
  111.     v1.01  - 12Dec00    Added StrRes, BmpRes, RotPan, ByPass
  112.     v1.02  - ???????    I don't know why I do this--I keep forgetting
  113.                         to update this thing.
  114. }
  115.  
  116. unit JoeReg;
  117.  
  118. interface
  119.  
  120. uses JwAutAbt,            // Non-visual auto "About" box with various properties
  121.      JwBinRES,            // Streamable Binary Resource (alternative to Res files)
  122.      JwBmpRes,            // Non-visual Component to store TGraphics with little memory
  123.      JwByPs,              // "Checkbox By Pass" - Prevent a click even if enabled
  124.      JwFshCl,             // TLabel with Three different fonts for different states
  125.      Jwfshpn,             // As a "TFlashClick" but on a TPanel
  126.      JwLabel,             // TLabel with a absolute control over the font's values, including rotation
  127.      JwLinez,             // Very simple line drawing tool
  128.      JwPopbtn,            // Button with "three" stages--to react to the mouse-over event
  129.      JwRotPan,            // Just like the JwLabel, but on a TPanel--can be imported to ActiveX
  130.      Jwrtfsh,             // Combination of JwLabel, JwFshCl
  131.      jwShellBrowseFolder, // Non-Visual Browsing for directories, using the Windows Shell
  132.      JwSmile,             // Useless component--just for fun
  133.      JwStgPnl,            // Three stage panel--encapsulates what can be done by adding events.
  134.      JwStrRes,            // Non-Visual Resource for TStrings
  135.      JwWrpbtn             // TLabel with TButton-style look and feel.
  136.      ;
  137.  
  138. procedure Register;
  139.  
  140. implementation
  141.  
  142. Procedure Register;
  143. begin
  144.   JwLinez.Register;
  145.   JwLabel.Register;
  146.   JwSmile.Register;
  147.   JwWrpbtn.Register;
  148.   JwPopbtn.Register;
  149.   JwFshCl.Register;
  150.   Jwfshpn.Register;
  151.   JwStgPnl.Register;
  152.   Jwrtfsh.Register;
  153.   JwAutAbt.Register;
  154.   JwRotPan.Register;
  155.   JwStrRes.Register;
  156.   JwBmpRes.Register;
  157.   JwByPs.Register;
  158.   JwBinRES.Register;
  159. end;
  160.  
  161.  
  162.  
  163. end.
  164.