00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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 CTreePropSheet : public CPropertySheet
00081 {
00082 DECLARE_DYNAMIC(CTreePropSheet)
00083
00084
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
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
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
00262 protected:
00276 virtual CString GenerateEmptyPageMessage(LPCTSTR lpszEmptyPageMessage, LPCTSTR lpszCaption);
00277
00287 virtual CTreeCtrl* CreatePageTreeObject();
00288
00299 virtual CPropPageFrame* CreatePageFrame();
00300
00301
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
00409 protected:
00410
00411 public:
00412 virtual BOOL OnInitDialog();
00413
00414
00415
00416 protected:
00417
00418 afx_msg void OnDestroy();
00419
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
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
00470 private:
00472 static const UINT s_unPageTreeId;
00473 };
00474
00475
00476 }
00477
00479
00480
00481
00482
00483 #endif // AFX_TREEPROPSHEET_H__50695CFB_FCE4_4188_ADB4_BF05A5488E41__INCLUDED_