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

CtrlTipList.cpp

Go to the documentation of this file.
00001 //
00002 // CtrlTipList.cpp
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 #include "StdAfx.h"
00023 #include "Shareaza.h"
00024 #include "CtrlTipList.h"
00025 
00026 #ifdef _DEBUG
00027 #define new DEBUG_NEW
00028 #undef THIS_FILE
00029 static char THIS_FILE[] = __FILE__;
00030 #endif
00031 
00032 IMPLEMENT_DYNAMIC(CTipListCtrl, CListCtrl)
00033 
00034 BEGIN_MESSAGE_MAP(CTipListCtrl, CListCtrl)
00035         //{{AFX_MSG_MAP(CTipListCtrl)
00036         ON_WM_MOUSEMOVE()
00037         ON_WM_LBUTTONDOWN()
00038         ON_WM_RBUTTONDOWN()
00039         ON_WM_KEYDOWN()
00040         //}}AFX_MSG_MAP
00041 END_MESSAGE_MAP()
00042 
00043 
00045 // CTipListCtrl construction
00046 
00047 CTipListCtrl::CTipListCtrl()
00048 {
00049         m_pTip = NULL;
00050 }
00051 
00052 CTipListCtrl::~CTipListCtrl()
00053 {
00054 }
00055 
00057 // CTipListCtrl operations
00058 
00059 void CTipListCtrl::SetTip(CCoolTipCtrl* pTip)
00060 {
00061         m_pTip = pTip;
00062 }
00063 
00065 // CTipListCtrl message handlers
00066 
00067 void CTipListCtrl::OnMouseMove(UINT nFlags, CPoint point)
00068 {
00069         CListCtrl::OnMouseMove( nFlags, point );
00070 
00071         if ( m_pTip )
00072         {
00073                 int nHit = HitTest( point );
00074 
00075                 if ( nHit >= 0 )
00076                 {
00077                         m_pTip->Show( (LPVOID)GetItemData( nHit ) );
00078                 }
00079                 else
00080                 {
00081                         m_pTip->Hide();
00082                 }
00083         }
00084 }
00085 
00086 void CTipListCtrl::OnLButtonDown(UINT nFlags, CPoint point)
00087 {
00088         if ( m_pTip ) m_pTip->Hide();
00089         CListCtrl::OnLButtonDown(nFlags, point);
00090 }
00091 
00092 void CTipListCtrl::OnRButtonDown(UINT nFlags, CPoint point)
00093 {
00094         if ( m_pTip ) m_pTip->Hide();
00095         CListCtrl::OnRButtonDown(nFlags, point);
00096 }
00097 
00098 void CTipListCtrl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
00099 {
00100         if ( m_pTip ) m_pTip->Hide();
00101         CListCtrl::OnKeyDown( nChar, nRepCnt, nFlags );
00102 }

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