<< Return to Main Index

< Return to Class Index

CGXDateTimeCtrl::m_strDelim

CString m_strDelim;

Remarks

This member of class CString holds the delimiters that will be checked while parsing the input text for a valid date value. Please take a look at the implementation of ParseTextWithCurrentFormat. This function will be called from SetControlText. SetControlText will use COleDateTime to try and interpret the date supplied in text form (for example from the clipboard). If this fails then the control will attempt to parse the text into discrete strings that can be validated by the gadgets. These gadgets will be in the order that is determined by the current format. Here is a small snippet that shows the sequence of these calls

// SetControlText will attempt to convert the text to

// a valid date first with the help of COleDateTime

// and then with the help of the Date control and the

// current format

BOOL CGXDateTimeCtrl::SetControlText(ROWCOL nRow, ROWCOL nCol, const CString& strDisplay, UINT nFlags, const CGXStyle* pOldStyle)

{

………………………………………………………..

if (strDisplay.IsEmpty())

{

if (Grid()->IsCurrentCell(nRow, nCol))

Reset();

bSuccess = Grid()->SetValueRange(CGXRange(nRow, nCol), strDisplay, gxOverride, 0, nFlags);

}

else if (dt.ParseDateTime(strDisplay) && dt!=0)

{

SetDateTime(dt);

bSuccess = Grid()->SetValueRange(CGXRange(nRow, nCol), dt.Format(), gxOverride, 0, nFlags);

}

else

{

// parse the string using the current format

CStringArray strArray;

if (!ParseTextWithCurrentFormat(strDisplay, pOldStyle, strArray))

return FALSE;

See Also

CGXControl::SetControlText CGXDateTimeCtrl::ParseTextWithCurrentFormat

CGXDateTimeCtrl

Class Overview | Class Members