home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / PowerPlant / LButtonKeyAtt / LButtonKeyAtt.h < prev   
Encoding:
C/C++ Source or Header  |  1995-09-24  |  1.1 KB  |  44 lines  |  [TEXT/CWIE]

  1. /*
  2.  * Attach an instance of LButtonKeyAtt to an LStdButton in a PowerPlant
  3.  *    window. If the user holds down the command key, a "*X" symbol will
  4.  *    appear next to the button - where * is the symbol on the command key
  5.  *    and X is the uppercase version of the first letter of the button.
  6.  *    If the user presses this key combination, the button is clicked.
  7.  *
  8.  *    Placed in the public domain by Roger Pantos, Sept. 24 1995.
  9.  */
  10.  
  11. #pragma once
  12.  
  13. #include <LAttachable.h>
  14. #include <LPeriodical.h>
  15.  
  16. class        LCommander;
  17.  
  18.  
  19. class        LButtonKeyAtt : public LAttachment, private LPeriodical
  20. {
  21. public:
  22.     enum { class_ID = 'BKAt' };
  23.     static LButtonKeyAtt *CreateFrom( LStream *inStream);
  24.  
  25.                                 LButtonKeyAtt();
  26.     virtual                    ~LButtonKeyAtt();
  27.  
  28.     virtual void            SetOwnerHost( LAttachable *inOwnerHost);
  29.  
  30. protected:
  31.     virtual    void            SpendTime( const EventRecord &inMacEvent);
  32.  
  33.     virtual void            ExecuteSelf( MessageT inMessage, void *ioParam);
  34.  
  35.     void                        SetHint( Boolean visible);
  36.     void                        GetHintPos( const Rect& localPaneR, Point *pPos);
  37.  
  38.     LCommander            *fKeyHandler;
  39.     Byte                    fKeyChar;
  40.     Boolean                fHintVis;
  41. };
  42.  
  43.  
  44.