⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 preferencesdlg.cpp

📁 c++系统开发实例精粹内附的80例源代码 环境:windows2000,c++6.0
💻 CPP
字号:
//////////////////////////////////////////////////////////////////////
// FileFury
// Copyright (c) 2000 Tenebril Incorporated
// All rights reserved.
//
// This source code is governed by the Tenebril open source
// license (http://www.tenebril.com/developers/opensource/license.html)
//
// For more information on this and other open source applications,
// visit the Tenebril OpenSource page:
//       http://www.tenebril.com/developers/opensource
//
//////////////////////////////////////////////////////////////////////

// PreferencesDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Oscar.h"
#include "PreferencesDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CPreferencesDlg

IMPLEMENT_DYNAMIC(CPreferencesDlg, CPropertySheet)

CPreferencesDlg::CPreferencesDlg(UINT nIDCaption, 
								 CSettingsArchive *pArchive,
								 CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
	SetupPanes(pArchive);
}

CPreferencesDlg::CPreferencesDlg(LPCTSTR pszCaption, CSettingsArchive *pArchive,
								 CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
	SetupPanes(pArchive);
}

CPreferencesDlg::~CPreferencesDlg()
{
}


BEGIN_MESSAGE_MAP(CPreferencesDlg, CPropertySheet)
	//{{AFX_MSG_MAP(CPreferencesDlg)
	ON_WM_CREATE()
	ON_COMMAND(IDOK, OnOK)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPreferencesDlg message handlers

int CPreferencesDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CPropertySheet::OnCreate(lpCreateStruct) == -1)
		return -1;

	return 0;
}

void CPreferencesDlg::SetupPanes(CSettingsArchive *pArchive)
{
	// Remove the Apply and Help buttons
	m_psh.dwFlags |= PSH_NOAPPLYNOW;
	m_psh.dwFlags &= ~PSH_HASHELP;

	// Turn off help for each page.
	m_cFolders.m_psp.dwFlags &= ~PSP_HASHELP;
	m_cGeneral.m_psp.dwFlags &= ~PSP_HASHELP;
	m_cIMessage.m_psp.dwFlags &= ~PSP_HASHELP;

	// Now add all the pages.
	AddPage(&m_cGeneral);
	AddPage(&m_cFolders);
	AddPage(&m_cIMessage);

	// Store the archive.
	ASSERT(pArchive);
	m_pArchive = pArchive;

	m_cFolders.SetArchive(m_pArchive);
	m_cGeneral.SetArchive(m_pArchive);
	m_cIMessage.SetArchive(m_pArchive);
}

void CPreferencesDlg::OnOK()
{
	// Save the settings.
	m_cFolders.SaveSettings();
	m_cGeneral.SaveSettings();
	m_cIMessage.SaveSettings();

	Default();
}

⌨️ 快捷键说明

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