Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

GridCellDateTime.h

00001 // GridCellDateTime.h: interface for the CGridCellDateTime class.
00002 //
00003 // Provides the implementation for a datetime picker cell type of the
00004 // grid control.
00005 //
00006 // For use with CGridCtrl v2.22+
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 "GridCell.h"
00018 #include "afxdtctl.h"   // for CDateTimeCtrl
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   // editing cells
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 // Construction
00048 public:
00049         CInPlaceDateTime(CWnd* pParent,         // parent
00050                    CRect& rect,           // dimensions & location
00051                    DWORD dwStyle,         // window/combobox style
00052                    UINT nID,              // control ID
00053                    int nRow, int nColumn, // row and column
00054                    COLORREF crFore, COLORREF crBack,  // Foreground, background colour
00055                    CTime* pcTime,
00056                            UINT nFirstChar);      // first character to pass to control
00057 
00058 // Overrides
00059         // ClassWizard generated virtual function overrides
00060         //{{AFX_VIRTUAL(CInPlaceList)
00061         protected:
00062         virtual void PostNcDestroy();
00063         //}}AFX_VIRTUAL
00064 
00065 // Implementation
00066 public:
00067         virtual ~CInPlaceDateTime();
00068     void EndEdit();
00069 
00070 // Generated message map functions
00071 protected:
00072         //{{AFX_MSG(CInPlaceList)
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         //}}AFX_MSG
00078         //afx_msg void OnSelendOK();
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_)

Generated on Tue Feb 17 02:03:03 2004 for harlem by doxygen 1.3.6