AutoRichEditCtrl.h
上传用户:niucheng
上传日期:2007-01-02
资源大小:56k
文件大小:2k
源码类别:

RichEdit

开发平台:

Visual C++

  1. #if !defined(AFX_AUTORICHEDITCTRL_H__C26D1E0E_DD32_11D2_B39F_000092914562__INCLUDED_)
  2. #define AFX_AUTORICHEDITCTRL_H__C26D1E0E_DD32_11D2_B39F_000092914562__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // AutoRichEditCtrl.h : header file
  7. //
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CAutoRichEditCtrl window
  10. class CAutoRichEditCtrl : public CRichEditCtrl
  11. {
  12. // Construction
  13. public:
  14. CAutoRichEditCtrl();
  15. // Attributes
  16. public:
  17. // Operations
  18. public:
  19. // Overrides
  20. // ClassWizard generated virtual function overrides
  21. //{{AFX_VIRTUAL(CAutoRichEditCtrl)
  22. //}}AFX_VIRTUAL
  23. // Implementation
  24. public:
  25. long GetSelectionFontSize();
  26. CString GetSelectionFontName();
  27. CStringArray m_saFontList;
  28. void GetSystemFonts(CStringArray &saFontList);
  29. void SetFontSize(int nPointSize);
  30. void SetFontName(CString sFontName);
  31. void SelectColor();
  32. bool ParagraphIsBulleted();
  33. void SetParagraphBulleted();
  34. PARAFORMAT GetParagraphFormat();
  35. bool ParagraphIsRight();
  36. bool ParagraphIsLeft();
  37. bool ParagraphIsCentered();
  38. void SetParagraphRight();
  39. void SetParagraphLeft();
  40. void SetParagraphCenter();
  41. CHARFORMAT GetCharFormat(DWORD dwMask = CFM_COLOR | CFM_FACE | CFM_SIZE | CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE);
  42. bool SelectionIsBold();
  43. bool SelectionIsItalic();
  44. bool SelectionIsUnderlined();
  45. void SetSelectionBold();
  46. void SetSelectionItalic();
  47. void SetSelectionUnderlined();
  48. void SetRTF(CString sRTF);
  49. CString GetRTF();
  50. virtual ~CAutoRichEditCtrl();
  51. // Generated message map functions
  52. protected:
  53. //{{AFX_MSG(CAutoRichEditCtrl)
  54. // NOTE - the ClassWizard will add and remove member functions here.
  55. //}}AFX_MSG
  56. DECLARE_MESSAGE_MAP()
  57. private:
  58. void SetCharStyle(int MASK, int STYLE, int nStart, int nEnd);
  59. static DWORD CALLBACK CBStreamIn(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
  60. static DWORD CALLBACK CBStreamOut(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG* pcb);
  61. static BOOL CALLBACK CBEnumFonts(LPLOGFONT lplf, LPTEXTMETRIC lptm, DWORD dwType, LPARAM lpData);
  62. };
  63. /////////////////////////////////////////////////////////////////////////////
  64. //{{AFX_INSERT_LOCATION}}
  65. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  66. #endif // !defined(AFX_AUTORICHEDITCTRL_H__C26D1E0E_DD32_11D2_B39F_000092914562__INCLUDED_)