Int nMaxPage = m_edit.Print( pDC, 0, csTitle ) void CMarkupEditorView::OnBeginPrinting( CDC* pDC, CPrintInfo* pInfo )ĬString csTitle = GetDocument()->GetPathName() The following simple code can be used to support print and print preview in a CView where the CDataEdit control is m_edit. The Print method is used for printing a particular page and for paginating ( nPage=0). This way, mixtures of UNIX and PC end of line styles do not cause concern. CRLF ( 0x0d 0x0a) pairs are considered to be a combined end of line code. ![]() When a document is loaded, the carriage return and linefeed characters are not modified to conform to any standard. Void SetVerticalTextOffset( int nOffset ) Void SetHorizontalTextOffset( int nOffset ) Static void GetDefaultLogFont( LOGFONT* pLF ) Int Print( CDC* pDC, int nPage, CString csTitle = "" ) Void ModifyText( CString& csText, BOOL bCanUndo = TRUE ) Void ReplaceSel( CString csNewText, BOOL bRedraw = TRUE ) Void GetSel( int& nStartChar, int& nEndChar ) const īOOL LocateWord( int& nStart, int& nEnd ) īOOL GoToLine( int nLine, int nCharPos = 0 ) īOOL FindOccurrence( CString csFindWhat, int& nStart, int& nEnd, int nFlags = 0 ) Void SetSel( int nStartChar, int nEndChar, BOOL bNoScroll = FALSE ) ![]() Here are some of the CDataEdit public methods:īOOL Create( CWnd* pParentWnd, UINT nID, HFONT hFont = NULL ) īOOL CreateEditBox( CWnd* pParentWnd, UINT nID, HFONT hFont = NULL ) Note that CDataEdit is not derived from MFC CEdit and does not necessarily support CEdit methods. ![]() Put a CDataEdit member variable in a parent window class such as a dialog or view. ![]() Also you will likely need to add imm32.lib to your Project Settings -> Link -> General -> Object/Library modules due to Windows IME support. To use CDataEdit in your Visual Studio MFC project, just add DataEdit.cpp and DataEdit.h. The source code for CDataEdit comes in the firstobject XML Editor with the Advanced CMarkup Developer License. See CDataEdit specific notes in the firstobject XML Editor release notes. It provides editing of text in fixed or variable width fonts and supports undo/redo and printing. The CDataEdit class is a standalone MFC edit control derived directly from CWnd using a Unicode UTF-8 or UTF-16 text string that can be over a gigabyte.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |