home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-01 | 2.2 KB | 56 lines | [TEXT/MPS ] |
- The attached is a simple, re-useable PowerPlant class (CDimmerCluster)
- that dims any of its sub-panes when a master LControl-subclass is
- enabled or disabled. This is usually a checkbox, but you can use any
- LControl subclass; the requirement is that the control must send a
- message "cmd_DimGroup" (3000) whose ioParam is 0 or 1 depending on
- whether dimming is required or not. This is most easily done with
- Constructor. The pane ID of the controlling sub-pane is put into the
- "user contant" field of the CDimmerCluster. The general idea is that
- you drop the code into your project, then do most of the work in
- Constructor. The enclosed Dimmer.rsrc and "read me" file should make
- things clearer, I hope.
-
- To use:
-
- 1) Add CDimmerCluster.h and CDimmerCluster.cp to your project.
- 2) Register the new custom classes in your main appl class:
-
- URegistrar::RegisterClass(CDimmerCluster::class_ID, CDimmerCluster::CreateDimmerStream);
- URegistrar::RegisterClass(CDimmableEditText::class_ID, CDimmableEditText::CreateDimmableEditTextStream);
-
- 3) Using Constructor, create the dimmer view and its subviews.
-
- The enclosed demo appl shows how this is done.
-
- Bonus: enclosed are 68K and PPC project files that build PowerPlant
- as a library. You can then add the built lib to your projects instead
- of the PP srcs. Not only does this save disk space, whenever you update
- to a new version of PowerPlant, you merely have to relink your projects
- instead of recompiling umpteen times (CW is fast but not compiling
- is faster :-).
-
- You are free to use this code in any project, but the copyright remains
- with me.
-
- Sak Wathanasin
- Network Analysis Limited
- 178 Wainbody Ave South, Coventry CV3 6BX, UK
-
- Internet: sw@network-analysis-ltd.co.uk
- uucp: ...!eu.britain.net!nan!sw AppleLink: NAN.LTD
- Phone: (+44) 1203 419996 Fax: (+44) 1203 690690
-
- ---
- //CDimCaption.cp
- //Donald E. Carlile 1995
-
- This allows you to have dimmable captions. To use
-
- 1) Derive your captions from CDimCaption (in Constructor, add an
- LCaption, then set the class ID to 'dimC'. Set the "enabled" flag
- (really), and set the user constant to 1.
-
- 2) Register the new custom class in your main appl class:
- URegistrar::RegisterClass(CDimCaption::class_ID, CDimCaption::CreateDimCaptionStream);
-
-