URLLinkButton.cpp in URLLinkButtonEx.rar
Sponsored links
#include "stdafx.h"
#include "..\CallMe.h"
#include "URLLinkButton.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
HCURSOR url_control::CURLLinkButton::m_hCursorHand = NULL;
CFont* url_control::CURLLinkButton::m_pULFont = NULL;
HCURSOR url_control::CURLStatic::m_hCursorHand = NULL;
CFont* url_control::CURLStatic::m_pULFont = NULL;
namespace url_control {
////////////////////////////////////////////////////////////////////////////////////////
//CURLBase
CURLBase::CURLBase()
{
m_bHover = FALSE;
m_bTracking = FALSE;
m_bVisited = FALSE;
m_bErased = false;
m_nStyle = IS_CURSOR|IS_UNDERLINE|IS_CHANGETEXTCOLOR;
m_nDrawStyle = DT_SINGLELINE;
m_clrVisited = RGB( 0x80, 0x00, 0x80 );
m_clrRegular = ::GetSysColor(COLOR_HIGHLIGHT);
m_clrDisabled = ::GetSysColor(COLOR_GRAYTEXT);
#if(WINVER >= 0x0500)
m_clrHover = ::GetSysColor (COLOR_HOTLIGHT);
#else
m_clrHover = RGB (0x0, 0x0, 0xFF);
#endif
}
CURLBase::~CURLBase()
{
}
void CURLBase::SetStyle(int nStyle)
{
if( (nStyle & NO_CURSOR )!=0 && (nStyle & IS_CURSOR)!=0 ) {
nStyle&=~IS_CURSOR;
}
if( (nStyle & NO_UNDERLINE )!=0 && (nStyle & IS_UNDERLINE)!=0 ) {
nStyle&=~IS_UNDERLINE;
}
if( (nStyle & NO_CHANGETEXTCOLOR )!=0 && (nStyle & IS_CHANGETEXTCOLOR)!=0 ) {
nStyle&=~IS_CHANGETEXTCOLOR;
}
m_nStyle|=nStyle;
if( (m_nStyle & NO_CURSOR )!=0 && (m_nStyle & IS_CURSOR)!=0 ) {
m_nStyle&=~IS_CURSOR;
}
if( (m_nStyle & NO_UNDERLINE )!=0 && (m_nStyle & IS_UNDERLINE)!=0 ) {
m_nStyle&=~IS_UNDERLINE;
}
if( (m_nStyle & NO_CHANGETEXTCOLOR )!=0 && (m_nStyle & IS_CHANGETEXTCOLOR)!=0 ) {
m_nStyle&=~IS_CHANGETEXTCOLOR;
}
}
CString CURLBase::GetURLPrefix(void)
{
return m_sPrefix;
}
void CURLBase::SetURL (LPCTSTR lpszURL)
{
if (lpszURL == NULL)
{
m_sURL.Empty ();
}
else
{
m_sURL = lpszURL;
}
}
void CURLBase::SetURLPrefix (LPCTSTR lpsz
...
...
... to be continued.
This is a preview. To get the complete source file,
please click here to download the whole source code package.