TreePropSheet.h

00001 /********************************************************************
00002 *
00003 * Copyright (c) 2002 Sven Wiegand <[email protected]>
00004 *
00005 * You can use this and modify this in any way you want,
00006 * BUT LEAVE THIS HEADER INTACT.
00007 *
00008 * Redistribution is appreciated.
00009 *
00010 * $Workfile:$
00011 * $Revision: 1.2 $
00012 * $Modtime:$
00013 * $Author: gabest $
00014 *
00015 * Revision History:
00016 *       $History:$
00017 *
00018 *********************************************************************/
00019 
00020 
00021 #if !defined(AFX_TREEPROPSHEET_H__50695CFB_FCE4_4188_ADB4_BF05A5488E41__INCLUDED_)
00022 #define AFX_TREEPROPSHEET_H__50695CFB_FCE4_4188_ADB4_BF05A5488E41__INCLUDED_
00023 
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 
00028 #include "PropPageFrame.h"
00029 #include <afxtempl.h>
00030 #include <afxdlgs.h>
00031 #include <afxcmn.h>
00032 
00033 namespace TreePropSheet
00034 {
00035 
00080 class /*AFX_EXT_CLASS*/ CTreePropSheet : public CPropertySheet
00081 {
00082         DECLARE_DYNAMIC(CTreePropSheet)
00083 
00084 // Construction/Destruction
00085 public:
00086         CTreePropSheet();
00087         CTreePropSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
00088         CTreePropSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
00089         virtual ~CTreePropSheet();
00090 
00091 // Operations
00092 public:
00118         BOOL SetTreeViewMode(BOOL bTreeViewMode = TRUE, BOOL bPageCaption = FALSE, BOOL bTreeImages = FALSE);
00119 
00135         BOOL SetTreeWidth(int nWidth);
00136 
00145         void SetEmptyPageText(LPCTSTR lpszEmptyPageText);
00146 
00162         DWORD SetEmptyPageTextFormat(DWORD dwFormat);
00163 
00165 
00192         BOOL SetTreeDefaultImages(CImageList *pImages);
00193         BOOL SetTreeDefaultImages(UINT unBitmapID, int cx, COLORREF crMask);
00195 
00200         CTreeCtrl* GetPageTreeControl();
00201 
00202 // Public helpers
00203 public:
00205 
00239         static BOOL SetPageIcon(CPropertyPage *pPage, HICON hIcon);
00240         static BOOL SetPageIcon(CPropertyPage *pPage, UINT unIconId);
00241         static BOOL SetPageIcon(CPropertyPage *pPage, CImageList &Images, int nImage);
00243 
00259         static BOOL DestroyPageIcon(CPropertyPage *pPage);
00260 
00261 // Overridable implementation helpers
00262 protected:
00276         virtual CString GenerateEmptyPageMessage(LPCTSTR lpszEmptyPageMessage, LPCTSTR lpszCaption);
00277 
00287         virtual CTreeCtrl* CreatePageTreeObject();
00288 
00299         virtual CPropPageFrame* CreatePageFrame();
00300 
00301 // Implementation helpers
00302 protected:
00313         void MoveChildWindows(int nDx, int nDy);
00314 
00318         void RefillPageTree();
00319 
00330         HTREEITEM CreatePageTreeItem(LPCTSTR lpszPath, HTREEITEM hParent = TVI_ROOT);
00331 
00340         CString SplitPageTreePath(CString &strRest);
00341 
00350         BOOL KillActiveCurrentPage();
00351 
00362         HTREEITEM GetPageTreeItem(int nPage, HTREEITEM hRoot = TVI_ROOT);
00363 
00374         BOOL SelectPageTreeItem(int nPage);
00375 
00384         BOOL SelectCurrentPageTreeItem();
00385 
00390         void UpdateCaption();
00391 
00398         void ActivatePreviousPage();
00399 
00406         void ActivateNextPage();
00407 
00408 // Overridings
00409 protected:
00410         //{{AFX_VIRTUAL(CTreePropSheet)
00411         public:
00412         virtual BOOL OnInitDialog();
00413         //}}AFX_VIRTUAL
00414 
00415 // Message handlers
00416 protected:
00417         //{{AFX_MSG(CTreePropSheet)
00418         afx_msg void OnDestroy();
00419         //}}AFX_MSG
00420         afx_msg LRESULT OnAddPage(WPARAM wParam, LPARAM lParam);
00421         afx_msg LRESULT OnRemovePage(WPARAM wParam, LPARAM lParam);
00422         afx_msg LRESULT OnSetCurSel(WPARAM wParam, LPARAM lParam);
00423         afx_msg LRESULT OnSetCurSelId(WPARAM wParam, LPARAM lParam);
00424         afx_msg LRESULT OnIsDialogMessage(WPARAM wParam, LPARAM lParam);
00425 
00426         afx_msg void OnPageTreeSelChanging(NMHDR *pNotifyStruct, LRESULT *plResult);
00427         afx_msg void OnPageTreeSelChanged(NMHDR *pNotifyStruct, LRESULT *plResult);
00428         DECLARE_MESSAGE_MAP()
00429 
00430 // Properties
00431 private:
00433         BOOL m_bTreeViewMode;
00434 
00436         CTreeCtrl *m_pwndPageTree;
00437 
00439         CPropPageFrame *m_pFrame;
00440 
00445         BOOL m_bPageTreeSelChangedActive;
00446 
00448         BOOL m_bPageCaption;
00449 
00451         BOOL m_bTreeImages;
00452 
00454         CImageList m_Images;
00455 
00457         CImageList m_DefaultImages;
00458 
00464         CString m_strEmptyPageMessage;
00465 
00467         int m_nPageTreeWidth;
00468 
00469 // Static Properties
00470 private:
00472         static const UINT s_unPageTreeId;
00473 };
00474 
00475 
00476 } //namespace TreePropSheet
00477 
00479 
00480 //{{AFX_INSERT_LOCATION}}
00481 // Microsoft Visual C++ fügt unmittelbar vor der vorhergehenden Zeile zusätzliche Deklarationen ein.
00482 
00483 #endif // AFX_TREEPROPSHEET_H__50695CFB_FCE4_4188_ADB4_BF05A5488E41__INCLUDED_

Generated on Tue Dec 13 14:47:58 2005 for guliverkli by  doxygen 1.4.5