todocommentsctrl.h

来自「管理项目进度工具的原代码」· C头文件 代码 · 共 84 行

H
84
字号
#if !defined(AFX_TODOCOMMENTSCTRL_H__E9A5D982_4D40_43B2_A071_E3BE70D122B7__INCLUDED_)
#define AFX_TODOCOMMENTSCTRL_H__E9A5D982_4D40_43B2_A071_E3BE70D122B7__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// tdlcommentsctrl.h : header file
//

#include "..\shared\urlricheditctrl.h"
#include "..\shared\IContentControl.h"
#include "..\shared\richeditspellcheck.h"

/////////////////////////////////////////////////////////////////////////////
// CToDoCommentsCtrl window

class CToDoCommentsCtrl : public CUrlRichEditCtrl, public IContentControl
{
// Construction
public:
	CToDoCommentsCtrl();
	
	BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);

	// IContentControl implementation
	// supports plain text content only
	int GetTextContent(char* szContent, int nLength) const;
	bool SetTextContent(const char* szContent);
	int GetContent(unsigned char* /*pContent*/) const { return 0; }
	bool SetContent(unsigned char* /*pContent*/, int /*nLength*/) { return false; }
	void SetReadOnly(bool bReadOnly);
	HWND GetHwnd() const { return GetSafeHwnd(); }
	const char* GetTypeID() const { return "PLAIN_TEXT"; }
	void Release() { DestroyWindow(); delete this; }
	bool ProcessMessage(MSG* pMsg);
	ISpellCheck* GetSpellCheckInterface() { return &m_reSpellCheck; }

// Attributes
protected:
	BOOL m_bAllowNotify;
	BOOL m_bWordWrap;
	CRichEditSpellCheck m_reSpellCheck;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CToDoCommentsCtrl)
	protected:
	virtual void PreSubclassWindow();
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CToDoCommentsCtrl();

	// Generated message map functions
protected:
	//{{AFX_MSG(CToDoCommentsCtrl)
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnDestroy();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//}}AFX_MSG
	afx_msg void OnCommentsMenuCmd(UINT nCmdID);
	afx_msg void OnUpdateCommentsMenuCmd(CCmdUI* pCmdUI);
	afx_msg BOOL OnChangeText();
	afx_msg LRESULT OnSetFont(WPARAM wp, LPARAM lp);

	DECLARE_MESSAGE_MAP()

	virtual LRESULT SendNotifyCustomUrl(LPCTSTR szUrl) const;

protected:
	BOOL IsClipboardEmpty() const;
	void SetWordWrap(BOOL bWrap);

};

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_TODOCOMMENTSCTRL_H__E9A5D982_4D40_43B2_A071_E3BE70D122B7__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?