soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SRichEdit Class Reference

RichEdit Control. More...

#include <SRichEdit.h>

Public Member Functions

 SRichEdit ()
 Constructor.
 
virtual ~SRichEdit ()
 Destructor.
 
DWORD SaveRtf (LPCTSTR pszFileName) OVERRIDE
 Save content to an RTF file.
 
DWORD LoadRtf (LPCTSTR pszFileName) OVERRIDE
 Load content from an RTF file.
 
void SetSel (long nStartChar, long nEndChar, BOOL bNoScroll) OVERRIDE
 Set the selection range.
 
void ReplaceSel (LPCTSTR pszText, BOOL bCanUndo=TRUE) OVERRIDE
 Replace the selected text.
 
BOOL GetWordWrap () SCONST OVERRIDE
 Get the word wrap setting.
 
void SetWordWrap (BOOL fWordWrap) OVERRIDE
 Set the word wrap setting.
 
BOOL GetReadOnly () SCONST OVERRIDE
 Check if the control is read-only.
 
BOOL SetReadOnly (BOOL bReadOnly) OVERRIDE
 Set the read-only state.
 
LONG GetLimitText () SCONST OVERRIDE
 Get the maximum text length.
 
BOOL SetLimitText (int nLength) OVERRIDE
 Set the maximum text length.
 
WORD GetDefaultAlign () SCONST OVERRIDE
 Get the default text alignment.
 
void SetDefaultAlign (WORD wNewAlign) OVERRIDE
 Set the default text alignment.
 
BOOL GetRichTextFlag () SCONST OVERRIDE
 Get the rich text flag.
 
void SetRichTextFlag (BOOL fRich) OVERRIDE
 Set the rich text flag.
 
LONG GetDefaultLeftIndent () SCONST OVERRIDE
 Get the default left indent.
 
void SetDefaultLeftIndent (LONG lNewIndent) OVERRIDE
 Set the default left indent.
 
BOOL SetSaveSelection (BOOL fSaveSelection) OVERRIDE
 Set the save selection flag.
 
COLORREF SetDefaultTextColor (COLORREF cr) OVERRIDE
 Set the default text color.
 
void SetWindowText (LPCTSTR lpszText) OVERRIDE
 Set the window text.
 
int GetWindowText (TCHAR *pBuf, int nBufLen, BOOL bRawText) OVERRIDE
 Get the window text.
 
BOOL SwndProc (UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *lResult) OVERRIDE
 Process window messages.
 
BOOL CreateCaret (HBITMAP pBmp, int nWid, int nHeight) OVERRIDE
 Create a caret.
 
SStringT GetWindowText (BOOL bRawText=FALSE)
 Get the window text.
 
void SetSel (DWORD dwSelection, BOOL bNoScroll=FALSE)
 Set the selection range.
 
int GetWindowTextLength () const
 Get the length of the window text.
 
virtual HRESULT SetAttribute (const SNS::SStringW &amp;amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;amp;strValue, BOOL bLoading=FALSE)
 Begin the attribute map for the SRichEdit class.
 

Protected Member Functions

int OnCreate (LPVOID lpCreateStruct)
 Handle creation of the control.
 
void OnDestroy ()
 Handle destruction of the control.
 
void OnPaint (IRenderTarget *pRT)
 Handle paint message.
 
void OnSetFocus (SWND wndOld)
 Handle set focus message.
 
void OnKillFocus (SWND wndFocus)
 Handle kill focus message.
 
void OnTimer (char idEvent)
 Handle timer message.
 
virtual UINT WINAPI OnGetDlgCode () const
 Get dialog code.
 
virtual BOOL OnScroll (BOOL bVertical, UINT uCode, int nPos)
 Handle scroll message.
 
virtual BOOL OnSetCursor (const CPoint &pt)
 Handle set cursor message.
 
virtual void OnScaleChanged (int nScale)
 Handle scale change message.
 
virtual void OnRebuildFont ()
 Handle rebuild font message.
 
BOOL IsRichScale () const
 Check if rich text scaling is enabled.
 
void OnEnable (BOOL bEnable, UINT nStatus)
 Handle enable message.
 
HRESULT InitDefaultCharFormat (CHARFORMAT2W *pcf, IFontS *pFont=NULL)
 Initialize default character format.
 
HRESULT InitDefaultParaFormat (PARAFORMAT2 *ppf)
 Initialize default paragraph format.
 
virtual HRESULT OnTxNotify (DWORD iNotify, LPVOID pv)
 Handle text notification.
 
