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

对话框与窗口

开发平台:

Visual C++

  1. // XTPCalendarWeekViewDay.h: interface for the CXTPCalendarWeekViewDay 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(__XTPCALENDARWEEKVIEWDAY_H_)
  22. #define __XTPCALENDARWEEKVIEWDAY_H_
  23. #if _MSC_VER > 1000
  24. #pragma once
  25. #endif // _MSC_VER > 1000
  26. //}}AFX_CODEJOCK_PRIVATE
  27. #include "XTPCalendarWeekViewEvent.h"
  28. #include "XTPCalendarViewDay.h"
  29. class CXTPCalendarWeekView;
  30. //===========================================================================
  31. // Summary:
  32. //     This class represents a single resource view portion of the Calendar
  33. //     Week View.
  34. // Remarks:
  35. //     It represents a specific view of the CalendarView's associated events
  36. //     data grouped by one day and one resource group. And provides basic
  37. //     functionality on this data using user input through keyboard and mouse.
  38. //
  39. // See Also: CXTPCalendarWeekViewDay
  40. //===========================================================================
  41. class _XTP_EXT_CLASS CXTPCalendarWeekViewGroup : public CXTPCalendarViewGroupT<
  42. CXTPCalendarWeekViewDay,
  43. CXTPCalendarWeekViewEvent,
  44. XTP_CALENDAR_HITTESTINFO_WEEK_VIEW,
  45. CXTPCalendarWeekViewGroup >
  46. {
  47. public:
  48. //------------------------------------------------------------------------
  49. // Summary:
  50. //     Base class type definition.
  51. //------------------------------------------------------------------------
  52. typedef CXTPCalendarViewGroupT<     CXTPCalendarWeekViewDay,
  53. CXTPCalendarWeekViewEvent,
  54. XTP_CALENDAR_HITTESTINFO_WEEK_VIEW,
  55. CXTPCalendarWeekViewGroup >  TBase;
  56. //-----------------------------------------------------------------------
  57. // Summary:
  58. //     Default object constructor.
  59. //     Construct CXTPCalendarWeekViewGroup object.
  60. // Parameters:
  61. //     pViewDay - Pointer to CXTPCalendarWeekViewDay object.
  62. //-----------------------------------------------------------------------
  63. CXTPCalendarWeekViewGroup(CXTPCalendarWeekViewDay* pViewDay);
  64. //-----------------------------------------------------------------------
  65. // Summary:
  66. //     Default class destructor.
  67. // Remarks:
  68. //     Handles class members deallocation.
  69. //-----------------------------------------------------------------------
  70. virtual ~CXTPCalendarWeekViewGroup();
  71. protected:
  72. // Summary:
  73. //     This member function is used to fill a XTP_CALENDAR_HITTESTINFO_WEEK_VIEW structure.
  74. // Parameters:
  75. //     pHitTest - A pointer to a XTP_CALENDAR_HITTESTINFO_WEEK_VIEW struct.
  76. // Remarks:
  77. //     Call this member function to gather hit test information from
  78. //     the week view group.
  79. // See Also: XTP_CALENDAR_HITTESTINFO_WEEK_VIEW
  80. //-----------------------------------------------------------------------
  81. virtual void FillHitTestEx(XTP_CALENDAR_HITTESTINFO_WEEK_VIEW* pHitTest);
  82. private:
  83. //-----------------------------------------------------------------------
  84. // Summary:
  85. //     This member function is used to obtain a pointer to itself.
  86. // Remarks:
  87. //     Call this member function to get the "this" pointer.
  88. // Returns:
  89. //     Pointer to a CXTPCalendarWeekViewGroup.
  90. //-----------------------------------------------------------------------
  91. virtual CXTPCalendarWeekViewGroup* GetPThis();
  92. };
  93. AFX_INLINE CXTPCalendarWeekViewGroup* CXTPCalendarWeekViewGroup::GetPThis() {
  94. return this;
  95. }
  96. //===========================================================================
  97. // Summary:
  98. //     This class represents a day view portion of the CalendarWeekView.
  99. // Remarks:
  100. //     It represents a specific view of the CalendarView's associated events
  101. //     data grouped by one day and provides basic functionality on this
  102. //     data using user input through the keyboard and mouse.
  103. //
  104. //          CXTPCalendarWeekViewDay is based on the CXTPCalendarViewDayT template
  105. //          class. CXTPCalendarWeekViewDay inherits basic behavior from the
  106. //          CXTPCalendarViewDayT class. Furthermore, class CXTPCalendarWeekViewDayand
  107. //          overlaps and adds some functionality for its own behavior and look.
  108. //
  109. // See Also: CXTPCalendarViewDay, CXTPCalendarViewDayT
  110. //===========================================================================
  111. class _XTP_EXT_CLASS CXTPCalendarWeekViewDay : public CXTPCalendarViewDayT<
  112. CXTPCalendarWeekView,
  113. CXTPCalendarWeekViewGroup,
  114. XTP_CALENDAR_HITTESTINFO_WEEK_VIEW,
  115. CXTPCalendarWeekViewDay >
  116. {
  117. //{{AFX_CODEJOCK_PRIVATE
  118. friend class CXTPCalendarWeekViewEvent;
  119. DECLARE_DYNAMIC(CXTPCalendarWeekViewDay)
  120. //}}AFX_CODEJOCK_PRIVATE
  121. public:
  122. //------------------------------------------------------------------------
  123. // Summary:
  124. //     Base class type definition.
  125. //------------------------------------------------------------------------
  126. typedef CXTPCalendarViewDayT<
  127. CXTPCalendarWeekView,
  128. CXTPCalendarWeekViewGroup,
  129. XTP_CALENDAR_HITTESTINFO_WEEK_VIEW,
  130. CXTPCalendarWeekViewDay>    TBase;
  131. //-----------------------------------------------------------------------
  132. // Summary:
  133. //     Default object constructor. Construct CXTPCalendarWeekViewDay
  134. //     object.
  135. // Parameters:
  136. //     pWeekView - Pointer to CXTPCalendarWeekView object.
  137. // See Also: ~CXTPCalendarWeekViewDay()
  138. //-----------------------------------------------------------------------
  139. CXTPCalendarWeekViewDay(CXTPCalendarWeekView* pWeekView);
  140. //-----------------------------------------------------------------------
  141. // Summary:
  142. //     Default class destructor.
  143. // Remarks:
  144. //     Handles member items deallocation.
  145. //-----------------------------------------------------------------------
  146. virtual ~CXTPCalendarWeekViewDay();
  147. //-----------------------------------------------------------------------
  148. // Summary:
  149. //     This member function is used to fill a XTP_CALENDAR_HITTESTINFO_WEEK_VIEW structure.
  150. // Parameters:
  151. //     pInfo - A pointer to a XTP_CALENDAR_HITTESTINFO_WEEK_VIEW struct.
  152. // Remarks:
  153. //     Call this member function to gather hit test information from
  154. //     the week view.
  155. // See Also: XTP_CALENDAR_HITTESTINFO_WEEK_VIEW
  156. //-----------------------------------------------------------------------
  157. virtual void FillHitTestEx(XTP_CALENDAR_HITTESTINFO_WEEK_VIEW* pInfo);
  158. //-----------------------------------------------------------------------
  159. // Summary:
  160. //     This member function is used to determine which view item,
  161. //     if any, is at the specified position index, and returns additional
  162. //     info in the _THitTest template object.
  163. // Parameters:
  164. //     pt       - A CPoint that contains the coordinates of the point test.
  165. //     pHitTest - A pointer to a _THitTest structure.
  166. // Remarks:
  167. //     Implements standard functionality for the HitTestEx method.
  168. // Returns:
  169. //     A BOOL. TRUE if the item is found. FALSE otherwise.
  170. // See Also: XTP_CALENDAR_HITTESTINFO
  171. //-----------------------------------------------------------------------
  172. virtual BOOL HitTestEx(CPoint pt, XTP_CALENDAR_HITTESTINFO_WEEK_VIEW* pHitTest);
  173. //-----------------------------------------------------------------------
  174. // Summary:
  175. //     This member function is used to adjust the view's layout depending
  176. //     on the provided rectangle and also calls AdjustLayout() for all
  177. //     sub-items.
  178. // Parameters:
  179. //     pDC   - A pointer to a valid device context.
  180. //     rcDay - A CRect object that contains the rectangle coordinates
  181. //             used to draw the day view.
  182. // Remarks:
  183. //     Call Populate(COleDateTime dtDayDate) prior to calling AdjustLayout().
  184. //-----------------------------------------------------------------------
  185. virtual void AdjustLayout(CDC* pDC, const CRect& rcDay);
  186. virtual void AdjustLayout2(CDC* pDC, const CRect& rcDay); //<COMBINE AdjustLayout>
  187. //-----------------------------------------------------------------------
  188. // Summary:
  189. //     This member function is used to draw the view content using the
  190. //     specified device context.
  191. // Parameters:
  192. //     pDC - A pointer to a valid device context.
  193. // Remarks:
  194. //     Call AdjustLayout() before calling Draw().
  195. // See Also: AdjustLayout(CRect rcDay)
  196. //-----------------------------------------------------------------------
  197. virtual void Draw(CDC* pDC);
  198. //-----------------------------------------------------------------------
  199. // Summary:
  200. //     This function is used to obtain a portion of a day rectangle
  201. //     used to draw event views.
  202. // Returns:
  203. //     A CRect object that contains the rectangle coordinates.
  204. //-----------------------------------------------------------------------
  205. CRect GetDayEventsRect() const;
  206. //-----------------------------------------------------------------------
  207. // Summary:
  208. //     This member function is used to obtain a single day's view caption.
  209. // Returns:
  210. //     A CString object that contains the day's view caption.
  211. //-----------------------------------------------------------------------
  212. virtual CString GetCaption();
  213. protected:
  214. //-----------------------------------------------------------------------
  215. // Summary:
  216. //     This member function is used to processes left mouse button events.
  217. // Parameters:
  218. //     nFlags  - A UINT that is used to indicates whether various virtual
  219. //               keys are down.
  220. //     point   - A CPoint that specifies the x- and y- coordinates of the cursor.
  221. //               These coordinates are always relative to the
  222. //               upper-left corner of the window.
  223. // Remarks:
  224. //     This method is called by the CalendarControl when the user
  225. //     presses the left mouse button.
  226. //-----------------------------------------------------------------------
  227. virtual BOOL OnLButtonDown(UINT nFlags, CPoint point);
  228. //-----------------------------------------------------------------------
  229. // Summary:
  230. //     This member function is used to processes mouse movement events.
  231. // Parameters:
  232. //     nFlags  - A UINT that is used to indicate whether various virtual
  233. //               keys are down.
  234. //     point   - A CPoint that specifies the x- and y- coordinates of the cursor.
  235. //               These coordinates are always relative to the
  236. //               upper-left corner of the window.
  237. // Remarks:
  238. //     This method is called by the CalendarControl when the user
  239. //     moves the mouse cursor or stylus.
  240. //-----------------------------------------------------------------------
  241. virtual void OnMouseMove(UINT nFlags, CPoint point);
  242. //-----------------------------------------------------------------------
  243. // Summary:
  244. //     This member function is used to obtain a pointer to itself.
  245. // Returns:
  246. //     A pointer to a CXTPCalendarWeekViewDay object.
  247. //-----------------------------------------------------------------------
  248. virtual CXTPCalendarWeekViewDay* GetPThis();
  249. };
  250. ////////////////////////////////////////////////////////////////////////////
  251. AFX_INLINE CXTPCalendarWeekViewDay* CXTPCalendarWeekViewDay::GetPThis() {
  252. return this;
  253. }
  254. #endif // !defined(__XTPCALENDARWEEKVIEWDAY_H_)