| ||||||||
CDataEdit ClassThe
To use CDataEdit in your Visual Studio MFC project, just add DataEdit.cpp and DataEdit.h. Put a CDataEdit member variable in a parent window class such as a dialog or view. Note that CDataEdit is not derived from MFC CEdit and does not support CEdit methods. Here are some of the CDataEdit public methods: BOOL Create( CWnd* pParentWnd, UINT nID ); void SetSel( int nStartChar, int nEndChar, BOOL bNoScroll = FALSE ); void ReplaceSel( LPCTSTR lpszNewText ); CString GetText(); void SetText( CString& csText ); void ModifyText( CString& csText ); BOOL IsModified(); int Print( CDC* pDC, int nPage, CString csTitle = "" ); When a document is loaded, the carriage return and linefeed characters are not modified to conform to any standard. CRLF (0x0d0x0a) pairs are considered to be a combined end of line code. This way, mixtures of UNIX and PC end of line styles do not cause concern. PrintingThe
void CMarkupEditorView::OnBeginPrinting( CDC* pDC, CPrintInfo* pInfo )
{
// Paginate document
CString csTitle = GetDocument()->GetPathName();
if ( csTitle.IsEmpty() )
csTitle = GetDocument()->GetTitle();
int nMaxPage = m_edit.Print( pDC, 0, csTitle );
pInfo->SetMinPage( 1 );
pInfo->SetMaxPage( nMaxPage );
}
void CMarkupEditorView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
m_edit.Print( pDC, pInfo->m_nCurPage );
}
Text ValueAt any given time, the text value is a simple string in the
The | ||||||||
|
Posted October 7, 2002 updated September 27, 2004. Question or comment about this article? ©Copyright 2008 First Objective Software, Inc. All rights reserved. |