00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "StdAfx.h"
00023 #include "Shareaza.h"
00024 #include "DlgPromote.h"
00025 #include "CoolInterface.h"
00026
00027 #ifdef _DEBUG
00028 #define new DEBUG_NEW
00029 #undef THIS_FILE
00030 static char THIS_FILE[] = __FILE__;
00031 #endif
00032
00033 BEGIN_MESSAGE_MAP(CPromoteDlg, CSkinDialog)
00034
00035 ON_WM_CTLCOLOR()
00036 ON_WM_SETCURSOR()
00037 ON_WM_LBUTTONUP()
00038 ON_WM_PAINT()
00039
00040 END_MESSAGE_MAP()
00041
00042
00044
00045
00046 CPromoteDlg::CPromoteDlg(CWnd* pParent) : CSkinDialog(CPromoteDlg::IDD, pParent)
00047 {
00048
00049
00050 }
00051
00052 void CPromoteDlg::DoDataExchange(CDataExchange* pDX)
00053 {
00054 CSkinDialog::DoDataExchange( pDX );
00055
00056 DDX_Control(pDX, IDC_WEB, m_wndWeb);
00057 DDX_Control(pDX, IDC_TITLE, m_wndTitle);
00058
00059 }
00060
00062
00063
00064 BOOL CPromoteDlg::OnInitDialog()
00065 {
00066 CSkinDialog::OnInitDialog();
00067
00068 SkinMe( _T("CPromoteDlg"), IDR_MAINFRAME );
00069
00070 m_crWhite = CCoolInterface::GetDialogBkColor();
00071 m_brWhite.CreateSolidBrush( m_crWhite );
00072
00073 return TRUE;
00074 }
00075
00076 void CPromoteDlg::OnPaint()
00077 {
00078 CPaintDC dc( this );
00079 CRect rc;
00080
00081 GetClientRect( &rc );
00082 rc.top += 51;
00083
00084 dc.Draw3dRect( 0, 50, rc.right + 1, 0,
00085 RGB( 128, 128, 128 ), RGB( 128, 128, 128 ) );
00086 dc.FillSolidRect( &rc, m_crWhite );
00087 }
00088
00089 HBRUSH CPromoteDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
00090 {
00091 HBRUSH hbr = (HBRUSH)CSkinDialog::OnCtlColor( pDC, pWnd, nCtlColor );
00092
00093 pDC->SetBkColor( m_crWhite );
00094
00095 if ( pWnd == &m_wndTitle )
00096 {
00097 pDC->SelectObject( &theApp.m_gdiFontBold );
00098 }
00099 else if ( pWnd == &m_wndWeb )
00100 {
00101 pDC->SetTextColor( RGB( 0, 0, 255 ) );
00102 pDC->SelectObject( &theApp.m_gdiFontLine );
00103 }
00104
00105 return m_brWhite;
00106 }
00107
00108 BOOL CPromoteDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
00109 {
00110 CPoint point;
00111 CRect rc;
00112
00113 GetCursorPos( &point );
00114 m_wndWeb.GetWindowRect( &rc );
00115
00116 if ( rc.PtInRect( point ) )
00117 {
00118 SetCursor( theApp.LoadCursor( IDC_HAND ) );
00119 return TRUE;
00120 }
00121
00122 return CSkinDialog::OnSetCursor(pWnd, nHitTest, message);
00123 }
00124
00125 void CPromoteDlg::OnLButtonUp(UINT nFlags, CPoint point)
00126 {
00127 CSkinDialog::OnLButtonUp( nFlags, point );
00128
00129 CRect rc;
00130 m_wndWeb.GetWindowRect( &rc );
00131 ScreenToClient( &rc );
00132
00133 if ( rc.PtInRect( point ) )
00134 {
00135 ShellExecute( GetSafeHwnd(), _T("open"),
00136 _T("http://www.shareaza.com/?Version=") + theApp.m_sVersion,
00137 NULL, NULL, SW_SHOWNORMAL );
00138 }
00139 }
00140