Click here to Skip to main content
15,893,266 members
Articles / Desktop Programming / MFC

CTreePropSheetEx – an extended version of CTreePropSheet

Rate me:
Please Sign up or sign in to vote.
4.98/5 (104 votes)
7 Apr 2005CPOL13 min read 425.7K   17.7K   288  
CTreePropSheetEx is an extension of CTreePropSheet offering new features such as resizing, skipping empty pages, and new property frames such as Office 2003 option sheet.
// TreePropSheetOffice2003.h: interface for the CTreePropSheetOffice2003 class.
//
//////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2004 by Yves Tkaczyk
// (http://www.tkaczyk.net - yves@tkaczyk.net)
//
// The contents of this file are subject to the Artistic License (the "License").
// You may not use this file except in compliance with the License. 
// You may obtain a copy of the License at:
// http://www.opensource.org/licenses/artistic-license.html
//
// Documentation: http://www.codeproject.com/property/treepropsheetex.asp
// CVS tree:      http://sourceforge.net/projects/treepropsheetex
//
/////////////////////////////////////////////////////////////////////////////

#ifndef _TREEPROPSHEETOFFICE2003_H__INCLUDED_
#define _TREEPROPSHEETOFFICE2003_H__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "TreePropSheetEx.h"

namespace TreePropSheet
{
/*! @brief TreePropSheetEx with Office 2003 option dialog look and feel.

  The version of CTreePropSheetEx has the following additions:
  - Use CPropPageFrameOffice2003 for page frame.
  - Tree style is modified to show for row selection. 
  The property pages should be modified in order to return a COLOR_WINDOW 
  background. This can be done as follows:
  <code>
  HBRUSH CAPage::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
  {
    pDC->SetBkMode(TRANSPARENT);
    return ::GetSysColorBrush( COLOR_WINDOW );
  }
  </code>

@version 0.1 Initial release
@author Yves Tkaczyk <yves@tkaczyk.net>
@date 09/2004 */
class CTreePropSheetOffice2003
 : public CTreePropSheetEx  
{
// Construction/Destruction
DECLARE_DYNAMIC(CTreePropSheetOffice2003)

public:
	CTreePropSheetOffice2003();
	CTreePropSheetOffice2003(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	CTreePropSheetOffice2003(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	virtual ~CTreePropSheetOffice2003();

// Overrided implementation helpers
protected:
	/**
	Will be called during creation process, to create the object, that
	is responsible for drawing the frame around the pages, drawing the
	empty page message and the caption.

	Allows you to inject your own CPropPageFrame-derived classes.

	This default implementation simply creates a CPropPageFrameTab with
	new and returns it.
	*/
	virtual CPropPageFrame* CreatePageFrame();

// Overridings
protected:
	//{{AFX_VIRTUAL(CTreePropSheetOffice2003)
	virtual BOOL OnInitDialog();
	//}}AFX_VIRTUAL

// Message handlers
protected:
	//{{AFX_MSG(CTreePropSheetOffice2003)
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

};

}; // namespace TreePropSheet

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}



#endif // _TREEPROPSHEETOFFICE2003_H__INCLUDED_

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 Code Project Open License (CPOL)


Written By
President ClearSquare Associates
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions