00001 
00002 
00004 
00005 #if !defined(AFX_GRIDURLCELL_H__9F4A50B4_D773_11D3_A439_F7E60631F563__INCLUDED_)
00006 #define AFX_GRIDURLCELL_H__9F4A50B4_D773_11D3_A439_F7E60631F563__INCLUDED_
00007 
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011 
00012 #include "../GridCtrl_src/GridCell.h"
00013 
00014 typedef struct {
00015     LPCTSTR szURLPrefix;
00016     int     nLength;
00017 } URLStruct;
00018 
00019 
00020 
00021 class CGridURLCell : public CGridCell  
00022 {
00023     DECLARE_DYNCREATE(CGridURLCell)
00024 
00025 public:
00026         CGridURLCell();
00027         virtual ~CGridURLCell();
00028 
00029     virtual BOOL     Draw(CDC* pDC, int nRow, int nCol, CRect rect, BOOL bEraseBkgnd = TRUE);
00030     virtual BOOL     Edit(int nRow, int nCol, CRect rect, CPoint point, UINT nID, UINT nChar);
00031     virtual LPCTSTR  GetTipText() { return NULL; }
00032         void SetAutoLaunchUrl(BOOL bLaunch = TRUE) { m_bLaunchUrl = bLaunch;    }
00033         BOOL GetAutoLaunchUrl() { return m_bLaunchUrl;  }
00034 
00035 protected:
00036     virtual BOOL OnSetCursor();
00037     virtual void OnClick(CPoint PointCellRelative);
00038 
00039         BOOL HasUrl(CString str);
00040     BOOL OverURL(CPoint& pt, CString& strURL);
00041 
00042 protected:
00043 #ifndef _WIN32_WCE
00044     static HCURSOR g_hLinkCursor;               
00045         HCURSOR GetHandCursor();
00046 #endif
00047     static URLStruct g_szURIprefixes[];
00048 
00049 protected:
00050         COLORREF m_clrUrl;
00051         BOOL     m_bLaunchUrl;
00052     CRect    m_Rect;
00053 };
00054 
00055 #endif // !defined(AFX_GRIDURLCELL_H__9F4A50B4_D773_11D3_A439_F7E60631F563__INCLUDED_)