home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Sample Controls / Button2 / CButton2Control.h < prev   
Encoding:
Text File  |  1996-12-20  |  1.6 KB  |  61 lines  |  [TEXT/CWIE]

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. //    CButtonControl.h
  4. //
  5. //
  6.  
  7. #ifndef __CBUTTONCONTROL__
  8. #define __CBUTTONCONTROL__
  9.  
  10. #include "CBaseControl.h"
  11. #include "CBaseEventServer.h"
  12.  
  13. const short NUM_CONNECTIONS    = 1;    // This control only has one connection point
  14.  
  15. ///////////////////////////////////////////////////////////////////////////////
  16. //
  17. //    Class definition
  18. //
  19.  
  20. class CButtonControl : 
  21.     public CBaseControl,
  22.     public CBaseEventServer
  23. {
  24. public:
  25.     
  26.     // *** CPictControl methods ***
  27.     CButtonControl();
  28.     ~CButtonControl();
  29.  
  30.     // *** IUnknown methods ***
  31.     STDMETHOD (QueryInterface)(REFIID RefID, void** Obj);
  32.     STDMETHOD_(ULONG,AddRef)(THIS) {CBaseControl::AddRef();}
  33.     STDMETHOD_(ULONG,Release)(THIS) {CBaseControl::Release();}
  34.  
  35.     // *** IControl methods ***
  36.     STDMETHOD(Draw) (THIS_ DrawContext* Context);
  37.     STDMETHOD (DoMouse)(THIS_ MouseEventType inMouseET, PlatformEvent* inEvent);
  38.  
  39.     // *** IPersistPropertyBag methods ***
  40.     STDMETHOD(Load)(IPropertyBag* PropBag, IErrorLog* ErrorLog);
  41.     
  42.     // *** CBaseEventServer methods ***
  43.     STDMETHOD (FireOneEvent)(REFIID RefID, long EventID, IUnknown* EventTarget, EventRecord* Event);
  44.  
  45. protected:
  46.     void SendMouseDownEvent(PlatformEvent* Event);
  47.     void SendMouseUpEvent(PlatformEvent* Event);
  48.     void UpdateButtonControl(void);
  49.     void CreateButtonControl(const WindowPtr window, const Rect * ctrlRect);
  50.     short Track(PlatformEvent* Event);
  51.     
  52. protected:
  53.     Str255            mButtonName;
  54.     ControlHandle    mButtonControl;
  55.     Boolean            mDoTracking;
  56.     char *            mCaption;
  57. };
  58.  
  59.  
  60. #endif // __CBUTTONCONTROL__
  61.