home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 16 / IOPROG_16.ISO / soft / macaxsdk / macsdk.hqx / ActiveX DR3 SDK / ActiveX SDK / QuickStart / JSButton•.rsrc / dFRK_5002 < prev    next >
Encoding:
Text File  |  1997-09-18  |  2.1 KB  |  68 lines

  1. // =================================================================================
  2. //
  3. // >>> ⌐ 1996-1997 Microsoft Corporation.  All rights reserved. <<<
  4. //
  5. // =================================================================================
  6.  
  7. #ifndef _H_CJSButtonControl
  8. #define _H_CJSButtoControl
  9. #pragma once
  10.  
  11. #include "CBaseControl.h"
  12. #include "CBaseDispatch.h"
  13. #include "CBaseCPServer.h"
  14.  
  15. class CJSButtonControl : 
  16.     public CBaseControl,
  17.     public CBaseDispatch,
  18.     public CBaseCPServer
  19. {
  20.  
  21. public:
  22.     // *** CJSButtonControl methods ***
  23.     CJSButtonControl(void);
  24.     ~CJSButtonControl(void);
  25.  
  26.     //  *** IUnknown methods ***
  27.     STDMETHOD (QueryInterface)(REFIID inRefID, void** outObj);
  28.  
  29.     // *** IControl methods ***
  30.     STDMETHOD (Draw) (THIS_ AXDrawContext* inContext);
  31.     STDMETHOD (DoMouse)(THIS_ AXMouseEventType inMouseET, AXPlatformEvent* inEvent);
  32.     
  33.     // *** IPersistPropertyBag methods ***
  34.     STDMETHOD (InitNew)(void);
  35.     STDMETHOD (Load)(IPropertyBag* PropertyBag, IErrorLog* ErrorLog);
  36.     STDMETHOD (Save)(IPropertyBag* PropertyBag, BOOL ClearDirty, BOOL SaveAllProperties);
  37.     
  38.     /* IDispatch methods */
  39.     STDMETHOD (GetIDsOfNames) (THIS_ REFIID inRefID, char** inNames, unsigned int inNameCount, 
  40.                                     LCID inLocaleID, DISPID* outDispID) ;
  41.     STDMETHOD (Invoke) ( THIS_ DISPID inDispID, REFIID inRefID, LCID inLocaleID, unsigned short inFlags, DISPPARAMS* inParams,
  42.                           VARIANT* outResult, EXCEPINFO* outExcepInfo, unsigned int* outArgErr) ;
  43.  
  44.     // *** CBaseCPServer Overrides
  45.     STDMETHOD (BroadcastMessage)(REFIID inRefID, Int32 inMessageID, IUnknown* inTarget, void* inUserData);
  46.     
  47.  
  48. private:
  49.     Boolean         mScriptClick;        // True if we are inside a script click call
  50.     char*            mValue;                // Current value of the button
  51.     Int32            mLastMouseUpTime;    // For tracking double clicks
  52.     
  53.     void WaitClick(void);
  54.     void GetValueFromPropertyBag(IPropertyBag* PropertyBag, IErrorLog* ErrorLog);
  55.  
  56. };
  57.  
  58. // DISPIDs for the properties, methods and events this control supports
  59.  
  60. #define kPropName         100    // Name property
  61. #define kPropValue         101    // Value property
  62. #define kMethodClick     102    // Click method
  63. #define kEventOnClick    103    // onClick event
  64.  
  65.  
  66.  
  67. #endif
  68.