home *** CD-ROM | disk | FTP | other *** search
- /*
- File: CDimmerCluster.h
-
- Contains: Definitions of the dimmer cluster and dimming edittext classes.
-
- Written by: Sak Wathanasin
- Network Analysis Ltd
- 178 Wainbody Ave South
- Coventry CV3 6BX
- UK
- Phone: (+44) 1203 419996
- E-mail: sw@network-analysis-ltd.co.uk
-
- Thanks to: Donald E. Carlile who contributed the dimmable caption
- (carlile@beachnet.gen.ca.us)
-
- Copyright: © 1995 Network Analysis Ltd. All rights reserved.
- CDimCaption.cp © Donald E. Carlile
-
- Change History (most recent first):
-
- <1.1> 01/12/95 dec Add dimmable captions
- <1.0> 07/08/95 sw First public release.
-
- To Do:
- */
-
-
- #ifndef __CDimmerCluster__
- #define __CDimmerCluster__
-
- #ifndef __LView__
- #include "LView.h"
- #endif
-
- // This implements a (transparent) view that dims its sub-panes
- // depending on the setting of a distinguished sub-pane (the "master").
- // This is often a checkbox, but any LControl sub-class can be used.
- //
- // The idea is to use Constructor for most of the hard-work: the pane ID
- // of the master is put into the "user constant" field of the view,
- // and each sub-pane that is to be dimmed has its user constant set to 1.
-
- class CDimmerCluster : public LView,
- public LListener
- {
- public:
- enum { class_ID = 'dimV' };
- enum { cmd_DimGroup = 3000 };
- CDimmerCluster();
- CDimmerCluster(LStream* inStream);
- CDimmerCluster(const SPaneInfo &inPaneInfo, const SViewInfo &inViewInfo);
- CDimmerCluster(const LView &inOriginal);
-
- virtual ~CDimmerCluster();
- static CDimmerCluster* CreateDimmerStream(LStream *inStream);
-
- virtual void FinishCreate();
-
- virtual void ListenToMessage(MessageT inMessage, void *ioParam);
- protected:
- enum tDimState
- {
- eOff, eOn, eWasDimmed
- };
-
-
- private:
- LControl* FindController();
- LControl* mController; // the LControl that specifies whether the remainder is
- // dimmed or not
-
- };
-
- // This is a sub-class of LEditField that correctly dims the text and
- // removes and restores the typing focus.
- class CDimmableEditText : public LEditField
- {
- public:
- enum { class_ID = 'dimE' };
- static CDimmableEditText*
- CreateDimmableEditTextStream(LStream *inStream);
- CDimmableEditText();
- CDimmableEditText(
- const CDimmableEditText &inOriginal);
- CDimmableEditText(
- const SPaneInfo &inPaneInfo,
- Str255 inString,
- ResIDT inTextTraitsID,
- Int16 inMaxChars,
- Boolean inHasBox,
- Boolean inHasWordWrap,
- KeyFilterFunc inKeyFilter,
- LCommander *inSuper);
- CDimmableEditText(
- const SPaneInfo &inPaneInfo,
- Str255 inString,
- ResIDT inTextTraitsID,
- Int16 inMaxChars,
- Uint8 inAttributes,
- KeyFilterFunc inKeyFilter,
- LCommander *inSuper);
- CDimmableEditText(
- LStream *inStream);
- virtual void FinishCreate();
- virtual void EnableSelf();
- virtual void DisableSelf();
- protected:
- short mTxMode;
- Boolean mWasTarget;
- Boolean WasTarget() {return mWasTarget;}
- };
-
- //Additions to CDimmerCluster to add dimmable captions
- // Donald E. Carlile 1995
- #include <LCaption.h> //Modification by DEC 11/25/95 to dim caption text
- class CDimCaption : public LCaption {
- public:
- enum { class_ID = 'dimC' };
- static CDimCaption* CreateDimCaptionStream(LStream *inStream);
-
- CDimCaption();
- CDimCaption(
- const CDimCaption &inCaption);
- CDimCaption(
- const SPaneInfo &inPaneInfo,
- ConstStringPtr inString,
- ResIDT inTextTraitsID);
- CDimCaption(
- LStream *inStream);
- virtual ~CDimCaption();
-
- protected:
- enum tDimState
- {
- eOff, eOn, eWasDimmed
- };
- RGBColor mDimColor;
- virtual void EnableSelf();
- virtual void DisableSelf();
- virtual void DrawSelf();
- };
-
- #endif
-