-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAboutDlg.cpp
executable file
·126 lines (103 loc) · 3.45 KB
/
AboutDlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
///////////////////////////////////////////////////////////////////////
// XBeamRate - Cross Beam Load Rating
// Copyright © 1999-2025 Washington State Department of Transportation
// Bridge and Structures Office
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the Alternate Route Open Source License as
// published by the Washington State Department of Transportation,
// Bridge and Structures Office.
//
// This program is distributed in the hope that it will be useful, but
// distribution is AS IS, WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
// the Alternate Route Open Source License for more details.
//
// You should have received a copy of the Alternate Route Open Source
// License along with this program; if not, write to the Washington
// State Department of Transportation, Bridge and Structures Office,
// P.O. Box 47340, Olympia, WA 98503, USA or e-mail
///////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resource.h"
#include "AboutDlg.h"
#include <EAF\EAFUtilities.h>
#include <MFCTools\VersionInfo.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNAMIC(CAboutDlg, CDialog)
CAboutDlg::CAboutDlg(UINT nResourceID,UINT nIDTemplate,CWnd* pParent /*=nullptr*/)
: CDialog(nIDTemplate == 0 ? IDD_ABOUTBOX : nIDTemplate, pParent)
{
m_ResourceID = nResourceID;
}
CAboutDlg::~CAboutDlg()
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX,IDC_WSDOT,m_WSDOT);
DDX_Control(pDX, IDC_TXDOT, m_TxDOT);
DDX_Control(pDX, IDC_BRIDGESIGHT, m_BridgeSight);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()
// CAboutDlg message handlers
BOOL CAboutDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// put the icon in the dialog
CStatic* pIcon = (CStatic*)GetDlgItem(IDC_APPICON);
CWinApp* pApp = AfxGetApp();
HICON hIcon = pApp->LoadIcon(m_ResourceID);
if ( hIcon )
{
pIcon->SetIcon( hIcon );
}
else
{
CWnd* pWnd = EAFGetMainFrame();
hIcon = pWnd->GetIcon(TRUE);
if ( hIcon )
{
pIcon->SetIcon( hIcon );
}
else
{
pIcon->ShowWindow(SW_HIDE);
}
}
// Get the version information and update the version # and copyright
CString docString;
docString.LoadString(m_ResourceID);
CString strAppName;
AfxExtractSubString(strAppName, docString, 1);
CString strTitle;
strTitle.Format(_T("About %s"),strAppName);
SetWindowText( strTitle );
CString strExe = AfxGetApp()->m_pszExeName;
strExe += _T(".dll");
CVersionInfo verInfo;
verInfo.Load(strExe);
CString strVersion = verInfo.GetFileVersionAsString();
CString strCopyright = verInfo.GetLegalCopyright();
#if defined _WIN64
CString strPlatform(_T("x64"));
#else
CString strPlatform(_T("x86"));
#endif
CString str;
str.Format(_T("Version %s (%s)"),strVersion,strPlatform);
GetDlgItem(IDC_VERSION)->SetWindowText(str);
GetDlgItem(IDC_COPYRIGHT)->SetWindowText(strCopyright);
m_WSDOT.SetURL(_T("http://www.wsdot.wa.gov"));
m_WSDOT.SetTooltip(_T("http://www.wsdot.wa.gov"));
m_WSDOT.SizeToContent();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}