About.cpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // About.cpp : implementation file
  2. //
  3. //Main branch test
  4. #include "stdafx.h"
  5. #include "cp_main.h"
  6. #include "About.h"
  7. #include "InternetUpdate.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. IMPLEMENT_DYNCREATE(CAbout, CPropertyPage)
  16. CAbout::CAbout() : CPropertyPage(CAbout::IDD)
  17. {
  18. m_csTitle = theApp.m_Language.GetString("AboutTitle", "About");
  19. m_psp.pszTitle = m_csTitle;
  20. m_psp.dwFlags |= PSP_USETITLE;
  21. //{{AFX_DATA_INIT(CAbout)
  22. // NOTE: the ClassWizard will add member initialization here
  23. //}}AFX_DATA_INIT
  24. }
  25. CAbout::~CAbout()
  26. {
  27. }
  28. void CAbout::DoDataExchange(CDataExchange* pDX)
  29. {
  30. CPropertyPage::DoDataExchange(pDX);
  31. //{{AFX_DATA_MAP(CAbout)
  32. DDX_Control(pDX, IDC_STATIC_LINK, m_Link);
  33. DDX_Control(pDX, IDC_HYPER_LINK, m_HyperLink);
  34. DDX_Control(pDX, IDC_LIST, m_List);
  35. //}}AFX_DATA_MAP
  36. }
  37. BEGIN_MESSAGE_MAP(CAbout, CPropertyPage)
  38. //{{AFX_MSG_MAP(CAbout)
  39. //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CAbout message handlers
  43. BOOL CAbout::OnInitDialog()
  44. {
  45. CPropertyPage::OnInitDialog();
  46. m_List.AddString(_T("Ditto"));
  47. CInternetUpdate update;
  48. auto runningVersion = update.GetRunningVersion();
  49. CString cs = update.GetVersionString(runningVersion);
  50. CString csText;
  51. csText = " Version " + cs;
  52. #if _WIN64
  53. csText += " 64bit";
  54. #else
  55. csText += " 32bit";
  56. #endif
  57. m_List.AddString(csText);
  58. const char *SqliteVersion = sqlite3_libversion();
  59. csText = " Sqlite Version ";
  60. csText += SqliteVersion;
  61. m_List.AddString(csText);
  62. cs = CGetSetOptions::GetExeFileName();;
  63. csText = " Exe Path " + cs;
  64. m_List.AddString(csText);
  65. cs = CGetSetOptions::GetDBPath();
  66. csText = " DB Path " + cs;
  67. m_List.AddString(csText);
  68. m_List.AddString(_T(""));
  69. m_List.AddString(_T("Credits"));
  70. cs = " Authors - Scott Brogden, [email protected]";
  71. m_List.AddString(cs);
  72. cs = " - Kevin Edwards, [email protected]";
  73. m_List.AddString(cs);
  74. m_List.AddString(_T(""));
  75. m_List.AddString(_T("Addins"));
  76. //Show what addins are loaded
  77. CStringArray arr;
  78. theApp.m_Addins.AboutScreenText(arr);
  79. INT_PTR count = arr.GetCount();
  80. for(int i = 0; i < count; i++)
  81. {
  82. m_List.AddString(_T(" ") + arr[i]);
  83. }
  84. CRect rect;
  85. GetClientRect(rect);
  86. rect.bottom -= 30;
  87. m_List.MoveWindow(rect);
  88. rect.top = rect.bottom + 10;
  89. rect.bottom = rect.top + 30;
  90. m_HyperLink.MoveWindow(rect);
  91. m_HyperLink.SetURL(_T("mailto:[email protected]"));
  92. rect.top = rect.bottom + 5;
  93. rect.bottom = rect.top + 5;
  94. m_Link.MoveWindow(rect);
  95. m_Link.SetURL(_T("http://ditto-cp.sourceforge.net"));
  96. return TRUE; // return TRUE unless you set the focus to a control
  97. // EXCEPTION: OCX Property Pages should return FALSE
  98. }