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 "DlgWarnings.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(CWarningsDlg, 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 CWarningsDlg::CWarningsDlg(CWnd* pParent) : CSkinDialog(CWarningsDlg::IDD, pParent)
00047 {
00048
00049
00050 }
00051
00052 void CWarningsDlg::DoDataExchange(CDataExchange* pDX)
00053 {
00054 CSkinDialog::DoDataExchange(pDX);
00055
00056 DDX_Control(pDX, IDC_RESPECT, m_wndRespect);
00057 DDX_Control(pDX, IDC_WEB, m_wndWeb);
00058 DDX_Control(pDX, IDC_TITLE, m_wndTitle);
00059
00060 }
00061
00063
00064
00065 BOOL CWarningsDlg::OnInitDialog()
00066 {
00067 CSkinDialog::OnInitDialog();
00068
00069 SkinMe( _T("CWarningsDlg"), IDR_MAINFRAME );
00070
00071 m_crWhite = CCoolInterface::GetDialogBkColor();
00072 m_brWhite.CreateSolidBrush( m_crWhite );
00073
00074 return TRUE;
00075 }
00076
00077 void CWarningsDlg::OnPaint()
00078 {
00079 CPaintDC dc( this );
00080 CRect rc;
00081
00082 GetClientRect( &rc );
00083 rc.top += 51;
00084
00085 dc.Draw3dRect( 0, 50, rc.right + 1, 0,
00086 RGB( 128, 128, 128 ), RGB( 128, 128, 128 ) );
00087 dc.FillSolidRect( &rc, m_crWhite );
00088 }
00089
00090 HBRUSH CWarningsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
00091 {
00092 HBRUSH hbr = (HBRUSH)CSkinDialog::OnCtlColor( pDC, pWnd, nCtlColor );
00093
00094 pDC->SetBkColor( m_crWhite );
00095
00096 if ( pWnd == &m_wndTitle || pWnd == &m_wndRespect )
00097 {
00098 pDC->SelectObject( &theApp.m_gdiFontBold );
00099 }
00100 else if ( pWnd == &m_wndWeb )
00101 {
00102 pDC->SetTextColor( RGB( 0, 0, 255 ) );
00103 pDC->SelectObject( &theApp.m_gdiFontLine );
00104 }
00105
00106 return m_brWhite;
00107 }
00108
00109 BOOL CWarningsDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
00110 {
00111 CPoint point;
00112 CRect rc;
00113
00114 GetCursorPos( &point );
00115 m_wndWeb.GetWindowRect( &rc );
00116
00117 if ( rc.PtInRect( point ) )
00118 {
00119 SetCursor( theApp.LoadCursor( IDC_HAND ) );
00120 return TRUE;
00121 }
00122
00123 return CSkinDialog::OnSetCursor(pWnd, nHitTest, message);
00124 }
00125
00126 void CWarningsDlg::OnLButtonUp(UINT nFlags, CPoint point)
00127 {
00128 CSkinDialog::OnLButtonUp( nFlags, point );
00129
00130 CRect rc;
00131 m_wndWeb.GetWindowRect( &rc );
00132 ScreenToClient( &rc );
00133
00134 if ( rc.PtInRect( point ) )
00135 {
00136 ShellExecute( GetSafeHwnd(), _T("open"),
00137 _T("http://www.shareaza.com/?Version=") + theApp.m_sVersion,
00138 NULL, NULL, SW_SHOWNORMAL );
00139 }
00140 }
00141