XTPCalendarWeekViewEvent.h
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:9k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // XTPCalendarWeekViewEvent.h: interface for the CXTPCalendarWeekViewEvent class.
  2. //
  3. // This file is a part of the XTREME CALENDAR MFC class library.
  4. // (c)1998-2008 Codejock Software, All Rights Reserved.
  5. //
  6. // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
  7. // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
  8. // CONSENT OF CODEJOCK SOFTWARE.
  9. //
  10. // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
  11. // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
  12. // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
  13. // SINGLE COMPUTER.
  14. //
  15. // CONTACT INFORMATION:
  16. // support@codejock.com
  17. // http://www.codejock.com
  18. //
  19. /////////////////////////////////////////////////////////////////////////////
  20. //{{AFX_CODEJOCK_PRIVATE
  21. #if !defined(__XTPCALENDARWEEKVIEWEVENT_H_)
  22. #define __XTPCALENDARWEEKVIEWEVENT_H_
  23. #if _MSC_VER > 1000
  24. #pragma once
  25. #endif // _MSC_VER > 1000
  26. //}}AFX_CODEJOCK_PRIVATE
  27. #include "XTPCalendarViewEvent.h"
  28. //#include "XTPCalendarWeekViewDay.h"
  29. class CXTPCalendarControl;
  30. class CXTPCalendarWeekView;
  31. class CXTPCalendarWeekViewDay;
  32. class CXTPCalendarWeekViewGroup;
  33. class CXTPCalendarEvent;
  34. struct XTP_CALENDAR_HITTESTINFO_WEEK_VIEW;
  35. //===========================================================================
  36. // Summary:
  37. //     This class represents an event view portion of the CalendarWeekViewDay.
  38. // Remarks:
  39. //     It represents a specific view of the event associated data according
  40. //     to various view types and display settings and provides basic
  41. //     functionality on this data using user input through the keyboard and mouse.
  42. //
  43. //          CXTPCalendarWeekViewEvent is based on CXTPCalendarViewEventT template
  44. //          class. CXTPCalendarWeekViewEvent inherits basic behavior from CXTPCalendarViewEventT.
  45. //          Furthermore, CXTPCalendarWeekViewEvent overlaps some functionality in
  46. //          CXTPCalendarViewEventT and also adds some new functionality for its
  47. //          own behavior and look.
  48. //
  49. // See Also: CXTPCalendarViewEvent, CXTPCalendarViewEventT
  50. //===========================================================================
  51. class _XTP_EXT_CLASS CXTPCalendarWeekViewEvent : public CXTPCalendarViewEventT<
  52. CXTPCalendarWeekViewGroup,
  53. XTP_CALENDAR_HITTESTINFO_WEEK_VIEW >
  54. {
  55. //{{AFX_CODEJOCK_PRIVATE
  56. DECLARE_DYNAMIC(CXTPCalendarWeekViewEvent)
  57. //}}AFX_CODEJOCK_PRIVATE
  58. public:
  59. //------------------------------------------------------------------------
  60. // Summary:
  61. //     Base class type definition.
  62. //------------------------------------------------------------------------
  63. typedef CXTPCalendarViewEventT< CXTPCalendarWeekViewGroup,
  64. XTP_CALENDAR_HITTESTINFO_WEEK_VIEW> TBase;
  65. //-----------------------------------------------------------------------
  66. // Summary:
  67. //     Default object constructor.
  68. // Parameters:
  69. //     pViewGroup - A pointer to a CXTPCalendarWeekViewGroup object.
  70. //     pEvent     - A pointer to a CXTPCalendarEvent.
  71. // See Also: ~CXTPCalendarWeekViewDay()
  72. //-----------------------------------------------------------------------
  73. CXTPCalendarWeekViewEvent(CXTPCalendarEvent* pEvent, CXTPCalendarWeekViewGroup* pViewGroup);
  74. //-----------------------------------------------------------------------
  75. // Summary:
  76. //     Default class destructor.
  77. //-----------------------------------------------------------------------
  78. virtual ~CXTPCalendarWeekViewEvent();
  79. //-----------------------------------------------------------------------
  80. // Summary:
  81. //     This member function is used to fill a XTP_CALENDAR_HITTESTINFO_WEEK_VIEW structure.
  82. // Parameters:
  83. //     point - A CPoint object that contains the point to test.
  84. //     pInfo - A pointer to a XTP_CALENDAR_HITTESTINFO_WEEK_VIEW struct.
  85. // Remarks:
  86. //     Call this member function to gather hit test information from
  87. //     the day view.
  88. // See Also: XTP_CALENDAR_HITTESTINFO_WEEK_VIEW
  89. //-----------------------------------------------------------------------
  90. virtual BOOL HitTestEx(CPoint point, XTP_CALENDAR_HITTESTINFO_WEEK_VIEW* pInfo);
  91. //-----------------------------------------------------------------------
  92. // Summary:
  93. //     This member function is used to adjust rectangles used to draw
  94. //     event view icons.
  95. // Parameters:
  96. //     rc - A CRect that contains the rectangle coordinates used to
  97. //          draw the view.
  98. // Remarks:
  99. //     Call this member function to calculate rectangles to draw event
  100. //     view icons. Depends on what glyphs should be drawn based on the
  101. //     event view rect.
  102. //-----------------------------------------------------------------------
  103. virtual int CalcIconsRect(CRect rc);
  104. //-----------------------------------------------------------------------
  105. // Summary:
  106. //     This member function is used to adjust the view's layout
  107. //     depending on the provided rectangle and also calls AdjustLayout()
  108. //     for all sub-items.
  109. // Parameters:
  110. //     pDC                 - A pointer to a valid device context.
  111. //     rcEventMax          - An int that contains the rectangle coordinates
  112. //                           used to draw the view.
  113. //     nEventPlaceNumber   - An int that contains the sequential place number.
  114. // Remarks:
  115. //     Call Populate(COleDateTime dtDayDate) prior calling AdjustLayout().
  116. //-----------------------------------------------------------------------
  117. virtual void AdjustLayout(CDC* pDC, const CRect& rcEventMax, int nEventPlaceNumber);
  118. virtual void AdjustLayout2(CDC* pDC, const CRect& rcEventMax, int nEventPlaceNumber); //<COMBINE AdjustLayout>
  119. //-----------------------------------------------------------------------
  120. // Summary:
  121. //     This member function is used to draw the view content using the
  122. //     specified device context.
  123. // Parameters:
  124. //     pDC - A pointer to a valid device context.
  125. // Remarks:
  126. //     Call AdjustLayout() before calling Draw().
  127. // See Also: AdjustLayout(CRect rcDay)
  128. //-----------------------------------------------------------------------
  129. virtual void Draw(CDC* pDC);
  130. //-----------------------------------------------------------------------
  131. // Summary:
  132. //     Call this member function to determine if the "view visible" flag is set.
  133. // Returns:
  134. //     A BOOL. TRUE if the "view visible" is set. FALSE otherwise.
  135. //-----------------------------------------------------------------------
  136. virtual BOOL IsVisible();
  137. //-----------------------------------------------------------------------
  138. // Summary:
  139. //     Call this member function to get the day view rectangle coordinates.
  140. // Returns:
  141. //     A CRect object with the day rectangle coordinates.
  142. // See Also: SetDayRect(CRect rcDay)
  143. //-----------------------------------------------------------------------
  144. CRect GetViewRect();
  145. //-----------------------------------------------------------------------
  146. // Summary:
  147. //     Call this member function to determine the value of the "show end time" flag.
  148. // Returns:
  149. //     A BOOL. TRUE if "show end time" flag is set. FALSE otherwise.
  150. //-----------------------------------------------------------------------
  151. BOOL IsShowEndTime();
  152. //-----------------------------------------------------------------------
  153. // Summary:
  154. //     Call this member function to determine the value of the "show time as clock" flag.
  155. // Returns:
  156. //     A BOOL. TRUE if the "show time as clock" flag is set. FALSE otherwise.
  157. //-----------------------------------------------------------------------
  158. BOOL IsTimeAsClock();
  159. //-----------------------------------------------------------------------
  160. // Summary:
  161. //     This member function is used to perform additional adjustments.
  162. // Remarks:
  163. //     Call this member function to perform additional adjustments after
  164. //     all adjustment activities are completed.
  165. //-----------------------------------------------------------------------
  166. virtual void OnPostAdjustLayout();
  167. protected:
  168. //-----------------------------------------------------------------------
  169. // Summary:
  170. //     Call this member function to determine the editor window font.
  171. // Returns:
  172. //     A pointer to a CFont object that contains the editor window font.
  173. //-----------------------------------------------------------------------
  174. virtual CFont* GetSubjectEditorFont();
  175. };
  176. ////////////////////////////////////////////////////////////////////////////
  177. AFX_INLINE CRect CXTPCalendarWeekViewEvent::GetViewRect() {
  178. return m_rcEvent;
  179. }
  180. #endif // !defined(__XTPCALENDARWEEKVIEWEVENT_H_)