Click here to Skip to main content
15,888,610 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.
// RulerRichEditCtrlDemoDlg.h : header file
//

#if !defined(AFX_RULERRICHEDITCTRLDEMODLG_H__DB95D038_618F_4D3B_94A2_FCF4AF7D79A1__INCLUDED_)
#define AFX_RULERRICHEDITCTRLDEMODLG_H__DB95D038_618F_4D3B_94A2_FCF4AF7D79A1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "RulerRichEditCtrl/RulerRichEditCtrl.h"

/////////////////////////////////////////////////////////////////////////////
// CRulerRichEditCtrlDemoDlg dialog

class CRulerRichEditCtrlDemoDlg : public CDialog
{
// Construction
public:
	CRulerRichEditCtrlDemoDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CRulerRichEditCtrlDemoDlg)
	enum { IDD = IDD_RULERRICHEDITCTRLDEMO_DIALOG };
	CButton	m_toolbar;
	CButton	m_ruler;
	CButton	m_new;
	CButton	m_save;
	CButton	m_load;
	CButton	m_ok;
	CStatic	m_placement;
	BOOL	m_showRuler;
	BOOL	m_showToolbar;
	BOOL	m_readOnly;
	//}}AFX_DATA

	//{{AFX_VIRTUAL(CRulerRichEditCtrlDemoDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	//{{AFX_MSG(CRulerRichEditCtrlDemoDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnButtonSave();
	afx_msg void OnButtonLoad();
	virtual void OnCancel();
	afx_msg void OnButtonNew();
	afx_msg void OnCheckShowRuler();
	afx_msg void OnCheckShowToolbar();
	afx_msg void OnCheckReadonly();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	CRulerRichEditCtrl	m_rtf;

};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_RULERRICHEDITCTRLDEMODLG_H__DB95D038_618F_4D3B_94A2_FCF4AF7D79A1__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