Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Internet Explorer AdBlock

, 17 Jan 2008
Internet Explorer AdBlock Add-on
ieadblock_src.zip
IE AdBlockPS
IE AdBlockps.def
IE AdBlock
AdBlockBand.rgs
AdBlockBHO.rgs
bin
XListCtrlSSDU.lib
XListCtrlSSRU.lib
IE AdBlock.def
IE AdBlock.rgs
res
bmpToolbar.bmp
checkboxes.bmp
icoSettings.ico
XListCtrl
checkboxes.bmp
//*********************************************************************
// INCLUDES
//*********************************************************************

#include "stdafx.h"
#include "SettingsPage.h"

//*********************************************************************
// MESSAGE MAP
//*********************************************************************

BEGIN_MESSAGE_MAP(CSettingsPage, CPropertyPage)
END_MESSAGE_MAP()

//*********************************************************************
// CONSTRUCTOR & DESTRUCTOR
//*********************************************************************

IMPLEMENT_DYNAMIC(CSettingsPage, CPropertyPage)

//=====================================================================

CSettingsPage::CSettingsPage(UINT nIDTemplate)
	: CPropertyPage(nIDTemplate)
{
	// Init singleton classes
	m_pLanguage = CLanguage::Instance();

	// Init variables
	m_bDirty = false;
}

//=====================================================================

CSettingsPage::~CSettingsPage()
{
}

//*********************************************************************
// PUBLIC FUNCTIONS
//*********************************************************************

BOOL CSettingsPage::OnInitDialog()
{
	// Call original function
	CPropertyPage::OnInitDialog();

	// Set dirty to false
	m_bDirty = false;

	// Return TRUE unless you want to set focus to a control
	return TRUE;
}

//=====================================================================

void CSettingsPage::SetTitle(CString sTitle)
{
	// Declare variables
	TC_ITEM tcItem;
	int iIndex = 0;
	CPropertySheet * pParent;

	// Get parent
	pParent = ((CPropertySheet *)GetParent());

	// Check if parent is not NULL
	if (pParent == NULL)
	{
		// Exit function
		return;
	}

	// Set item properties
	tcItem.mask = TCIF_TEXT;
	tcItem.pszText = (LPWSTR)((LPCTSTR)sTitle);

	// Get index of current tab in the parent
	iIndex = pParent->GetPageIndex(this);

	// Change correct item
	pParent->GetTabControl()->SetItem(iIndex, &tcItem);
}

//=====================================================================

bool CSettingsPage::IsDirty()
{
	return m_bDirty;
}

//*********************************************************************
// PRIVATE FUNCTIONS
//*********************************************************************

void CSettingsPage::OnDataChange()
{
	// Options are modified
	SetModified();
	m_bDirty = true;
}

//=====================================================================

void CSettingsPage::OnOK()
{
	m_bDirty = false;
	CPropertyPage::OnOK();
}

//=====================================================================

BOOL CSettingsPage::OnApply()
{
	m_bDirty = false;
	return CPropertyPage::OnApply();
}

//=====================================================================

void CSettingsPage::OnCancel()
{
	m_bDirty = false;
	CPropertyPage::OnCancel();
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

About the Author

Geert van Horrik
Software Developer CatenaLogic
Netherlands Netherlands
I am Geert van Horrik, and I have studied Computer Science in the Netherlands.
 
I love to write software using .NET (especially the combination of WPF and C#). I am also the lead developer of Catel, an open-source application development framework for WPF, Silverlight, WP7 and WinRT with the focus on MVVM.
 
I have my own company since January 1st 2007, called CatenaLogic. This company develops commercial and non-commercial software.
 
To download (or buy) applications I have written, visit my website: http://www.catenalogic.com
Follow on   Twitter

| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 17 Jan 2008
Article Copyright 2008 by Geert van Horrik
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid