CODRichEditComponent Class

class CODRichEditComponent: public CODControlComponent

This is a windowed component class that encapsulates a rich edit control. It overrides the  CODWndComponent::CreateWnd and creates an rich edit control.

This class contains a number of functions that are simple wrappers around Windows API functions that take a window handle. For complete documentation on the wrapper functions, consult the Windows API documentation.

Defined in: OdWndComp.h

Class Members

 CODRichEditComponent(const UINT nCtlID = 1)

Constructor.

 CODRichEditComponent(const CODRichEditComponent& src)

Copy constructor.

virtual  ~CODRichEditComponent()

Destructor.

virtual BOOL  Create(const CRect& rcLocal)

Creates the window component.

virtual BOOL  CreateWnd(HWND hParent)

Creates and returns a window object to caller.

CODRichEditComponent&  operator=(const CODRichEditComponent& src)

Assignment operator.

virtual CODComponent*  Dup() const

Creates a copy of this component.

virtual void  Serialize(CArchive& ar)

Serializes the window component.

inline BOOL CanUndo() const

Determines if an editing operation can be undone.

inline int GetLineCount() const

Retrieves the number of lines in the rich edit control.

inline BOOL GetModify() const

Determines if the contents of this rich edit control have changed since the last save.

inline void SetModify(BOOL bModified = TRUE)

Sets the modification flag for the rich edit control.

inline void GetRect(LPRECT lpRect) const

Retrieves the formatting rectangle for the rich edit control.

inline POINT GetCharPos(long lChar) const

Determines the location of a given character within the rich edit control.

inline UINT SetOptions(WORD wOp, DWORD dwFlags)

Sets the options for this rich edit control.

inline int GetLine(int nIndex, LPTSTR lpszBuffer) const

Retrieves a line of text from the rich edit control.

inline int GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const

Retrieves a line of text from the rich edit control.

inline BOOL CanPaste(UINT nFormat = 0) const

Determines if the contents of the Clipboard can be pasted into the rich edit control.

inline void GetSel(long& nStartChar, long& nEndChar) const

Gets the current text selected in the rich edit control.

inline void GetSel(CHARRANGE &ampcr) const

Gets the starting and ending positions of the current selection in the rich edit control.

inline void LimitText(long nChars = 0)

Limits the amount of text a user can enter into the rich edit control.

inline long LineFromChar(long nIndex) const

Determines which line contains the given character.

inline int SetSel(long nStartChar, long nEndChar)

Sets the selection in the rich edit control.

inline int SetSel(CHARRANGE &ampcr)

Sets the selection in the rich edit control.

inline DWORD GetDefaultCharFormat(CHARFORMAT &ampcf) const

Retrieves the current default character formatting attributes in the rich edit control.

inline DWORD GetSelectionCharFormat(CHARFORMAT &ampcf) const

Retrieves the character formatting attributes in the current selection in the rich edit control.

inline long GetEventMask() const

Retrieves the event mask for the rich edit control.

inline long GetLimitText() const

Gets the current amount of text the rich edit control will accept.

inline DWORD GetParaFormat(PARAFORMAT &amppf) const

Retrieves the paragraph formatting attributes in the current selection in the rich edit control.

inline long GetSelText(LPSTR lpBuf) const

Gets the text of the current selection in the rich edit control.

inline WORD GetSelectionType() const

Retrieves the type of contents in the current selection in the rich edit control.

inline COLORREF SetBackgroundColor(BOOL bSysColor, COLORREF cr)

Sets the background color of the rich edit control.

inline BOOL SetDefaultCharFormat(CHARFORMAT &ampcf)

Sets the default character format in the rich edit control.

inline BOOL SetSelectionCharFormat(CHARFORMAT &ampcf)

Sets the character formatting attributes in the current selection in the rich edit control.

inline BOOL SetWordCharFormat(CHARFORMAT &ampcf)

Sets the character formatting attributes in the current word in the rich edit control.

inline DWORD SetEventMask(DWORD dwEventMask)

Sets the event mask for the rich edit control.

inline BOOL SetParaFormat(PARAFORMAT &amppf)

Sets the paragraph format for the rich edit control.

inline BOOL SetTargetDevice(HDC hDC, long lLineWidth)

Sets the target output device for the rich edit control.

inline long GetTextLength() const

Gets the length of the text in the rich edit control.

inline BOOL SetReadOnly(BOOL bReadOnly = TRUE)

Sets the read-only option for the rich edit control.

inline int GetFirstVisibleLine() const

Gets the index of the topmost visible line in the rich edit control.

inline void EmptyUndoBuffer()

Empties the undo buffer in the rich edit control.

inline int LineIndex(int nLine = -1) const

Get the character index of a line within the rich edit control.

inline int LineLength(int nLine = -1) const

Get the line length of the specified line.

inline BOOL LineScroll(int nLines, int nChars = 0)

Scroll the rich edit control.

inline void ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo = FALSE)

Replace the current selection.

inline void SetRect(LPCRECT lpRect)

Sets the formatting rectangle for the rich edit control.

inline BOOL DisplayBand(LPRECT pDisplayRect)

Displays a portion of the contents of the rich edit control.

inline long FindText(DWORD dwFlags, FINDTEXTEX* pFindText) const

Locate text within the rich edit control.

inline long FormatRange(FORMATRANGE* pfr, BOOL bDisplay = TRUE)

Format a specified range in the rich edit control.

inline void HideSelection(BOOL bHide, BOOL bPerm)

Hide the current selection in the rich edit control.

inline void PasteSpecial(UINT nClipFormat, DWORD dvAspect = 0, HMETAFILE hMF = 0)

Inserts the contents of the Clipboard into the rich edit control in the specified data format.

inline void RequestResize()

Forces the rich edit control to send request resize messages.

inline long StreamIn(int nFormat, EDITSTREAM& es)

Inserts text from an input stream.

inline long StreamOut(int nFormat, EDITSTREAM& es)

Stores text from the rich edit control into an output stream.

inline void ScrollCaret()

Scroll caret into view.

inline int InsertText(long nInsertAfterChar, LPCTSTR lpstrText, BOOL bCanUndo = FALSE)

Insert text into the rich edit control at after the specified character.

inline int AppendText(LPCTSTR lpstrText, BOOL bCanUndo = FALSE)

Append text to the rich edit control.

inline BOOL Undo()

Undo the last operation on the rich edit control.

inline void Clear()

Empty the contents of the rich edit control.

inline void Copy()

Copy the contents of the rich edit control to the Clipboard.

inline void Cut()

Cut the current selection in the rich edit control and copy it to the clipboard.

inline void Paste()

Paste the contents of the Clipboard into the rich edit control.

inline IRichEditOle* GetIRichEditOle() const

Retrieves a pointer to the IRichEditOle interface for this rich edit control.

inline BOOL SetOLECallback(IRichEditOleCallback* pCallback)

Sets the IRichEditOleCallback COM object for this rich edit control.