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

  1. // ===========================================================================
  2. //    File:                        CExternalCmdKeyAttachment.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. //    Class which handles drawing and responding to command keys when it is attached 
  10. // to a button
  11.  
  12. #pragma once
  13.  
  14. #include "CCmdKeyAttachment.h"
  15.  
  16. class CExternalCmdKeyAttachment : public CCmdKeyAttachment
  17.                                         
  18. {
  19. public:
  20.     enum                { position_Top        = 0x0001,
  21.                           position_Left    = 0x0002,
  22.                           position_Bottom    = 0x0003,
  23.                           position_Right    = 0x0004 };
  24.                           
  25.     enum { class_ID = 'EXck' };
  26.     static CExternalCmdKeyAttachment*    CreateFromStream(LStream *inStream);
  27.  
  28.                         CExternalCmdKeyAttachment();
  29.                         CExternalCmdKeyAttachment(LStream *inStream);
  30.     virtual            ~CExternalCmdKeyAttachment();
  31.     
  32.     virtual void    EnableCommandKey(Boolean inCmdDown);
  33.  
  34.     virtual void    SetCommandKeyLocation(Int16 inLocation) { mCommandKeyLocation = inLocation; };
  35.     virtual Int16    GetCommandKeyLocation(void) const { return mCommandKeyLocation; };
  36.  
  37.     virtual void    SetCommandKeyOffset(Point& inPosition) { mCommandKeyOffset = inPosition; };
  38.     virtual Point    GetCommandKeyOffset(void) const { return mCommandKeyOffset; };
  39.     
  40. protected:
  41.     virtual void    GetCommandKeyPosition(Point& outPosition);
  42.     virtual void    DrawCommandKey(Boolean inVisible);
  43.     
  44.     Point                mCommandKeyOffset;
  45.     Int16                mCommandKeyLocation;
  46. };
  47.