Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CtrlText.h

Go to the documentation of this file.
00001 //
00002 // CtrlText.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 // Construction
00031 public:
00032         CTextCtrl();
00033         virtual ~CTextCtrl();
00034 
00035 // Attributes
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; // number of lines to scroll when the mouse wheel is rotated
00047 
00048 // Operations
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 // Overrides
00058 public:
00059         //{{AFX_VIRTUAL(CTextCtrl)
00060         public:
00061         virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
00062         //}}AFX_VIRTUAL
00063 
00064 // Implementation
00065 protected:
00066         //{{AFX_MSG(CTextCtrl)
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         //}}AFX_MSG
00075         DECLARE_MESSAGE_MAP()
00076 };
00077 
00078 class CTextLine
00079 {
00080 // Construction
00081 public:
00082         CTextLine(int nType, LPCTSTR pszLine);
00083         virtual ~CTextLine();
00084 
00085 // Attributes
00086 public:
00087         CString m_sText;
00088         int*    m_pLine;
00089         int             m_nLine;
00090         int             m_nType;
00091 
00092 // Operations
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 //{{AFX_INSERT_LOCATION}}
00102 
00103 #endif // !defined(AFX_CTRLTEXT_H__ED51405E_BF72_48AF_9E0F_61E36C25FC12__INCLUDED_)

Generated on Thu Dec 15 10:39:38 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2