#include <TreePropSheet.h>
Inheritance diagram for TreePropSheet::CTreePropSheet:
Public Member Functions | |
CTreePropSheet () | |
CTreePropSheet (UINT nIDCaption, CWnd *pParentWnd=NULL, UINT iSelectPage=0) | |
CTreePropSheet (LPCTSTR pszCaption, CWnd *pParentWnd=NULL, UINT iSelectPage=0) | |
virtual | ~CTreePropSheet () |
BOOL | SetTreeViewMode (BOOL bTreeViewMode=TRUE, BOOL bPageCaption=FALSE, BOOL bTreeImages=FALSE) |
BOOL | SetTreeWidth (int nWidth) |
void | SetEmptyPageText (LPCTSTR lpszEmptyPageText) |
DWORD | SetEmptyPageTextFormat (DWORD dwFormat) |
CTreeCtrl * | GetPageTreeControl () |
virtual BOOL | OnInitDialog () |
BOOL | SetTreeDefaultImages (CImageList *pImages) |
BOOL | SetTreeDefaultImages (UINT unBitmapID, int cx, COLORREF crMask) |
Static Public Member Functions | |
static BOOL | DestroyPageIcon (CPropertyPage *pPage) |
static BOOL | SetPageIcon (CPropertyPage *pPage, HICON hIcon) |
static BOOL | SetPageIcon (CPropertyPage *pPage, UINT unIconId) |
static BOOL | SetPageIcon (CPropertyPage *pPage, CImageList &Images, int nImage) |
Protected Member Functions | |
virtual CString | GenerateEmptyPageMessage (LPCTSTR lpszEmptyPageMessage, LPCTSTR lpszCaption) |
virtual CTreeCtrl * | CreatePageTreeObject () |
virtual CPropPageFrame * | CreatePageFrame () |
void | MoveChildWindows (int nDx, int nDy) |
void | RefillPageTree () |
HTREEITEM | CreatePageTreeItem (LPCTSTR lpszPath, HTREEITEM hParent=TVI_ROOT) |
CString | SplitPageTreePath (CString &strRest) |
BOOL | KillActiveCurrentPage () |
HTREEITEM | GetPageTreeItem (int nPage, HTREEITEM hRoot=TVI_ROOT) |
BOOL | SelectPageTreeItem (int nPage) |
BOOL | SelectCurrentPageTreeItem () |
void | UpdateCaption () |
void | ActivatePreviousPage () |
void | ActivateNextPage () |
afx_msg void | OnDestroy () |
afx_msg LRESULT | OnAddPage (WPARAM wParam, LPARAM lParam) |
afx_msg LRESULT | OnRemovePage (WPARAM wParam, LPARAM lParam) |
afx_msg LRESULT | OnSetCurSel (WPARAM wParam, LPARAM lParam) |
afx_msg LRESULT | OnSetCurSelId (WPARAM wParam, LPARAM lParam) |
afx_msg LRESULT | OnIsDialogMessage (WPARAM wParam, LPARAM lParam) |
afx_msg void | OnPageTreeSelChanging (NMHDR *pNotifyStruct, LRESULT *plResult) |
afx_msg void | OnPageTreeSelChanged (NMHDR *pNotifyStruct, LRESULT *plResult) |
You can use it exactly the same way, as a CPropertySheet object. Simply create CPropertyPage objects and add them via AddPage() to the sheet. If you would like to use the tree view mode (default), you can specify the path of the pages in the tree, by their name: The names of the pages can contain double colons ("::"), which will specify the path of that page in the tree control. I.e. if you have three pages with the following names: 1. _T("Appearance::Toolbars") 2. _T("Appearance::Menus") 3. _T("Directories") the tree would look as follow:
Appearance | +-Toolbars | +-Menus Directories
To disable tree view mode and use the standard tabbed mode, call the SetTreeViewMode() method. This also allows you, to enable page captions and tree images for tree view mode. If you would like to have images in the tree, but not all of your pages specify images or there are tree view items, which are not attached to a page (only parent items for real page items), you have to set default images using the SetTreeDefaultImages() method -- otherwise their may appear display errors.
If the user selects a tree view item, which does not belong to a page, because it is just a parent item for real page items, no page will be displayed, instead a message will be displayed, that can be set via SetEmptyPageText().
Definition at line 80 of file TreePropSheet.h.
|
Activates the next page in the page order or the first one, if the current one is the last. This method does never fail. Definition at line 667 of file TreePropSheet.cpp. Referenced by OnIsDialogMessage(). |
|
Activates the previous page in the page order or the last one, if the current one is the first. This method does never fail. Definition at line 605 of file TreePropSheet.cpp. Referenced by OnIsDialogMessage(). |
|
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. Definition at line 260 of file TreePropSheet.cpp. |
|
Creates the specified path in the page tree and returns the handle of the most child item created.
Definition at line 378 of file TreePropSheet.cpp. References SplitPageTreePath(). |
|
Will be called during creation process, to create the CTreeCtrl object (the object, not the window!). Allows you to inject your own CTreeCtrl-derived classes. This default implementation simply creates a CTreeCtrl with new and returns it. Definition at line 254 of file TreePropSheet.cpp. |
|
Checks, if the PSP_USEHICON flag is set in the PROPSHEETPAGE struct; If this is the case, the flag will be removed and the icon specified by the hIcon attribute of the PROPSHEETPAGE struct will be destroyed using DestroyIcon().
Definition at line 230 of file TreePropSheet.cpp. |
|
Will be called to generate the message, that should be displayed on an empty page, when the sheet is in tree view mode This default implementation simply returns lpszEmptyPageMessage with the optional "%s" placeholder replaced by lpszCaption.
Definition at line 246 of file TreePropSheet.cpp. Referenced by UpdateCaption(). |
|
Returns a pointer to the tree control, when the sheet is in tree view mode, NULL otherwise. Definition at line 193 of file TreePropSheet.cpp. |
|
Returns the page tree item, that representates the specified page or NULL, if no such icon exists.
Definition at line 482 of file TreePropSheet.cpp. Referenced by SelectPageTreeItem(). |
|
Tries to deactivate the current page, and hides it if successfull, so that an empty page becomes visible.
Definition at line 451 of file TreePropSheet.cpp. Referenced by OnPageTreeSelChanging(). |
|
Moves all childs by the specified amount of pixels.
Definition at line 269 of file TreePropSheet.cpp. |
|
Refills the tree that contains the entries for the several pages. Definition at line 285 of file TreePropSheet.cpp. Referenced by OnAddPage(), and OnRemovePage(). |
|
Selects and shows the tree item for the currently active page.
Definition at line 533 of file TreePropSheet.cpp. References SelectPageTreeItem(). Referenced by OnAddPage(), OnRemovePage(), OnSetCurSel(), and OnSetCurSelId(). |
|
Selects and shows the item, representing the specified page.
Definition at line 523 of file TreePropSheet.cpp. References GetPageTreeItem(). Referenced by SelectCurrentPageTreeItem(). |
|
Specifies the text to be drawn on empty pages (pages for tree view items, that are not related to a page, because they are only parents for other items). This is only needed in tree view mode. The specified text can contains a single "%s" placeholder which will be replaced with the title of the empty page. Definition at line 142 of file TreePropSheet.cpp. |
|
Allows you to specify, how the empty page message (see SetEmptyPageText()) should be drawn.
Definition at line 148 of file TreePropSheet.cpp. References TreePropSheet::CPropPageFrame::GetMsgFormat(), and TreePropSheet::CPropPageFrame::SetMsgFormat(). |
|
This helper allows you to easily set the icon of a property page. This static method does nothing more, than extracting the specified image as an icon from the given image list and assign the icon-handle to the hIcon property of the pages PROPSHEETPAGE structure (m_psp) and modify the structures flags, so that the image will be recognized. You need to call this method for a page, before adding the page to a property sheet. If you are using the CImageList-version, you are responsible for destroying the extracted icon with DestroyIcon() or the static DestroyPageIcon() method.
Definition at line 202 of file TreePropSheet.cpp. Referenced by SetPageIcon(). |
|
Defines the images, that should be used for pages without icons and for empty parent nodes. The list contains exactly to images: 1. An image that should be used for parent tree nodes, without a page asignd. 2. An image that should be used for pages, which are not specifying any icons. Standard image size is 16x16 Pixels, but if you call this method before creating the sheet, the size of image 0 in this list will be assumed as your preferred image size and all other icons must have the same size.
Definition at line 156 of file TreePropSheet.cpp. |
|
Call this method, if you would like to use a tree control to browse the pages, instead of the tab control. This method needs to becalled, before DoModal() or Create(). If the window has already been created, the method will fail.
Definition at line 107 of file TreePropSheet.cpp. |
|
Specifies the width of the tree control, when the sheet is in tree view mode. The default value (if this method is not called) is 150 pixels. This method needs to be called, before DoModeal() or Create(). Otherwise it will fail.
Definition at line 127 of file TreePropSheet.cpp. |
|
Splits the given path into the topmost item and the rest. See description of this class for detailed path information. I.e. when given the string "Appearance::Toolbars::Customize", the method will return "Appearance" and after the call strRest will be "Toolbars::Customize". Definition at line 418 of file TreePropSheet.cpp. Referenced by CreatePageTreeItem(). |
|
Updates the caption for the currently selected page (if the caption is enabled). Definition at line 543 of file TreePropSheet.cpp. References GenerateEmptyPageMessage(), TreePropSheet::CPropPageFrame::GetShowCaption(), TreePropSheet::CPropPageFrame::SetCaption(), and TreePropSheet::CPropPageFrame::SetMsgText(). Referenced by OnPageTreeSelChanged(), OnSetCurSel(), and OnSetCurSelId(). |