home *** CD-ROM | disk | FTP | other *** search
- // =================================================================================
- //
- // >>> ⌐ 1996-1997 Microsoft Corporation. All rights reserved. <<<
- //
- // =================================================================================
-
- #ifndef _H_CJSButtonControl
- #define _H_CJSButtoControl
- #pragma once
-
- #include "CBaseControl.h"
- #include "CBaseDispatch.h"
- #include "CBaseCPServer.h"
-
- class CJSButtonControl :
- public CBaseControl,
- public CBaseDispatch,
- public CBaseCPServer
- {
-
- public:
- // *** CJSButtonControl methods ***
- CJSButtonControl(void);
- ~CJSButtonControl(void);
-
- // *** IUnknown methods ***
- STDMETHOD (QueryInterface)(REFIID inRefID, void** outObj);
-
- // *** IControl methods ***
- STDMETHOD (Draw) (THIS_ AXDrawContext* inContext);
- STDMETHOD (DoMouse)(THIS_ AXMouseEventType inMouseET, AXPlatformEvent* inEvent);
-
- // *** IPersistPropertyBag methods ***
- STDMETHOD (InitNew)(void);
- STDMETHOD (Load)(IPropertyBag* PropertyBag, IErrorLog* ErrorLog);
- STDMETHOD (Save)(IPropertyBag* PropertyBag, BOOL ClearDirty, BOOL SaveAllProperties);
-
- /* IDispatch methods */
- STDMETHOD (GetIDsOfNames) (THIS_ REFIID inRefID, char** inNames, unsigned int inNameCount,
- LCID inLocaleID, DISPID* outDispID) ;
- STDMETHOD (Invoke) ( THIS_ DISPID inDispID, REFIID inRefID, LCID inLocaleID, unsigned short inFlags, DISPPARAMS* inParams,
- VARIANT* outResult, EXCEPINFO* outExcepInfo, unsigned int* outArgErr) ;
-
- // *** CBaseCPServer Overrides
- STDMETHOD (BroadcastMessage)(REFIID inRefID, Int32 inMessageID, IUnknown* inTarget, void* inUserData);
-
-
- private:
- Boolean mScriptClick; // True if we are inside a script click call
- char* mValue; // Current value of the button
- Int32 mLastMouseUpTime; // For tracking double clicks
-
- void WaitClick(void);
- void GetValueFromPropertyBag(IPropertyBag* PropertyBag, IErrorLog* ErrorLog);
-
- };
-
- // DISPIDs for the properties, methods and events this control supports
-
- #define kPropName 100 // Name property
- #define kPropValue 101 // Value property
- #define kMethodClick 102 // Click method
- #define kEventOnClick 103 // onClick event
-
-
-
- #endif
-