home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-12-20 | 1.6 KB | 61 lines | [TEXT/CWIE] |
- ///////////////////////////////////////////////////////////////////////////////
- //
- // CButtonControl.h
- //
- //
-
- #ifndef __CBUTTONCONTROL__
- #define __CBUTTONCONTROL__
-
- #include "CBaseControl.h"
- #include "CBaseEventServer.h"
-
- const short NUM_CONNECTIONS = 1; // This control only has one connection point
-
- ///////////////////////////////////////////////////////////////////////////////
- //
- // Class definition
- //
-
- class CButtonControl :
- public CBaseControl,
- public CBaseEventServer
- {
- public:
-
- // *** CPictControl methods ***
- CButtonControl();
- ~CButtonControl();
-
- // *** IUnknown methods ***
- STDMETHOD (QueryInterface)(REFIID RefID, void** Obj);
- STDMETHOD_(ULONG,AddRef)(THIS) {CBaseControl::AddRef();}
- STDMETHOD_(ULONG,Release)(THIS) {CBaseControl::Release();}
-
- // *** IControl methods ***
- STDMETHOD(Draw) (THIS_ DrawContext* Context);
- STDMETHOD (DoMouse)(THIS_ MouseEventType inMouseET, PlatformEvent* inEvent);
-
- // *** IPersistPropertyBag methods ***
- STDMETHOD(Load)(IPropertyBag* PropBag, IErrorLog* ErrorLog);
-
- // *** CBaseEventServer methods ***
- STDMETHOD (FireOneEvent)(REFIID RefID, long EventID, IUnknown* EventTarget, EventRecord* Event);
-
- protected:
- void SendMouseDownEvent(PlatformEvent* Event);
- void SendMouseUpEvent(PlatformEvent* Event);
- void UpdateButtonControl(void);
- void CreateButtonControl(const WindowPtr window, const Rect * ctrlRect);
- short Track(PlatformEvent* Event);
-
- protected:
- Str255 mButtonName;
- ControlHandle mButtonControl;
- Boolean mDoTracking;
- char * mCaption;
- };
-
-
- #endif // __CBUTTONCONTROL__
-