home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / PowerPlant / CommandKeyAttachments / CCmdKeyAttachment.h < prev    next >
Encoding:
Text File  |  1997-01-31  |  1.4 KB  |  46 lines  |  [TEXT/R*ch]

  1. // ===========================================================================
  2. //    File:                        CCmdKeyAttachment.h
  3. // Version:                    1.0.1 - Jan 31, 1997
  4. //    Author:                    Mike Shields (mshields@inconnect.com)
  5. //                            
  6. //    Copyright ©1996 Mike Shields. All rights reserved.
  7. // ===========================================================================
  8. //
  9. //    Abstract class to handle drawing and responding to command keys when it is attached 
  10. // to a button
  11.  
  12. #pragma once
  13.  
  14. #include <LPeriodical.h>
  15. #include <LAttachment.h>
  16.  
  17. class LControl;
  18. class LCommander;
  19.  
  20. class CCmdKeyAttachment : public LAttachment,
  21.                                     public LPeriodical
  22.                                         
  23. {
  24. public:
  25.     static CCmdKeyAttachment*    CreateFromStream(LStream *inStream);
  26.  
  27.                         CCmdKeyAttachment();
  28.                         CCmdKeyAttachment(LStream *inStream);
  29.     virtual            ~CCmdKeyAttachment();
  30.     
  31.     virtual void    SetOwnerHost(LAttachable *inOwnerHost);
  32.     virtual void    SpendTime(const EventRecord& inMacEvent);
  33.     virtual void    EnableCommandKey(Boolean inCmdDown) = 0;
  34.     virtual void    SetCommandKey(Uchar inCmdKey) { mCommandKey = inCmdKey; };
  35.     virtual Uchar    GetCommandKey(void) const { return mCommandKey; };
  36.     
  37. protected:
  38.     virtual void    SetOwnerHostSelf(LAttachable *inOwnerHost);
  39.     virtual void    ExecuteSelf(MessageT inMessage, void* ioParam);    
  40.     virtual void    DrawCommandKey(Boolean inVisible) = 0;
  41.  
  42.     LControl*        mMyControl;
  43.     LCommander*        mSuperCommander;
  44.     Uchar                mCommandKey;
  45. };
  46.