void CControlState::Save( CEditX *pCtrl ) { if ( !pCtrl ) return; BOOL bSaveState = pCtrl->m_bRequiresSave; HWND hWnd = pCtrl->m_hWnd; ASSERT( IsWindow( hWnd ) ); pCtrl->put_Text( m_bstrText ); CM_EnableColorSyntax( hWnd, m_bColorSyntax ); CM_EnableSplitter( hWnd, TRUE, m_bAllowHSplit ); CM_EnableSplitter( hWnd, FALSE, m_bAllowVSplit ); CM_ShowScrollBar( hWnd, TRUE, m_bHScroll ); CM_ShowScrollBar( hWnd, FALSE, m_bVScroll ); CM_EnableSmoothScrolling( hWnd, m_bSmoothScroll ); CM_EnableLineToolTips( hWnd, m_bLineToolTips ); CM_EnableLeftMargin( hWnd, m_bShowLeftMargin ); CM_EnableColumnSel( hWnd, m_bAllowColumnSel ); CM_EnableDragDrop( hWnd, m_bAllowDragDrop ); CM_EnableTabExpand( hWnd, m_bExpandTabs ); CM_SetSplitterPos( hWnd, TRUE, m_xPosHSplitter ); CM_SetSplitterPos( hWnd, FALSE, m_yPosVSplitter ); CM_SetAutoIndentMode( hWnd, m_eIndentStyle ); CM_SetTabSize( hWnd, m_nTabSize ); CM_EnableWhitespaceDisplay( hWnd, m_bDisplayWhitespace ); CM_EnableCRLF( hWnd, m_bWantCarriageReturn ); EnableWindow( hWnd, m_bEnabled ); CM_EnableGlobalProps( hWnd, m_bGlobalProps ); CM_SetModified( hWnd, m_bModified ); CM_EnableOvertype( hWnd, m_bOverType ); CM_SetReadOnly( hWnd, m_bReadOnly ); CM_EnablePreserveCase( hWnd, m_bPreserveCase ); CM_EnableCaseSensitive( hWnd, m_bCaseSensitiveSearch ); CM_EnableWholeWord( hWnd, m_bWholeWordOnly ); CM_EnableRegExp( hWnd, m_bRegExp ); CM_SetUndoLimit( hWnd, m_nMaxUndo ); CM_SetColors( hWnd, &m_Colors ); CM_EnableSelBounds( hWnd, m_bSelBounds ); CM_EnableHideSel( hWnd, m_bHideSel ); CM_EnableNormalizeCase( hWnd, m_bNormalizeCase ); CM_EnableOvertypeCaret( hWnd, m_bOvertypeCaret ); SendMessage( hWnd, WM_SETFONT, ( WPARAM ) CreateFontIndirect( &m_lf ), 0 ); CM_SetFontOwnership( hWnd, TRUE ); CM_SetFontStyles( hWnd, &m_FontStyles ); CM_SetLineNumbering( hWnd, &m_LineNum ); pCtrl->put_Language( m_bstrLang ); CM_SetHighlightedLine( hWnd, m_nHighlightedLine ); CM_SetBorderStyle( hWnd, m_dwBorderStyle ); pCtrl->m_bStealKeys = m_bStealKeys; pCtrl->m_bRequiresSave = bSaveState; }
// this function exists only in the debug build and exists solely to catch compile errors in the CM_xxx macros void MacroVerify() { HWND hWnd = NULL; { LPCTSTR pszName = 0; CM_SetLanguage( hWnd, pszName ); } { LPCTSTR pszName = 0; CM_GetLanguage( hWnd, pszName ); } { BOOL bEnable = 0; CM_EnableColorSyntax( hWnd, bEnable ); } { CM_IsColorSyntaxEnabled( hWnd ); } { LPCTSTR pszFileName = 0; CM_OpenFile( hWnd, pszFileName ); } { LPCTSTR pszFileName = 0; CM_POSITION *pPos = 0; CM_InsertFile( hWnd, pszFileName, pPos ); } { LPCTSTR pszText = 0; CM_POSITION *pPos = 0; CM_InsertText( hWnd, pszText, pPos ); } { LPCTSTR pszText = 0; CM_SetText( hWnd, pszText ); } { CM_COLORS *pColors = 0; CM_SetColors( hWnd, pColors ); } { CM_COLORS *pColors = 0; CM_GetColors( hWnd, pColors ); } { BOOL bEnable = 0; CM_EnableWhitespaceDisplay( hWnd, bEnable ); } { CM_IsWhitespaceDisplayEnabled( hWnd ); } { BOOL bEnable = 0; CM_EnableTabExpand( hWnd, bEnable ); } { CM_IsTabExpandEnabled( hWnd ); } { BOOL bEnable = 0; CM_EnableSmoothScrolling( hWnd, bEnable ); } { CM_IsSmoothScrollingEnabled( hWnd ); } { int nTabSize = 0; CM_SetTabSize( hWnd, nTabSize ); } { CM_GetTabSize( hWnd ); } { BOOL bReadOnly = 0; CM_SetReadOnly( hWnd, bReadOnly ); } { CM_IsReadOnly( hWnd ); } { BOOL bEnable = 0; CM_EnableLineToolTips( hWnd, bEnable ); } { CM_IsLineToolTipsEnabled( hWnd ); } { BOOL bEnable = 0; CM_EnableLeftMargin( hWnd, bEnable ); } { CM_IsLeftMarginEnabled( hWnd ); } { BOOL bClearUndo = 0; LPCTSTR pszFileName = 0; CM_SaveFile( hWnd, bClearUndo, pszFileName ); } { LPCTSTR pszText = 0; CM_RANGE *pRange = 0; CM_ReplaceText( hWnd, pszText, pRange ); } { CM_RANGE *pRange = 0; BOOL bLogical = FALSE; CM_GetTextLength( hWnd, pRange, bLogical ); } { LPCTSTR pszBuff = 0; CM_RANGE *pRange = 0; CM_GetText( hWnd, pszBuff, pRange ); } { int nLine = 0; LPCTSTR pszBuff = 0; CM_GetLine( hWnd, nLine, pszBuff ); } { int nLine = 0; BOOL bLogical = FALSE; CM_GetLineLength( hWnd, nLine, bLogical ); } { LPCTSTR pszBuff = 0; CM_POSITION *pPos = 0; CM_GetWord( hWnd, pszBuff, pPos ); } { CM_POSITION *pPos = 0; BOOL bLogical = FALSE; CM_GetWordLength( hWnd, pPos, bLogical ); } { LPCTSTR pszText = 0; CM_AddText( hWnd, pszText ); } { int nLine = 0; CM_DeleteLine( hWnd, nLine ); } { int nLine = 0; LPCTSTR pszText = 0; CM_InsertLine( hWnd, nLine, pszText ); } { CM_RANGE *pRange = 0; BOOL bNormalized = 0; CM_GetSel( hWnd, pRange, bNormalized ); } { CM_RANGE *pRange = 0; BOOL bMakeVisible = 0; CM_SetSel( hWnd, pRange, bMakeVisible ); } { CM_DeleteSel( hWnd ); } { LPCTSTR pszText = 0; CM_ReplaceSel( hWnd, pszText ); } { WORD wCmd = 0; DWORD dwCmdData = 0; CM_ExecuteCmd( hWnd, wCmd, dwCmdData ); } { BOOL bHorz = 0; int nPos = 0; CM_SetSplitterPos( hWnd, bHorz, nPos ); } { BOOL bHorz = 0; CM_GetSplitterPos( hWnd, bHorz ); } { int nMode = 0; CM_SetAutoIndentMode( hWnd, nMode ); } { CM_GetAutoIndentMode( hWnd ); } { CM_CanUndo( hWnd ); } { CM_CanRedo( hWnd ); } { CM_Redo( hWnd ); } { CM_Undo( hWnd ); } { CM_ClearUndoBuffer( hWnd ); } { int nLimit = 0; CM_SetUndoLimit( hWnd, nLimit ); } { CM_GetUndoLimit( hWnd ); } { CM_IsModified( hWnd ); } { BOOL bModified = 0; CM_SetModified( hWnd, bModified ); } { BOOL bEnable = 0; CM_EnableOvertype( hWnd, bEnable ); } { CM_IsOvertypeEnabled( hWnd ); } { BOOL bEnable = 0; CM_EnableCaseSensitive( hWnd, bEnable ); } { CM_IsCaseSensitiveEnabled( hWnd ); } { BOOL bEnable = 0; CM_EnablePreserveCase( hWnd, bEnable ); } { CM_IsPreserveCaseEnabled( hWnd ); } { BOOL bEnable = 0; CM_EnableWholeWord( hWnd, bEnable ); } { CM_IsWholeWordEnabled( hWnd ); } { BOOL bEnable = 0; CM_EnableRegExp( hWnd, bEnable ); } { CM_IsRegExpEnabled( hWnd ); } { int nView = 0; int nLine = 0; CM_SetTopIndex( hWnd, nView, nLine ); } { int nView = 0; CM_GetTopIndex( hWnd, nView ); } { int nView = 0; BOOL bFullyVisible = 0; CM_GetVisibleLineCount( hWnd, nView, bFullyVisible ); } { BOOL bEnable = 0; CM_EnableCRLF( hWnd, bEnable ); } { CM_IsCRLFEnabled( hWnd ); } { CM_GetCurrentView( hWnd ); } { CM_GetViewCount( hWnd ); } { BOOL bHorz = 0; BOOL bShow = 0; CM_ShowScrollBar( hWnd, bHorz, bShow ); } { BOOL bHorz = 0; CM_HasScrollBar( hWnd, bHorz ); } { int xClient = 0; int yClient = 0; CM_RANGE *pRange = 0; CM_GetSelFromPoint( hWnd, xClient, yClient, pRange ); } { int nLine = 0; BOOL bMakeVisible = 0; CM_SelectLine( hWnd, nLine, bMakeVisible ); } { int xClient = 0; int yClient = 0; CM_HitTest( hWnd, xClient, yClient ); } { BOOL bEnable = 0; CM_EnableDragDrop( hWnd, bEnable ); } { CM_IsDragDropEnabled( hWnd ); } { BOOL bHorz = 0; BOOL bEnable = 0; CM_EnableSplitter( hWnd, bHorz, bEnable ); } { BOOL bHorz = 0; CM_IsSplitterEnabled( hWnd, bHorz ); } { BOOL bEnable = 0; CM_EnableColumnSel( hWnd, bEnable ); } { CM_IsColumnSelEnabled( hWnd ); } { BOOL bEnable = 0; CM_EnableGlobalProps( hWnd, bEnable ); } { CM_IsGlobalPropsEnabled( hWnd ); } { CM_IsRecordingMacro( hWnd ); } { CM_IsPlayingMacro( hWnd ); } { HWND hWndParent = 0; CM_SetDlgParent( hWnd, hWndParent ); } { BOOL bEnable = 0; CM_EnableSelBounds( hWnd, bEnable ); } { CM_IsSelBoundsEnabled( hWnd ); } { CM_FONTSTYLES *pFontStyles = NULL; CM_SetFontStyles( hWnd, pFontStyles ); } { CM_FONTSTYLES *pFontStyles = NULL; CM_GetFontStyles( hWnd, pFontStyles ); } { LPARAM lParam = 0; int nLine = 0; CM_SetItemData( hWnd, nLine, lParam ); } { int nLine = 0; CM_GetItemData( hWnd, nLine ); } { int nLine = 0; DWORD dwStyle = 0; CM_SetLineStyle( hWnd, nLine, dwStyle ); } { int nLine = 0; CM_GetLineStyle( hWnd, nLine ); } { int nLine = 0; BOOL bEnable = 0; CM_SetBookmark( hWnd, nLine, bEnable ); } { int nLine = 0; CM_GetBookmark( hWnd, nLine ); } { int nCount = 0; LPDWORD pdwLines = NULL; CM_SetAllBookmarks( hWnd, nCount, pdwLines ); } { LPDWORD pdwLines = NULL; CM_GetAllBookmarks( hWnd, pdwLines ); } { CM_LINENUMBERING *pNumbering = NULL; CM_SetLineNumbering( hWnd, pNumbering ); } { CM_LINENUMBERING *pNumbering = NULL; CM_GetLineNumbering( hWnd, pNumbering ); } { CM_POSITION *pPos = NULL; LPRECT pRect = NULL; CM_PosFromChar( hWnd, pPos, pRect ); } { BOOL bEnable = 0; CM_EnableHideSel( hWnd, bEnable ); } { CM_IsHideSelEnabled( hWnd ); } { int nLine = 0; CM_SetHighlightedLine( hWnd, nLine ); } { CM_GetHighlightedLine( hWnd ); } { int nLine = 0; BOOL bEnable = 0; CM_SetDivider( hWnd, nLine, bEnable ); } { int nLine = 0; CM_GetDivider( hWnd, nLine ); } { BOOL bEnable = 0; CM_EnableOvertypeCaret( hWnd, bEnable ); } { CM_IsOvertypeCaretEnabled( hWnd ); } { LPCTSTR pszText = NULL; CM_SetFindText( hWnd, pszText ); } { LPCTSTR pszText = NULL; CM_GetFindText( hWnd, pszText ); } { LPCTSTR pszText = NULL; CM_SetReplaceText( hWnd, pszText ); } { LPCTSTR pszText = NULL; CM_GetReplaceText( hWnd, pszText ); } { HIMAGELIST hImageList = NULL; CM_SetImageList( hWnd, hImageList ); } { CM_GetImageList( hWnd ); } { int nLine = 0; BYTE byImages = 0; CM_SetMarginImages( hWnd, nLine, byImages ); } { int nLine = 0; CM_GetMarginImages( hWnd, nLine ); } { CM_AboutBox( hWnd ); } { HDC hDC = NULL; WORD wFlags = 0; CM_Print( hWnd, hDC, wFlags ); } { int nLine = 0; int nCol = 0; CM_SetCaretPos( hWnd, nLine, nCol ); } { int nLine = 0; int nCol = 0; CM_ViewColToBufferCol( hWnd, nLine, nCol ); } { int nLine = 0; int nCol = 0; CM_BufferColToViewCol( hWnd, nLine, nCol ); } }