00001
00002
00003
00004
00005
00006
00007
00009
00010 #if !defined(AFX_DATETIMECELL_H__A0B7DA0A_0AFE_4D28_A00E_846C96D7507A__INCLUDED_)
00011 #define AFX_DATETIMECELL_H__A0B7DA0A_0AFE_4D28_A00E_846C96D7507A__INCLUDED_
00012
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #endif // _MSC_VER > 1000
00016
00017 #include "../GridCtrl_src/GridCell.h"
00018 #include "afxdtctl.h"
00019
00020 class CGridCellDateTime : public CGridCell
00021 {
00022 friend class CGridCtrl;
00023 DECLARE_DYNCREATE(CGridCellDateTime)
00024
00025 CTime m_cTime;
00026 DWORD m_dwStyle;
00027
00028 public:
00029 CGridCellDateTime();
00030 CGridCellDateTime(DWORD dwStyle);
00031 virtual ~CGridCellDateTime();
00032
00033
00034 public:
00035 void Init(DWORD dwStyle);
00036 virtual BOOL Edit(int nRow, int nCol, CRect rect, CPoint point, UINT nID, UINT nChar);
00037 virtual CWnd* GetEditWnd() const;
00038 virtual void EndEdit();
00039
00040
00041 CTime* GetTime() {return &m_cTime;};
00042 void SetTime(CTime time);
00043 };
00044
00045 class CInPlaceDateTime : public CDateTimeCtrl
00046 {
00047
00048 public:
00049 CInPlaceDateTime(CWnd* pParent,
00050 CRect& rect,
00051 DWORD dwStyle,
00052 UINT nID,
00053 int nRow, int nColumn,
00054 COLORREF crFore, COLORREF crBack,
00055 CTime* pcTime,
00056 UINT nFirstChar);
00057
00058
00059
00060
00061 protected:
00062 virtual void PostNcDestroy();
00063
00064
00065
00066 public:
00067 virtual ~CInPlaceDateTime();
00068 void EndEdit();
00069
00070
00071 protected:
00072
00073 afx_msg void OnKillFocus(CWnd* pNewWnd);
00074 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00075 afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
00076 afx_msg UINT OnGetDlgCode();
00077
00078
00079
00080 DECLARE_MESSAGE_MAP()
00081
00082 private:
00083 CTime* m_pcTime;
00084 int m_nRow;
00085 int m_nCol;
00086 UINT m_nLastChar;
00087 BOOL m_bExitOnArrows;
00088 COLORREF m_crForeClr, m_crBackClr;
00089 };
00090
00091 #endif // !defined(AFX_DATETIMECELL_H__A0B7DA0A_0AFE_4D28_A00E_846C96D7507A__INCLUDED_)