home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / PowerPlant / CDimmerCluster / Read me! < prev   
Encoding:
Text File  |  1995-12-01  |  2.2 KB  |  56 lines  |  [TEXT/MPS ]

  1. The attached is a simple, re-useable PowerPlant class (CDimmerCluster)
  2. that dims any of its sub-panes when a master LControl-subclass is
  3. enabled or disabled. This is usually a checkbox, but you can use any
  4. LControl subclass; the requirement is that the control must send a
  5. message "cmd_DimGroup" (3000) whose ioParam is 0 or 1 depending on
  6. whether dimming is required or not. This is most easily done with
  7. Constructor. The pane ID of the controlling sub-pane is put into the
  8. "user contant" field of the CDimmerCluster. The general idea is that
  9. you drop the code into your project, then do most of the work in
  10. Constructor. The enclosed Dimmer.rsrc and "read me" file should make
  11. things clearer, I hope. 
  12.  
  13. To use:
  14.  
  15. 1) Add CDimmerCluster.h and CDimmerCluster.cp to your project.
  16. 2) Register the new custom classes in your main appl class:
  17.  
  18.     URegistrar::RegisterClass(CDimmerCluster::class_ID, CDimmerCluster::CreateDimmerStream);
  19.     URegistrar::RegisterClass(CDimmableEditText::class_ID, CDimmableEditText::CreateDimmableEditTextStream);
  20.  
  21. 3) Using Constructor, create the dimmer view and its subviews.
  22.  
  23. The enclosed demo appl shows how this is done.
  24.  
  25. Bonus: enclosed are 68K and PPC project files that build PowerPlant
  26. as a library. You can then add the built lib to your projects instead
  27. of the PP srcs. Not only does this save disk space, whenever you update
  28. to a new version of PowerPlant, you merely have to relink your projects
  29. instead of recompiling umpteen times (CW is fast but not compiling
  30. is faster :-).
  31.  
  32. You are free to use this code in any project, but the copyright remains
  33. with me.
  34.  
  35. Sak Wathanasin
  36. Network Analysis Limited
  37. 178 Wainbody Ave South, Coventry CV3 6BX, UK
  38.  
  39. Internet: sw@network-analysis-ltd.co.uk 
  40. uucp:     ...!eu.britain.net!nan!sw         AppleLink: NAN.LTD
  41. Phone: (+44) 1203 419996                    Fax: (+44) 1203 690690
  42.  
  43. ---
  44. //CDimCaption.cp
  45. //Donald E. Carlile 1995
  46.  
  47. This allows you to have dimmable captions. To use
  48.  
  49. 1) Derive your captions from CDimCaption (in Constructor, add an
  50.    LCaption, then set the class ID to 'dimC'. Set the "enabled" flag
  51.    (really), and set the user constant to 1. 
  52.  
  53. 2) Register the new custom class in your main appl class:
  54.    URegistrar::RegisterClass(CDimCaption::class_ID, CDimCaption::CreateDimCaptionStream);
  55.  
  56.