/** * @file XTPPropertyPageNavigator.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPPROPERTYPAGENAVIGATOR_H__) # define __XTPPROPERTYPAGENAVIGATOR_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPPropertySheet; class CXTPPropertyPage; /** * @brief * CXTPPropertyPageNavigator is a standalone class. CXTPPropertyPageNavigator * represents a base navigator object for CXTPPropertySheet. * @see * CXTPPropertySheet, CXTPPropertySheet::DoModal, CXTPPropertySheet::SetNavigator */ class _XTP_EXT_CLASS CXTPPropertyPageNavigator { public: /** * @brief * Constructs a CXTPPropertyPageNavigator object. */ CXTPPropertyPageNavigator(); /** * @brief * Destroys a CXTPPropertyPageNavigator object, handles cleanup and deallocation. */ virtual ~CXTPPropertyPageNavigator(); public: /** * @brief * This method is called to create a page navigator. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL Create() = 0; virtual void OnPageChanged(); /** * @brief * This method is called to reposition a property sheet using the size * of a property page. * @param pLayout Address of an AFX_SIZEPARENTPARAMS structure. * @param szPage Page size to calculate from. * @param rcPage Result bounding rectangle of property pages. * @param szClient Result size of property sheet. */ virtual void PageToSize(AFX_SIZEPARENTPARAMS* pLayout, CSize szPage, CRect& rcPage, CSize& szClient) = 0; /** * @brief * This method is called to reposition a property page using the size * of a property sheet. * @param pLayout Address of an AFX_SIZEPARENTPARAMS structure. * @param szClient Size of property sheet. * @param rcPage Result bounding rectangle of property pages. */ virtual void SizeToPage(AFX_SIZEPARENTPARAMS* pLayout, CSize szClient, CRect& rcPage) = 0; /** * @brief * This method is called when a property page becomes selected. * @param pPage The property page that became selected. */ virtual void OnPageSelected(CXTPPropertyPage* pPage) = 0; /** * @brief * This method is called to get the window handler of a navigator window. * @return * The window handler of a navigator window. */ virtual HWND GetSafeHwnd() const = 0; /** * @brief * Retrieves page brush. * @param pDC Pointer to a valid device context. * @param pPage Property page to draw. * @return * The page brush. */ virtual HBRUSH GetPageBrush(CDC* pDC, CXTPPropertyPage* pPage) = 0; /** * @brief * Retrieves page color. * @return * The page color. */ virtual COLORREF GetPageColor() = 0; /** * @brief * Call this member to switch the visual theme of the control. * @param theme New visual theme. Can be any of the values listed * in the Remarks section. * @details * nTheme can be one of the theme IDs specified by XTPControlTheme. * @see * XTPControlTheme */ virtual void SetTheme(XTPControlTheme theme); XTPControlTheme GetTheme(); protected: virtual void SetPropertySheet(CXTPPropertySheet* pSheet); public: CRect m_rcNavigatorMargin; /**< Total navigator margin. */ CRect m_rcButtonMargin; /**< Total buttons margin. */ CRect m_rcPageMargin; /**< Total page margin. */ protected: CXTPPropertySheet* m_pSheet; /**< Parent property sheet object. */ XTPControlTheme m_themeCurrent; friend class CXTPPropertySheet; }; # if defined(_XTP_INCLUDE_TABMANAGER) /** * @brief * CXTPPropertyPageTabNavigator is a CXTPTabControl and CXTPPropertyPageNavigator * derived class. It represents a tabbed property page navigator. * @see * CXTPPropertySheet, CXTPPropertySheet::DoModal, CXTPPropertySheet::SetNavigator */ class _XTP_EXT_CLASS CXTPPropertyPageTabNavigator : public CXTPTabControl , public CXTPPropertyPageNavigator { public: /** * @brief * Constructs a CXTPPropertyPageTabNavigator object. */ CXTPPropertyPageTabNavigator(); /** @cond */ public: virtual BOOL Create(); virtual void OnPageChanged(); using CXTPTabControl::Create; void PageToSize(AFX_SIZEPARENTPARAMS* pLayout, CSize szPage, CRect& rcPage, CSize& szClient); void SizeToPage(AFX_SIZEPARENTPARAMS* pLayout, CSize szClient, CRect& rcPage); virtual void OnPageSelected(CXTPPropertyPage* pPage); virtual HWND GetSafeHwnd() const { return m_hWnd; } virtual HBRUSH GetPageBrush(CDC* pDC, CXTPPropertyPage* pPage); virtual COLORREF GetPageColor() { return m_clrBrush; } virtual void SetTheme(XTPControlTheme theme); protected: void SetSelectedItem(CXTPTabManagerItem* pItem); protected: DECLARE_MESSAGE_MAP() afx_msg void OnSysColorChange(); private: CXTPBrush m_brushPage; COLORREF m_clrBrush; /** @endcond */ }; # endif // #if defined(_XTP_INCLUDE_TABMANAGER) /** * @brief * CXTPPropertyPageControlNavigator is a CXTPPropertyPageNavigator derived class. * It represents a base control property page navigator. * @see * CXTPPropertySheet, CXTPPropertySheet::DoModal, CXTPPropertySheet::SetNavigator */ class _XTP_EXT_CLASS CXTPPropertyPageControlNavigator : public CXTPPropertyPageNavigator { public: /** * @brief * Constructs a CXTPPropertyPageControlNavigator object. */ CXTPPropertyPageControlNavigator(); /** @cond */ public: void PageToSize(AFX_SIZEPARENTPARAMS* pLayout, CSize szPage, CRect& rcPage, CSize& szClient); void SizeToPage(AFX_SIZEPARENTPARAMS* pLayout, CSize szClient, CRect& rcPage); virtual HBRUSH GetPageBrush(CDC* pDC, CXTPPropertyPage* pPage); virtual COLORREF GetPageColor() { return m_clrBrush; } public: CSize m_szControl; private: CXTPBrush m_brushPage; COLORREF m_clrBrush; /** @endcond */ }; /** * @brief * CXTPPropertyPageListNavigator is a CXTPListBox and CXTPPropertyPageControlNavigator * derived class. It represents a list property page navigator. * @see * CXTPPropertySheet, CXTPPropertySheet::DoModal, CXTPPropertySheet::SetNavigator */ class _XTP_EXT_CLASS CXTPPropertyPageListNavigator : public CXTPListBox , public CXTPPropertyPageControlNavigator { public: /** * @brief * Constructs a CXTPPropertyPageListNavigator object. */ CXTPPropertyPageListNavigator(); /** @cond */ public: virtual BOOL Create(); virtual void OnPageChanged(); # if _MSC_VER > 1200 using CListBox::Create; using CWnd::Create; # endif virtual void OnPageSelected(CXTPPropertyPage* pPage); virtual HWND GetSafeHwnd() const { return m_hWnd; } virtual void SetPropertySheet(CXTPPropertySheet* pSheet); virtual void SetTheme(XTPControlTheme theme); HBRUSH GetPageBrush(CDC* /*pDC*/, CXTPPropertyPage* /*pPage*/); virtual COLORREF GetPageColor() { return m_clrBrush; } protected: DECLARE_MESSAGE_MAP() afx_msg void OnSelChanged(); public: int m_nItemMargin; private: CXTPBrush m_brushPage; COLORREF m_clrBrush; /** @endcond */ }; /** * @brief * CXTPPropertyPageTreeNavigator is a CTreeCtrl and CXTPPropertyPageControlNavigator * derived class. It represents a tree property page navigator. * @see * CXTPPropertySheet, CXTPPropertySheet::DoModal, CXTPPropertySheet::SetNavigator */ class _XTP_EXT_CLASS CXTPPropertyPageTreeNavigator : public CTreeCtrl , public CXTPPropertyPageControlNavigator { public: /** * @brief * Constructs a CXTPPropertyPageTreeNavigator object. * @param dwStyle Style of the tree control to be used. */ CXTPPropertyPageTreeNavigator(DWORD dwStyle = TVS_SHOWSELALWAYS); /** @cond */ public: virtual BOOL Create(); virtual void OnPageChanged(); # if _MSC_VER > 1200 using CWnd::Create; # endif virtual void OnPageSelected(CXTPPropertyPage* pPage); virtual HWND GetSafeHwnd() const { return m_hWnd; } virtual void SetPropertySheet(CXTPPropertySheet* pSheet); protected: virtual BOOL CreateTree(); protected: DECLARE_MESSAGE_MAP() afx_msg void OnSelChanging(NMHDR* pNMHeader, LRESULT* pResult); protected: DWORD m_dwStyle; /** @endcond */ }; /** @cond */ AFX_INLINE void CXTPPropertyPageNavigator::OnPageChanged() { _ASSERTE(FALSE); /**< Not implemented ? */ } /** @endcond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPPROPERTYPAGENAVIGATOR_H__) /** @endcond */