Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. // HoursCtl.h : Declaration of the CHoursCtrl OLE control class.
  5. File History:
  6. JonY May-96 created
  7. --*/
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CHoursCtrl : See HoursCtl.cpp for implementation.
  10. class CHoursCtrl : public COleControl
  11. {
  12. DECLARE_DYNCREATE(CHoursCtrl)
  13. // Constructor
  14. public:
  15. CHoursCtrl();
  16. // Overrides
  17. // Drawing function
  18. virtual void OnDraw(
  19. CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  20. // Persistence
  21. virtual void DoPropExchange(CPropExchange* pPX);
  22. // Reset control state
  23. virtual void OnResetState();
  24. virtual BOOL PreTranslateMessage(LPMSG lpmsg);
  25. private:
  26. CFont* m_pFont;
  27. struct
  28. {
  29. USHORT x;
  30. USHORT y;
  31. USHORT cx;
  32. USHORT cy;
  33. BOOL bVal; // TRUE = access allowed (default)
  34. BOOL bSelected;
  35. USHORT row;
  36. USHORT col;
  37. } m_sCell[202]; // 169 cells + 7 days + 24 hours + 1 big
  38. CString csDay[7];
  39. CPoint pointDrag;
  40. USHORT GetCellID(CPoint point);
  41. void InvalidateCell(USHORT sCellID);
  42. public:
  43. short m_sCurrentCol;
  44. short m_sCurrentRow;
  45. short m_sCurrentLoc();
  46. void Click(CPoint point);
  47. void ToggleDay(UINT nID);
  48. void ToggleCol(UINT nID);
  49. void OnBigButton();
  50. BOOL bToggle;
  51. // Implementation
  52. protected:
  53. ~CHoursCtrl();
  54. DECLARE_OLECREATE_EX(CHoursCtrl) // Class factory and guid
  55. DECLARE_OLETYPELIB(CHoursCtrl) // GetTypeInfo
  56. DECLARE_PROPPAGEIDS(CHoursCtrl) // Property page IDs
  57. DECLARE_OLECTLTYPE(CHoursCtrl) // Type name and misc status
  58. // Message maps
  59. //{{AFX_MSG(CHoursCtrl)
  60. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  61. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  62. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  63. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  64. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  65. //}}AFX_MSG
  66. DECLARE_MESSAGE_MAP()
  67. // Dispatch maps
  68. //{{AFX_DISPATCH(CHoursCtrl)
  69. OLE_COLOR m_crPermitColor;
  70. afx_msg void OnCrPermitColorChanged();
  71. OLE_COLOR m_crDenyColor;
  72. afx_msg void OnCrDenyColorChanged();
  73. afx_msg VARIANT GetDateData();
  74. afx_msg void SetDateData(const VARIANT FAR& newValue);
  75. //}}AFX_DISPATCH
  76. DECLARE_DISPATCH_MAP()
  77. // Event maps
  78. //{{AFX_EVENT(CHoursCtrl)
  79. //}}AFX_EVENT
  80. DECLARE_EVENT_MAP()
  81. // Dispatch and event IDs
  82. public:
  83. enum {
  84. //{{AFX_DISP_ID(CHoursCtrl)
  85. dispidCrPermitColor = 1L,
  86. dispidCrDenyColor = 2L,
  87. dispidDateData = 3L,
  88. //}}AFX_DISP_ID
  89. };
  90. };