versionpage.cpp

来自「一个邮件客户端源代码,包括收发邮件,安排日程等很多内容」· C++ 代码 · 共 107 行

CPP
107
字号
// Copyright (C) 1997-2002 Valeriy Ovechkin
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//

#include "stdafx.h"
#include "about.h"
#include "VersionPage.h"
#include "..\resource.h"

/////////////////////////////////////////////////////////////////////////////
// CVersionPage dialog used for App About


CVersionPage::CVersionPage() : CPropertyPage(CVersionPage::IDD)
{
	//{{AFX_DATA_INIT(CVersionPage)
	m_strFileVerInfo = _T("");
	//}}AFX_DATA_INIT
}

void CVersionPage::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CVersionPage)
	DDX_Control(pDX, IDC_MAGIC_ICON, m_iconMagic);
	DDX_Text(pDX, IDC_FILE_VER_INFO, m_strFileVerInfo);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CVersionPage, CPropertyPage)
	//{{AFX_MSG_MAP(CVersionPage)
	ON_BN_CLICKED(ID_MAGIC_FAQ, OnMagicFaq)
	ON_BN_CLICKED(ID_MAGIC_HOMEPAGE, OnMagicHomepage)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()



BOOL CVersionPage::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();

	HMODULE hMagicExe = GetModuleHandle( NULL );
	if( hMagicExe )
	{
		HICON hMagicIcon = ::LoadIcon( hMagicExe, MAKEINTRESOURCE( IDR_MAINFRAME ) );
		if( !hMagicIcon ) hMagicIcon = ::LoadIcon( NULL, IDI_WINLOGO );
		m_iconMagic.SetIcon( hMagicIcon );
	}

	CString strTmp1, strTmp2;
	strTmp1 = theApp.m_strProductName;
	strTmp1 += _T(' ');
	strTmp1 += theApp.m_strShortVersion;

	if( theApp.m_strSpecialBuild.GetLength() )
	{
		strTmp1 += _T(" (");
		strTmp1 += theApp.m_strSpecialBuild;
		strTmp1 += _T(')');
	}

	strTmp1 += _T("\n\n");
	strTmp1 += theApp.m_strFileDescription;
	strTmp1 += _T("\n\n");
	strTmp1 += theApp.m_strLegalCopyright;
	strTmp1 += _T("\n\n");
	strTmp1 += theApp.m_strComments;
	SetDlgItemText( IDC_FILE_VER_INFO, strTmp1 );

	GetDlgItemText( IDC_TEXT_MAGIC_HOMEPAGE, strTmp1 );
	strTmp2.LoadString( IDS_URL_MAGIC_HOMEPAGE );
	strTmp1 += strTmp2;
	SetDlgItemText( IDC_TEXT_MAGIC_HOMEPAGE, strTmp1 );
	
	GetDlgItemText( IDC_TEXT_MAGIC_FAQ, strTmp1 );
	strTmp2.LoadString( IDS_URL_MAGIC_FAQ );
	strTmp1 += strTmp2;
	SetDlgItemText( IDC_TEXT_MAGIC_FAQ, strTmp1 );
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CVersionPage::OnMagicFaq() 
{
	theApp.FollowLink( IDS_URL_MAGIC_FAQ );
}

void CVersionPage::OnMagicHomepage() 
{
	theApp.FollowLink( IDS_URL_MAGIC_HOMEPAGE );
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?