void OnLButtonDown (UINT nFlags, CPoint point)
 Handle left button down message.
 
void OnLButtonUp (UINT nFlags, CPoint point)
 Handle left button up message.
 
void OnRButtonDown (UINT nFlags, CPoint point)
 Handle right button down message.
 
void OnMouseMove (UINT nFlags, CPoint point)
 Handle mouse move message.
 
BOOL OnMouseWheel (UINT nFlags, short zDelta, CPoint pt)
 Handle mouse wheel message.
 
void OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
 Handle key down message.
 
LRESULT OnButtonClick (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handle button click message.
 
void OnChar (UINT nChar, UINT nRepCnt, UINT nFlags)
 Handle character message.
 
void OnSetFont (IFontS *font, BOOL bRedraw)
 Handle set font message.
 
LRESULT OnSetText (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handle set text message.
 
LRESULT OnSetCharFormat (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handle set character format message.
 
LRESULT OnSetParaFormat (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handle set paragraph format message.
 
LRESULT OnSetReadOnly (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handle set read-only message.
 
LRESULT OnSetLimitText (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handle set limit text message.
 
LRESULT OnNcCalcSize (BOOL bCalcValidRects, LPARAM lParam)
 Handle non-client calculate size message.
 
void OnEnableDragDrop (BOOL bEnable)
 Enable or disable drag-and-drop.
 
LRESULT OnGetRect (UINT uMsg, WPARAM wp, LPARAM lp)
 Handle get rectangle message.
 
BOOL OnTxSetScrollPos (INT fnBar, INT nPos, BOOL fRedraw)
 Handle set scroll position message.
 
BOOL OnTxSetTimer (UINT idTimer, UINT uTimeout)
 Handle set timer message.
 
void OnTxKillTimer (UINT idTimer)
 Handle kill timer message.
 
BOOL OnTimeout (IEvtArgs *e)
 Handle timer timeout message.
 
HRESULT OnAttrTextColor (const SStringW &strValue, BOOL bLoading)
 Set text color attribute.
 
HRESULT OnAttrRTF (const SStringW &strValue, BOOL bLoading)
 Set RTF attribute.
 
HRESULT OnAttrAlign (const SStringW &strValue, BOOL bLoading)
 Set alignment attribute.
 
HRESULT OnAttrNotifyChange (const SStringW &strValue, BOOL bLoading)
 Handle the notify change attribute.
 
HRESULT OnAttrPasswordChar (const SStringW &strValue, BOOL bLoading)
 Handle the password character attribute.
 
HRESULT OnAttrEnableDragdrop (const SStringW &strValue, BOOL bLoading)
 Handle the enable dragdrop attribute.
 
HRESULT OnAttrReStyle (const SStringW &strValue, DWORD dwStyle, DWORD txtBit, BOOL bLoading)
 Handle the restyle attribute.
 
HRESULT OnAttrReStyle2 (const SStringW &strValue, DWORD dwStyle, DWORD txtBit, BOOL bLoading)
 Handle the restyle attribute (variant)
 

Protected Attributes

CHARFORMAT2W m_cfDef
 
PARAFORMAT2 m_pfDef
 
DWORD m_cchTextMost
 
TCHAR m_chPasswordChar
 
LONG m_lAccelPos
 
SIZEL m_sizelExtent
 
CRect m_rcInset
 
int m_nFontHeight
 
DWORD m_dwStyle
 
UINT m_fEnableAutoWordSel: 1
 
UINT m_fWordWrap: 1
 
UINT m_fRich: 1
 
UINT m_fSaveSelection: 1
 
UINT m_fTransparent: 1
 
UINT m_fVertical: 1
 
UINT m_fAllowBeep: 1
 
UINT m_fWantTab: 1
 
UINT m_fSingleLineVCenter: 1
 
UINT m_fScrollPending: 1
 
UINT m_fEnableDragDrop: 1
 
UINT m_fAutoSel: 1
 
UINT m_fNotifyChange: 1
 
UINT m_fDisableCaret: 1
 
BYTE m_byDbcsLeadByte
 
SStringW m_strRtfSrc
 
STextHostm_pTxtHost
 
SMap< UINT, SAutoRefPtr< ITimer > > m_mapTimer
 

Friends

class STextHost
 
class SApplication
 

Detailed Description

RichEdit Control.

A control that uses a windowless RichEdit to implement an edit control.

Definition at line 31 of file SRichEdit.h.

Constructor & Destructor Documentation

◆ SRichEdit()

SRichEdit::SRichEdit ( )

Constructor.

Definition at line 1125 of file SRichEdit.cpp.

◆ ~SRichEdit()

virtual SRichEdit::~SRichEdit ( )
inlinevirtual

Destructor.

Definition at line 46 of file SRichEdit.h.

Member Function Documentation

◆ CreateCaret()

BOOL SRichEdit::CreateCaret ( HBITMAP pBmp,
int nWid,
int nHeight )

Create a caret.

Parameters
pBmpBitmap for the caret
nWidWidth of the caret
nHeightHeight of the caret
Returns
TRUE if successful, FALSE otherwise

Definition at line 2245 of file SRichEdit.cpp.

◆ GetDefaultAlign()

WORD SRichEdit::GetDefaultAlign ( )

Get the default text alignment.

Returns
Default text alignment

Definition at line 1569 of file SRichEdit.cpp.

◆ GetDefaultLeftIndent()

LONG SRichEdit::GetDefaultLeftIndent ( )

Get the default left indent.

Returns
Default left indent

Definition at line 1594 of file SRichEdit.cpp.

◆ GetLimitText()

LONG SRichEdit::GetLimitText ( )

Get the maximum text length.

Returns
Maximum text length

Definition at line 1559 of file SRichEdit.cpp.

◆ GetReadOnly()

BOOL SRichEdit::GetReadOnly ( )

Check if the control is read-only.

Returns
TRUE if read-only, FALSE otherwise

Definition at line 1549 of file SRichEdit.cpp.

◆ GetRichTextFlag()

BOOL SRichEdit::GetRichTextFlag ( )

Get the rich text flag.

Returns
TRUE if rich text is enabled, FALSE otherwise

Definition at line 1582 of file SRichEdit.cpp.

◆ GetWindowText() [1/2]

SStringT SRichEdit::GetWindowText ( BOOL bRawText = FALSE)
virtual

Get the window text.

Parameters
bRawTextWhether to get raw text
Returns
Window text

Reimplemented from SWindow.

Definition at line 1964 of file SRichEdit.cpp.

◆ GetWindowText() [2/2]

int SRichEdit::GetWindowText ( TCHAR * pBuf,
int nBufLen,
BOOL bRawText )

Get the window text.

Parameters
pBufBuffer to store the text
nBufLenLength of the buffer
bRawTextWhether to get raw text
Returns
Length of the text

Definition at line 1948 of file SRichEdit.cpp.

◆ GetWindowTextLength()

int SRichEdit::GetWindowTextLength ( ) const

Get the length of the window text.

Returns
Length of the window text

Definition at line 1975 of file SRichEdit.cpp.

◆ GetWordWrap()

BOOL SRichEdit::GetWordWrap ( void )

Get the word wrap setting.

Returns
TRUE if word wrap is enabled, FALSE otherwise

Definition at line 1538 of file SRichEdit.cpp.

◆ InitDefaultCharFormat()

HRESULT SRichEdit::InitDefaultCharFormat ( CHARFORMAT2W * pcf,
IFontS * pFont = NULL )
protected

Initialize default character format.

Parameters
pcfCharacter format structure
pFontFont to apply
Returns
Result of the initialization

Definition at line 1455 of file SRichEdit.cpp.

◆ InitDefaultParaFormat()

HRESULT SRichEdit::InitDefaultParaFormat ( PARAFORMAT2 * ppf)
protected

Initialize default paragraph format.

Parameters
ppfParagraph format structure
Returns
Result of the initialization

Definition at line 1509 of file SRichEdit.cpp.

◆ IsRichScale()

BOOL SRichEdit::IsRichScale ( ) const
protected

Check if rich text scaling is enabled.

Returns
TRUE if enabled, FALSE otherwise

Definition at line 2334 of file SRichEdit.cpp.

◆ LoadRtf()

DWORD SRichEdit::LoadRtf ( LPCTSTR pszFileName)

Load content from an RTF file.

Parameters
pszFileNameFile name to load the RTF content
Returns
Number of bytes read

Definition at line 2180 of file SRichEdit.cpp.

◆ OnAttrAlign()

HRESULT SRichEdit::OnAttrAlign ( const SStringW & strValue,
BOOL bLoading )
protected

Set alignment attribute.

Parameters
strValueAttribute value
bLoadingLoading flag
Returns
Result of the attribute setting

Definition at line 2131 of file SRichEdit.cpp.

◆ OnAttrEnableDragdrop()

HRESULT SRichEdit::OnAttrEnableDragdrop ( const SStringW & strValue,
BOOL bLoading )
protected

Handle the enable dragdrop attribute.

SRichEdit::OnAttrEnableDragdrop

Parameters
constSStringW &strValue – The attribute value as a string
BOOLbLoading – Indicates if the attribute is being loaded
Returns
Returns HRESULT indicating success or failure

Describe This function processes the "enableDragdrop" attribute, which determines whether drag-and-drop operations are enabled in the control.

Definition at line 2288 of file SRichEdit.cpp.

◆ OnAttrNotifyChange()

HRESULT SRichEdit::OnAttrNotifyChange ( const SStringW & strValue,
BOOL bLoading )
protected

Handle the notify change attribute.

SRichEdit::OnAttrNotifyChange

Parameters
constSStringW &strValue – The attribute value as a string
BOOLbLoading – Indicates if the attribute is being loaded
Returns
Returns HRESULT indicating success or failure

Describe This function processes the "notifyChange" attribute, which determines whether the control should receive notifications when data changes.

Definition at line 2152 of file SRichEdit.cpp.

◆ OnAttrPasswordChar()

HRESULT SRichEdit::OnAttrPasswordChar ( const SStringW & strValue,
BOOL bLoading )
protected

Handle the password character attribute.

SRichEdit::OnAttrPasswordChar

Parameters
constSStringW &strValue – The attribute value as a string
BOOLbLoading – Indicates if the attribute is being loaded
Returns
Returns HRESULT indicating success or failure

Describe This function processes the "passwordChar" attribute, which sets the character used to display password input.

Definition at line 2281 of file SRichEdit.cpp.

◆ OnAttrReStyle()

HRESULT SRichEdit::OnAttrReStyle ( const SStringW & strValue,
DWORD dwStyle,
DWORD txtBit,
BOOL bLoading )
protected

Handle the restyle attribute.

SRichEdit::OnAttrReStyle

Parameters
constSStringW &strValue – The attribute value as a string
DWORDdwStyle – The style to apply
DWORDtxtBit – The text bit to apply
BOOLbLoading – Indicates if the attribute is being loaded
Returns
Returns HRESULT indicating success or failure

Describe This function processes various restyle attributes, applying the specified style and text bit to the control.

Definition at line 2252 of file SRichEdit.cpp.

◆ OnAttrReStyle2()

HRESULT SRichEdit::OnAttrReStyle2 ( const SStringW & strValue,
DWORD dwStyle,
DWORD txtBit,
BOOL bLoading )
protected

Handle the restyle attribute (variant)

SRichEdit::OnAttrReStyle2

Parameters
constSStringW &strValue – The attribute value as a string
DWORDdwStyle – The style to apply
DWORDtxtBit – The text bit to apply
BOOLbLoading – Indicates if the attribute is being loaded
Returns
Returns HRESULT indicating success or failure

Describe This function processes additional restyle attributes, applying the specified style and text bit to the control.

Definition at line 2267 of file SRichEdit.cpp.

◆ OnAttrRTF()

HRESULT SRichEdit::OnAttrRTF ( const SStringW & strValue,
BOOL bLoading )
protected

Set RTF attribute.

Parameters
strValueAttribute value
bLoadingLoading flag
Returns
Result of the attribute setting

Definition at line 2066 of file SRichEdit.cpp.

◆ OnAttrTextColor()

HRESULT SRichEdit::OnAttrTextColor ( const SStringW & strValue,
BOOL bLoading )
protected

Set text color attribute.

Parameters
strValueAttribute value
bLoadingLoading flag
Returns
Result of the attribute setting

Definition at line 2009 of file SRichEdit.cpp.

◆ OnButtonClick()

LRESULT SRichEdit::OnButtonClick ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handle button click message.

Parameters
uMsgMessage identifier
wParamAdditional message-specific information
lParamAdditional message-specific information
Returns
Result of the message processing

Definition at line 1639 of file SRichEdit.cpp.

◆ OnChar()

void SRichEdit::OnChar ( UINT nChar,
UINT nRepCnt,
UINT nFlags )
protected

Handle character message.

Parameters
nCharCharacter code
nRepCntRepeat count
nFlagsCharacter flags

Definition at line 1734 of file SRichEdit.cpp.

◆ OnCreate()

int SRichEdit::OnCreate ( LPVOID lpCreateStruct)
protected

Handle creation of the control.

Parameters
lpCreateStructCreate structure
Returns
Result of the creation

Definition at line 1157 of file SRichEdit.cpp.

◆ OnDestroy()

void SRichEdit::OnDestroy ( )
protected

Handle destruction of the control.

Definition at line 1203 of file SRichEdit.cpp.

◆ OnEnable()

void SRichEdit::OnEnable ( BOOL bEnable,
UINT nStatus )
protected

Handle enable message.

Parameters
bEnableEnable flag
nStatusStatus code

Definition at line 2212 of file SRichEdit.cpp.

◆ OnEnableDragDrop()

void SRichEdit::OnEnableDragDrop ( BOOL bEnable)
protected

Enable or disable drag-and-drop.

Parameters
bEnableEnable flag

Definition at line 2117 of file SRichEdit.cpp.

◆ OnGetDlgCode()

UINT SRichEdit::OnGetDlgCode ( ) const
protectedvirtual

Get dialog code.

Returns
Dialog code

Definition at line 1335 of file SRichEdit.cpp.

◆ OnGetRect()

LRESULT SRichEdit::OnGetRect ( UINT uMsg,
WPARAM wp,
LPARAM lp )
protected

Handle get rectangle message.

Parameters
uMsgMessage identifier
wpAdditional message-specific information
lpAdditional message-specific information
Returns
Result of the message processing

Definition at line 2298 of file SRichEdit.cpp.

◆ OnKeyDown()

void SRichEdit::OnKeyDown ( UINT nChar,
UINT nRepCnt,
UINT nFlags )
protected

Handle key down message.

Parameters
nCharKey code
nRepCntRepeat count
nFlagsKey flags

Definition at line 1711 of file SRichEdit.cpp.

◆ OnKillFocus()

void SRichEdit::OnKillFocus ( SWND wndFocus)
protected

Handle kill focus message.

Parameters
wndFocusNew focus window handle

Definition at line 1303 of file SRichEdit.cpp.

◆ OnLButtonDown()

void SRichEdit::OnLButtonDown ( UINT nFlags,
CPoint point )
protected

Handle left button down message.

Parameters
nFlagsMouse flags
pointMouse coordinates

Definition at line 1618 of file SRichEdit.cpp.

◆ OnLButtonUp()

void SRichEdit::OnLButtonUp ( UINT nFlags,
CPoint point )
protected

Handle left button up message.

Parameters
nFlagsMouse flags
pointMouse coordinates

Definition at line 1633 of file SRichEdit.cpp.

◆ OnMouseMove()

void SRichEdit::OnMouseMove ( UINT nFlags,
CPoint point )
protected

Handle mouse move message.

Parameters
nFlagsMouse flags
pointMouse coordinates

Definition at line 1706 of file SRichEdit.cpp.

◆ OnMouseWheel()

BOOL SRichEdit::OnMouseWheel ( UINT nFlags,
short zDelta,
CPoint pt )
protected

Handle mouse wheel message.

Parameters
nFlagsMouse flags
zDeltaWheel delta
ptMouse coordinates
Returns
TRUE if successful, FALSE otherwise

Definition at line 2231 of file SRichEdit.cpp.

◆ OnNcCalcSize()

LRESULT SRichEdit::OnNcCalcSize ( BOOL bCalcValidRects,
LPARAM lParam )
protected

Handle non-client calculate size message.

Parameters
bCalcValidRectsWhether to calculate valid rectangles
lParamAdditional message-specific information
Returns
Result of the message processing

Definition at line 1788 of file SRichEdit.cpp.

◆ OnPaint()

void SRichEdit::OnPaint ( IRenderTarget * pRT)
protected

Handle paint message.

Parameters
pRTRendering target handle

Definition at line 1218 of file SRichEdit.cpp.

◆ OnRButtonDown()

void SRichEdit::OnRButtonDown ( UINT nFlags,
CPoint point )
protected

Handle right button down message.

Parameters
nFlagsMouse flags
pointMouse coordinates

Definition at line 1645 of file SRichEdit.cpp.

◆ OnRebuildFont()

void SRichEdit::OnRebuildFont ( )
protectedvirtual

Handle rebuild font message.

Reimplemented from SWindow.

Definition at line 2206 of file SRichEdit.cpp.

◆ OnScaleChanged()

void SRichEdit::OnScaleChanged ( int nScale)
protectedvirtual

Handle scale change message.

Parameters
nScaleNew scale factor

Reimplemented from SPanel.

Definition at line 2193 of file SRichEdit.cpp.

◆ OnScroll()

BOOL SRichEdit::OnScroll ( BOOL bVertical,
UINT uCode,
int nPos )
protectedvirtual

Handle scroll message.

Parameters
bVerticalTRUE if vertical scroll, FALSE if horizontal
uCodeScroll code
nPosScroll position
Returns
TRUE if successful, FALSE otherwise

Reimplemented from SPanel.

Definition at line 1345 of file SRichEdit.cpp.

◆ OnSetCharFormat()

LRESULT SRichEdit::OnSetCharFormat ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handle set character format message.

Parameters
uMsgMessage identifier
wParamAdditional message-specific information
lParamAdditional message-specific information
Returns
Result of the message processing

Definition at line 1853 of file SRichEdit.cpp.

◆ OnSetCursor()

BOOL SRichEdit::OnSetCursor ( const CPoint & pt)
protectedvirtual

Handle set cursor message.

Parameters
ptMouse coordinates
Returns
TRUE if successful, FALSE otherwise

Reimplemented from SWindow.

Definition at line 1420 of file SRichEdit.cpp.

◆ OnSetFocus()

void SRichEdit::OnSetFocus ( SWND wndOld)
protected

Handle set focus message.

Parameters
wndOldPrevious focus window handle

Definition at line 1284 of file SRichEdit.cpp.

◆ OnSetFont()

void SRichEdit::OnSetFont ( IFontS * font,
BOOL bRedraw )
protected

Handle set font message.

Parameters
fontFont to apply
bRedrawWhether to redraw the control

Definition at line 1924 of file SRichEdit.cpp.

◆ OnSetLimitText()

LRESULT SRichEdit::OnSetLimitText ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handle set limit text message.

Parameters
uMsgMessage identifier
wParamAdditional message-specific information
lParamAdditional message-specific information
Returns
Result of the message processing

Definition at line 1843 of file SRichEdit.cpp.

◆ OnSetParaFormat()

LRESULT SRichEdit::OnSetParaFormat ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handle set paragraph format message.

Parameters
uMsgMessage identifier
wParamAdditional message-specific information
lParamAdditional message-specific information
Returns
Result of the message processing

Definition at line 1870 of file SRichEdit.cpp.

◆ OnSetReadOnly()

LRESULT SRichEdit::OnSetReadOnly ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handle set read-only message.

Parameters
uMsgMessage identifier
wParamAdditional message-specific information
lParamAdditional message-specific information
Returns
Result of the message processing

Definition at line 1838 of file SRichEdit.cpp.

◆ OnSetText()

LRESULT SRichEdit::OnSetText ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handle set text message.

Parameters
uMsgMessage identifier
wParamAdditional message-specific information
lParamAdditional message-specific information
Returns
Result of the message processing

Definition at line 1903 of file SRichEdit.cpp.

◆ OnTimeout()

BOOL SRichEdit::OnTimeout ( IEvtArgs * e)
protected

Handle timer timeout message.

Parameters
eEvent arguments
Returns
TRUE if successful, FALSE otherwise

Definition at line 2327 of file SRichEdit.cpp.

◆ OnTimer()

void SRichEdit::OnTimer ( char idEvent)
protected

Handle timer message.

Parameters
idEventTimer ID

Definition at line 1322 of file SRichEdit.cpp.

◆ OnTxKillTimer()

void SRichEdit::OnTxKillTimer ( UINT idTimer)
protected

Handle kill timer message.

Parameters
idTimerTimer ID

Definition at line 2322 of file SRichEdit.cpp.

◆ OnTxNotify()

HRESULT SRichEdit::OnTxNotify ( DWORD iNotify,
LPVOID pv )
protectedvirtual

Handle text notification.

Parameters
iNotifyNotification code
pvNotification data
Returns
Result of the notification handling

Definition at line 1527 of file SRichEdit.cpp.

◆ OnTxSetScrollPos()

BOOL SRichEdit::OnTxSetScrollPos ( INT fnBar,
INT nPos,
BOOL fRedraw )
protected

Handle set scroll position message.

Parameters
fnBarScroll bar identifier
nPosScroll position
fRedrawWhether to redraw the control
Returns
TRUE if successful, FALSE otherwise

Definition at line 928 of file SRichEdit.cpp.

◆ OnTxSetTimer()

BOOL SRichEdit::OnTxSetTimer ( UINT idTimer,
UINT uTimeout )
protected

Handle set timer message.

Parameters
idTimerTimer ID
uTimeoutTimeout interval
Returns
TRUE if successful, FALSE otherwise

Definition at line 2304 of file SRichEdit.cpp.

◆ ReplaceSel()

void SRichEdit::ReplaceSel ( LPCTSTR pszText,
BOOL bCanUndo = TRUE )

Replace the selected text.

Parameters
pszTextText to replace the selection
bCanUndoWhether the operation can be undone

Definition at line 1985 of file SRichEdit.cpp.

◆ SaveRtf()

DWORD SRichEdit::SaveRtf ( LPCTSTR pszFileName)

Save content to an RTF file.

Parameters
pszFileNameFile name to save the RTF content
Returns
Number of bytes written

Definition at line 2167 of file SRichEdit.cpp.

◆ SetAttribute()

virtual HRESULT SRichEdit::SetAttribute ( const SNS::SStringW &amp;amp;amp;amp; strAttribName,
const SNS::SStringW &amp;amp;amp;amp; strValue,
BOOL bLoading = FALSE )
inlinevirtual

Begin the attribute map for the SRichEdit class.

SRichEdit::SOUI_ATTRS_BEGIN

Describe This macro starts the definition of the attribute map, which maps XML attributes to member variables and custom handlers.

Reimplemented from SPanel.

Definition at line 631 of file SRichEdit.h.

◆ SetDefaultAlign()

void SRichEdit::SetDefaultAlign ( WORD wNewAlign)

Set the default text alignment.

Parameters
wNewAlignNew text alignment

Definition at line 1574 of file SRichEdit.cpp.

◆ SetDefaultLeftIndent()

void SRichEdit::SetDefaultLeftIndent ( LONG lNewIndent)

Set the default left indent.

Parameters
lNewIndentNew left indent

Definition at line 1599 of file SRichEdit.cpp.

◆ SetDefaultTextColor()

COLORREF SRichEdit::SetDefaultTextColor ( COLORREF cr)

Set the default text color.

Parameters
crNew text color
Returns
Previous text color

Definition at line 2105 of file SRichEdit.cpp.

◆ SetLimitText()

BOOL SRichEdit::SetLimitText ( int nLength)

Set the maximum text length.

Parameters
nLengthMaximum text length
Returns
TRUE if successful, FALSE otherwise

Definition at line 1564 of file SRichEdit.cpp.

◆ SetReadOnly()

BOOL SRichEdit::SetReadOnly ( BOOL bReadOnly)

Set the read-only state.

Parameters
bReadOnlyTRUE to set read-only, FALSE to allow editing
Returns
TRUE if successful, FALSE otherwise

Definition at line 1554 of file SRichEdit.cpp.

◆ SetRichTextFlag()

void SRichEdit::SetRichTextFlag ( BOOL fRich)

Set the rich text flag.

Parameters
fRichTRUE to enable rich text, FALSE to disable

Definition at line 1587 of file SRichEdit.cpp.

◆ SetSaveSelection()

BOOL SRichEdit::SetSaveSelection ( BOOL fSaveSelection)

Set the save selection flag.

Parameters
fSaveSelectionTRUE to save selection, FALSE otherwise
Returns
TRUE if successful, FALSE otherwise

Definition at line 1606 of file SRichEdit.cpp.

◆ SetSel() [1/2]

void SRichEdit::SetSel ( DWORD dwSelection,
BOOL bNoScroll = FALSE )

Set the selection range.

Parameters
dwSelectionSelection range
bNoScrollWhether to scroll to the selection

Definition at line 1995 of file SRichEdit.cpp.

◆ SetSel() [2/2]

void SRichEdit::SetSel ( long nStartChar,
long nEndChar,
BOOL bNoScroll )

Set the selection range.

Parameters
nStartCharStart character position
nEndCharEnd character position
bNoScrollWhether to scroll to the selection

Definition at line 2002 of file SRichEdit.cpp.

◆ SetWindowText()

void SRichEdit::SetWindowText ( LPCTSTR lpszText)

Set the window text.

Parameters
lpszTextNew window text

Definition at line 1932 of file SRichEdit.cpp.

◆ SetWordWrap()

void SRichEdit::SetWordWrap ( BOOL fWordWrap)

Set the word wrap setting.

Parameters
fWordWrapTRUE to enable word wrap, FALSE to disable

Definition at line 1543 of file SRichEdit.cpp.

◆ SwndProc()

BOOL SRichEdit::SwndProc ( UINT uMsg,
WPARAM wParam,
LPARAM lParam,
LRESULT * lResult )

Process window messages.

Parameters
uMsgMessage identifier
wParamAdditional message-specific information
lParamAdditional message-specific information
lResultPointer to the result
Returns
TRUE if the message was processed, FALSE otherwise

Definition at line 1433 of file SRichEdit.cpp.

Friends And Related Symbol Documentation

◆ SApplication

friend class SApplication
friend

Definition at line 33 of file SRichEdit.h.

◆ STextHost

friend class STextHost
friend

Definition at line 32 of file SRichEdit.h.

Member Data Documentation

◆ m_byDbcsLeadByte

BYTE SRichEdit::m_byDbcsLeadByte
protected

DBCS输入时的中文头字节

Definition at line 689 of file SRichEdit.h.

◆ m_cchTextMost

DWORD SRichEdit::m_cchTextMost
protected

Maximum number of characters

Definition at line 666 of file SRichEdit.h.

◆ m_cfDef

CHARFORMAT2W SRichEdit::m_cfDef
protected

Default character format

Definition at line 664 of file SRichEdit.h.

◆ m_chPasswordChar

TCHAR SRichEdit::m_chPasswordChar
protected

Character used for password input

Definition at line 667 of file SRichEdit.h.

◆ m_dwStyle

DWORD SRichEdit::m_dwStyle
protected

Definition at line 672 of file SRichEdit.h.

◆ m_fAllowBeep

UINT SRichEdit::m_fAllowBeep
protected

Whether message beep is allowed in the control

Definition at line 680 of file SRichEdit.h.

◆ m_fAutoSel

UINT SRichEdit::m_fAutoSel
protected

有焦点时自动全选

Definition at line 686 of file SRichEdit.h.

◆ m_fDisableCaret

UINT SRichEdit::m_fDisableCaret
protected

disable caret flag

Definition at line 688 of file SRichEdit.h.

◆ m_fEnableAutoWordSel

UINT SRichEdit::m_fEnableAutoWordSel
protected

Enable Word style auto word selection?

Definition at line 674 of file SRichEdit.h.

◆ m_fEnableDragDrop

UINT SRichEdit::m_fEnableDragDrop
protected

允许在该控件中使用拖放

Definition at line 685 of file SRichEdit.h.

◆ m_fNotifyChange

UINT SRichEdit::m_fNotifyChange
protected

receive re_notify when data changed

Definition at line 687 of file SRichEdit.h.

◆ m_fRich

UINT SRichEdit::m_fRich
protected

Whether control is rich text

Definition at line 676 of file SRichEdit.h.

◆ m_fSaveSelection

UINT SRichEdit::m_fSaveSelection
protected

Whether to save the selection when inactive

Definition at line 677 of file SRichEdit.h.

◆ m_fScrollPending

UINT SRichEdit::m_fScrollPending
protected

Whether scroll is activated by richedit or by panelex

Definition at line 684 of file SRichEdit.h.

◆ m_fSingleLineVCenter

UINT SRichEdit::m_fSingleLineVCenter
protected

Whether control that is single line will be vertical centered

Definition at line 682 of file SRichEdit.h.

◆ m_fTransparent

UINT SRichEdit::m_fTransparent
protected

Whether control is transparent

Definition at line 678 of file SRichEdit.h.

◆ m_fVertical

UINT SRichEdit::m_fVertical
protected

Whether control is layout following vertical

Definition at line 679 of file SRichEdit.h.

◆ m_fWantTab

UINT SRichEdit::m_fWantTab
protected

Whether control will deal with tab input

Definition at line 681 of file SRichEdit.h.

◆ m_fWordWrap

UINT SRichEdit::m_fWordWrap
protected

Whether control should word wrap

Definition at line 675 of file SRichEdit.h.

◆ m_lAccelPos

LONG SRichEdit::m_lAccelPos
protected

Position of accelerator

Definition at line 668 of file SRichEdit.h.

◆ m_mapTimer

SMap<UINT, SAutoRefPtr<ITimer> > SRichEdit::m_mapTimer
protected

map of timer to id

Definition at line 692 of file SRichEdit.h.

◆ m_nFontHeight

int SRichEdit::m_nFontHeight
protected

Height of single line text output

Definition at line 671 of file SRichEdit.h.

◆ m_pfDef

PARAFORMAT2 SRichEdit::m_pfDef
protected

Default paragraph format

Definition at line 665 of file SRichEdit.h.

◆ m_pTxtHost

STextHost* SRichEdit::m_pTxtHost
protected

Host of Richedit

Definition at line 691 of file SRichEdit.h.

◆ m_rcInset

CRect SRichEdit::m_rcInset
protected

Inset margin

Definition at line 670 of file SRichEdit.h.

◆ m_sizelExtent

SIZEL SRichEdit::m_sizelExtent
protected

Extent array

Definition at line 669 of file SRichEdit.h.

◆ m_strRtfSrc

SStringW SRichEdit::m_strRtfSrc
protected

在XML中指定的RTF数据源

Definition at line 690 of file SRichEdit.h.


The documentation for this class was generated from the following files: