Click here to Skip to main content
15,888,579 members
Articles / Desktop Programming / MFC

CRulerRichEditCtrl - a complete RTF mini-editor

Rate me:
Please Sign up or sign in to vote.
4.92/5 (39 votes)
17 May 2005Public Domain7 min read 301.2K   18K   159  
A complete mini-editor with a formatting toolbar and a ruler with editable tab-positions.
#if !defined(AFX_RULERRICHEDIT_H__E10A8ED3_2E1D_402E_A599_003214085F1A__INCLUDED_)
#define AFX_RULERRICHEDIT_H__E10A8ED3_2E1D_402E_A599_003214085F1A__INCLUDED_

// RulerRichEdit.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CRulerRichEdit window

class CRulerRichEdit : public CRichEditCtrl
{
public:
// Construction/creation/destruction
	CRulerRichEdit();
	virtual ~CRulerRichEdit();

	BOOL Create( DWORD style, CRect rect, CWnd* parent );

protected:
// Message handlers
	//{{AFX_MSG(CRulerRichEdit)
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnChange();
	afx_msg UINT OnGetDlgCode();
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()

private:
// Private helpers
	void UpdateRuler();

};

#endif // !defined(AFX_RULERRICHEDIT_H__E10A8ED3_2E1D_402E_A599_003214085F1A__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication


Written By
Software Developer (Senior) Abstrakt Mekanik AB
Sweden Sweden
45 years old, married, three kids.

Started with computers more than 20 years ago on a CBM-64.

Read Theoretical Philosophy at the University of Lund.

Working as a C++ consultant developer.

Science-fiction freak. Enjoy vintage punkrock.

Comments and Discussions