CGridListCtrlEx
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CGridEditorDateTimeCtrl Class Reference

CDateTimeCtrl for inplace edit. For internal use by CGridColumnTraitDateTime. More...

Inheritance diagram for CGridEditorDateTimeCtrl:

Public Member Functions

 CGridEditorDateTimeCtrl (int nRow, int nCol, CGridColumnTraitDateTime *pColumnTrait=NULL)
 CGridEditorDateTimeCtrl - Constructor. More...
 

Protected Member Functions

afx_msg void OnKillFocus (CWnd *pNewWnd)
 WM_KILLFOCUS message handler called when CDateTimeCtrl is loosing focus to other control. More...
 
afx_msg void OnDateTimeChange (NMHDR *pNMHDR, LRESULT *pResult)
 DTN_DATETIMECHANGE notification handler to monitor date modifications. More...
 
afx_msg void OnUserString (NMHDR *pNMHDR, LRESULT *pResult)
 DTN_USERSTRING notification handler to convert clipboard to datetime. More...
 
afx_msg void OnChar (UINT nChar, UINT nRepCnt, UINT nFlags)
 WM_CHAR message handler to monitor date modifications. More...
 
afx_msg void OnCloseUp (NMHDR *pNMHDR, LRESULT *pResult)
 DTN_CLOSEUP notification message handler called when CMonthCalCtrl window has closed. More...
 
virtual void EndEdit (bool bSuccess)
 The cell value editor was closed and the entered should be saved. More...
 
virtual void PostNcDestroy ()
 Called by the default OnNcDestroy (WM_NCDESTROY) message handler, when CDateTimeCtrl window has been be destroyed. More...
 
virtual BOOL PreTranslateMessage (MSG *pMsg)
 Hook to proces windows messages before they are dispatched. More...
 
 DECLARE_MESSAGE_MAP ()
 

Protected Attributes

bool m_Completed
 Ensure the editor only reacts to a single close event.
 
bool m_Modified
 Register if date was modified while the editor was open.
 
int m_Row
 The index of the row being edited.
 
int m_Col
 The index of the column being edited.
 
CGridColumnTraitDateTimem_pColumnTrait
 Provides logic for parsing free text editing.
 

Detailed Description

CDateTimeCtrl for inplace edit. For internal use by CGridColumnTraitDateTime.

Constructor & Destructor Documentation

CGridEditorDateTimeCtrl::CGridEditorDateTimeCtrl ( int  nRow,
int  nCol,
CGridColumnTraitDateTime pColumnTrait = NULL 
)

CGridEditorDateTimeCtrl - Constructor.

Parameters
nRowThe index of the row
nColThe index of the column
pColumnTraitThe parent column trait, used for datetime validation

Member Function Documentation

void CGridEditorDateTimeCtrl::EndEdit ( bool  bSuccess)
protectedvirtual

The cell value editor was closed and the entered should be saved.

Parameters
bSuccessShould the entered cell value be saved
void CGridEditorDateTimeCtrl::OnChar ( UINT  nChar,
UINT  nRepCnt,
UINT  nFlags 
)
protected

WM_CHAR message handler to monitor date modifications.

Parameters
nCharSpecifies the virtual key code of the given key.
nRepCntRepeat count (the number of times the keystroke is repeated as a result of the user holding down the key).
nFlagsSpecifies the scan code, key-transition code, previous key state, and context code
void CGridEditorDateTimeCtrl::OnCloseUp ( NMHDR *  pNMHDR,
LRESULT *  pResult 
)
protected

DTN_CLOSEUP notification message handler called when CMonthCalCtrl window has closed.

Fallback solution for closing inplace CDateTimeCtrl, in case focus is not given back to the CDateTimeCtrl.

Parameters
pNMHDRPointer to NMHDR structure
pResultIs not used
void CGridEditorDateTimeCtrl::OnDateTimeChange ( NMHDR *  pNMHDR,
LRESULT *  pResult 
)
protected

DTN_DATETIMECHANGE notification handler to monitor date modifications.

Parameters
pNMHDRPointer to NMDATETIMECHANGE structure
pResultMust be set to zero
void CGridEditorDateTimeCtrl::OnKillFocus ( CWnd *  pNewWnd)
protected

WM_KILLFOCUS message handler called when CDateTimeCtrl is loosing focus to other control.

Used register that cell value editor should close.

Parameters
pNewWndPointer to the window that receives the input focus (may be NULL or may be temporary).
void CGridEditorDateTimeCtrl::OnUserString ( NMHDR *  pNMHDR,
LRESULT *  pResult 
)
protected

DTN_USERSTRING notification handler to convert clipboard to datetime.

Parameters
pNMHDRPointer to NMDATETIMESTRING structure
pResultMust be set to zero
void CGridEditorDateTimeCtrl::PostNcDestroy ( )
protectedvirtual

Called by the default OnNcDestroy (WM_NCDESTROY) message handler, when CDateTimeCtrl window has been be destroyed.

Used to delete the inplace CDateTimeCtrl editor object as well. This is necessary when the CDateTimeCtrl is created dynamically.

BOOL CGridEditorDateTimeCtrl::PreTranslateMessage ( MSG *  pMsg)
protectedvirtual

Hook to proces windows messages before they are dispatched.

Catch keyboard events that can should cause the cell value editor to close

Parameters
pMsgPoints to a MSG structure that contains the message to process
Returns
Nonzero if the message was translated and should not be dispatched; 0 if the message was not translated and should be dispatched.