📄 htricheditctrl.h
字号:
#pragma once
#include "TitleMenu.h"
class CHTRichEditCtrl : public CRichEditCtrl
{
DECLARE_DYNAMIC(CHTRichEditCtrl)
public:
CHTRichEditCtrl();
virtual ~CHTRichEditCtrl();
void Init(LPCTSTR pszTitle, LPCTSTR pszSkinKey = NULL);
void SetProfileSkinKey(LPCTSTR pszSkinKey);
void SetTitle(LPCTSTR pszTitle);
void Localize();
void ApplySkin();
void AddEntry(LPCTSTR pszMsg);
void Add(LPCTSTR pszMsg, int iLen = -1);
void AddTyped(LPCTSTR pszMsg, int iLen, UINT uFlags);
void Reset();
CString GetLastLogEntry();
CString GetAllLogEntries();
bool SaveLog(LPCTSTR pszDefName = NULL);
void AppendText(const CString& sText, bool bInvalidate = true);
void AppendHyperLink(const CString& sText, const CString& sTitle, const CString& sCommand, const CString& sDirectory, bool bInvalidate = true);
void AppendKeyWord(const CString& sText, COLORREF cr);
void AppendColoredText(LPCTSTR pszText, COLORREF cr);
CString GetText() const;
void SetFont(CFont* pFont, BOOL bRedraw = TRUE);
CFont* GetFont() const;
protected:
bool m_bRichEdit;
CTitleMenu m_LogMenu;
int m_iLimitText;
bool m_bAutoScroll;
CStringArray m_astrBuff;
bool m_bNoPaint;
bool m_bEnErrSpace;
CString m_strTitle;
CString m_strSkinKey;
bool m_bRestoreFormat;
CHARFORMAT m_cfDefault;
void AddLine(LPCTSTR pszMsg, int iLen = -1, bool bLink = false, COLORREF cr = CLR_DEFAULT);
void SelectAllItems();
void CopySelectedItems();
int GetMaxSize();
void SafeAddLine(int nPos, LPCTSTR pszLine, int iLen, long& nStartChar, long& nEndChar, bool bLink, COLORREF cr);
void FlushBuffer();
void AddString(int nPos, LPCTSTR pszString, bool bLink, COLORREF cr);
void ScrollToLastLine();
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnEnErrspace();
afx_msg void OnEnMaxtext();
afx_msg BOOL OnEnLink(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnSysColorChange();
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -