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 / Shapes / CShapesControl.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  1.4 KB  |  61 lines  |  [TEXT/CWIE]

  1. // =================================================================================
  2. //
  3. //    CClockControl.h                ©1996 Microsoft Corporation All rights reserved.
  4. //
  5. // =================================================================================
  6.  
  7. #ifndef _H_CShapesControl
  8. #define _H_CShapesControl
  9. #pragma once
  10.  
  11. #include "CBaseControl.h"
  12.  
  13. typedef enum
  14. {
  15.     BeginShapeType = 0,
  16.     OvalShapeType,
  17.     TriangleShapeType,
  18.     RectangleShapeType,
  19.     PentagonShapeType,
  20.     HexagonShapeType,
  21.     EndShapeType
  22. }
  23. ShapeType;
  24.  
  25. class CShapesControl : public CBaseControl
  26. {
  27.  
  28. public:
  29.     // *** CShapesControl methods ***
  30.     CShapesControl(void);
  31.     ~CShapesControl(void);
  32.  
  33.     // *** IControl methods ***
  34.     STDMETHOD (Draw) (THIS_ DrawContext* inContext);
  35.     STDMETHOD (GetUsedArea)(THIS_ PlatformRegion* outUsedArea);
  36.     STDMETHOD (DoMouse)(THIS_ MouseEventType inMouseET, PlatformEvent* inEvent);
  37.     STDMETHOD (DoIdle)(THIS_ Uint32 IdleRefCon);
  38.  
  39.     //  *** IPersistPropertyBag methods ***
  40.     STDMETHOD (Load)(IPropertyBag* PropBag, IErrorLog* ErrorLog);
  41.     STDMETHOD (LoadTextState)(IPropertyBag *PropertyBag, IErrorLog *ErrorLog);
  42.  
  43. protected:
  44.     virtual Boolean8    StartIdling(void);
  45.     virtual Boolean8    StopIdling(void);
  46.  
  47. private:
  48.     void DrawAllContexts();
  49.  
  50.     // *** private methods ***
  51.     void        DrawMe(Rect *BoundsRect);
  52.  
  53.     // *** private members ***
  54.     Point        mSize;
  55.     ShapeType    mCurrentShape;
  56.     Boolean8    mIsIdling;
  57.     Boolean8    mIsPressed;
  58. };
  59.  
  60. #endif
  61.