About.cpp
上传用户:kklily621
上传日期:2013-06-25
资源大小:252k
文件大小:3k
开发平台:

Visual C++

  1. // About.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "Property.h"
  5. #include "About.h"
  6. //owner add
  7. #include "GuiRes.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. //=============================================================================================
  14. // CAbout property page
  15. extern CAclFile m_AclFile;
  16. extern CPropertyApp theApp;
  17. IMPLEMENT_DYNCREATE(CAbout, CPropertyPage)
  18. CAbout::CAbout() : CPropertyPage(CAbout::IDD)
  19. {
  20. //{{AFX_DATA_INIT(CAbout)
  21. //}}AFX_DATA_INIT
  22. }
  23. CAbout::~CAbout()
  24. {
  25. }
  26. void CAbout::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CPropertyPage::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(CAbout)
  30. DDX_Control(pDX, IDC_ABOUT_LABLE_INFO, m_StaticInfo1);
  31. DDX_Control(pDX, IDC_ABOUT_LABLE_EMAIL, m_LinkEmail);
  32. DDX_Control(pDX, IDC_ABOUT_LABLE_WEB_ADDRESS, m_LinkUrl);
  33. //}}AFX_DATA_MAP
  34. }
  35. BEGIN_MESSAGE_MAP(CAbout, CPropertyPage)
  36. //{{AFX_MSG_MAP(CAbout)
  37. //}}AFX_MSG_MAP
  38. END_MESSAGE_MAP()
  39. //=============================================================================================
  40. // CAbout message handlers
  41. BOOL CAbout::OnInitDialog() 
  42. {
  43. CPropertyPage::OnInitDialog();
  44. InitDlgResource();
  45. return TRUE;  
  46. }
  47. //---------------------------------------------------------------------------------------------
  48. //initialize dialog's resource
  49. void CAbout::InitDlgResource()
  50. {
  51. CString s;
  52. s .Format(_T("mailto:%s"), m_AclFile.mAclHeader.sEmail);
  53. m_LinkEmail .SetURL(s);
  54. m_LinkUrl .SetURL(m_AclFile.mAclHeader.sWebURL);
  55. s.Format(GUI_ABOUT_LABLE_ACCREDIT_TO, 
  56. theApp.m_RegisterRequest.m_UserInfo.sName[0] == '' ?
  57. theApp.m_RegisterRequest.m_UserInfo.sEmail : theApp.m_RegisterRequest.m_UserInfo.sName
  58. );
  59. SetDlgItemText(IDC_ABOUT_LABLE_ACCREDIT_TO , s);
  60. SetDlgItemText(IDC_ABOUT_LABLE_TITLE , GUI_ABOUT_LABLE_TITLE);
  61. SetDlgItemText(IDC_ABOUT_LABLE_COPYRIGHT1 , GUI_ABOUT_LABLE_COPYRIGHT1);
  62. SetDlgItemText(IDC_ABOUT_LABLE_COPYRIGHT2 , GUI_ABOUT_LABLE_COPYRIGHT2);
  63. SetDlgItemText(IDC_ABOUT_LABLE_COPYRIGHT3 , GUI_ABOUT_LABLE_COPYRIGHT3);
  64. SetDlgItemText(IDC_ABOUT_LABLE_WEB_ADDRESS_LABLE, GUI_ABOUT_LABLE_WEB_ADDRESS_LABLE);
  65. SetDlgItemText(IDC_ABOUT_LABLE_EMAIL_LABLE , GUI_ABOUT_LABLE_EMAIL_LABLE);
  66. SetDlgItemText(IDC_ABOUT_LABLE_WEB_ADDRESS , m_AclFile.mAclHeader.sWebURL);
  67. SetDlgItemText(IDC_ABOUT_LABLE_EMAIL , m_AclFile.mAclHeader.sEmail);
  68. SetDlgItemText(IDC_ABOUT_LABLE_WARNING , GUI_ABOUT_LABLE_WARNING);
  69. SetDlgItemText(IDC_ABOUT_LABLE_INFO , GUI_ABOUT_LABLE_INFO);
  70. SetDlgItemText(IDC_ABOUT_LABLE_AUTHOR , GUI_ABOUT_LABLE_AUTHOR);
  71. SetDlgItemText(IDC_ABOUT_LABLE_COPYRIGHT , GUI_ABOUT_LABLE_COPYRIGHT);
  72. }
  73. BEGIN_MESSAGE_MAP(CColorStatic, CStatic)
  74.     //{{AFX_MSG_MAP(CHyperLink)
  75.     ON_WM_CTLCOLOR_REFLECT()
  76.     //}}AFX_MSG_MAP
  77. END_MESSAGE_MAP()
  78. CColorStatic::CColorStatic(COLORREF nColor)
  79. {
  80. m_nColor = nColor;
  81. }
  82. void CColorStatic::SetColor(COLORREF nColor)
  83. {
  84. m_nColor = nColor;
  85. }
  86. HBRUSH CColorStatic::CtlColor(CDC* pDC, UINT nCtlColor) 
  87. {
  88.     ASSERT(nCtlColor == CTLCOLOR_STATIC);
  89.     pDC->SetTextColor(m_nColor);
  90.     pDC->SetBkMode(TRANSPARENT);
  91.     return (HBRUSH)GetStockObject(NULL_BRUSH);
  92. }