00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_CTRLTEXT_H__ED51405E_BF72_48AF_9E0F_61E36C25FC12__INCLUDED_)
00023 #define AFX_CTRLTEXT_H__ED51405E_BF72_48AF_9E0F_61E36C25FC12__INCLUDED_
00024
00025 #pragma once
00026
00027
00028 class CTextCtrl : public CWnd
00029 {
00030
00031 public:
00032 CTextCtrl();
00033 virtual ~CTextCtrl();
00034
00035
00036 protected:
00037 CPtrArray m_pLines;
00038 int m_nPosition;
00039 int m_nTotal;
00040 CSize m_cCharacter;
00041 CFont m_pFont;
00042 COLORREF m_crBackground;
00043 COLORREF m_crText[5];
00044 BOOL m_bProcess;
00045 CCriticalSection m_pSection;
00046 UINT m_nScrollWheelLines;
00047
00048
00049 public:
00050 void Add(int nType, LPCTSTR pszText);
00051 void AddLine(int nType, LPCTSTR pszLine);
00052 void Clear(BOOL bInvalidate = TRUE);
00053 CFont* GetFont();
00054 protected:
00055 void UpdateScroll(BOOL bFull = FALSE);
00056
00057
00058 public:
00059
00060 public:
00061 virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
00062
00063
00064
00065 protected:
00066
00067 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00068 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00069 afx_msg void OnPaint();
00070 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00071 afx_msg void OnSize(UINT nType, int cx, int cy);
00072 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00073 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
00074
00075 DECLARE_MESSAGE_MAP()
00076 };
00077
00078 class CTextLine
00079 {
00080
00081 public:
00082 CTextLine(int nType, LPCTSTR pszLine);
00083 virtual ~CTextLine();
00084
00085
00086 public:
00087 CString m_sText;
00088 int* m_pLine;
00089 int m_nLine;
00090 int m_nType;
00091
00092
00093 public:
00094 int Process(int nWidth);
00095 void Paint(CDC* pDC, CRect* pRect);
00096 protected:
00097 void AddLine(int nLength);
00098
00099 };
00100
00101
00102
00103 #endif // !defined(AFX_CTRLTEXT_H__ED51405E_BF72_48AF_9E0F_61E36C25FC12__INCLUDED_)