/** * @file XTPPropertyPage.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(__XTPPROPERTYPAGE_H__) # define __XTPPROPERTYPAGE_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * CXTPPropertyPage is a CPropertyPage derived class. Objects of class * CPropertyPage represent individual pages of a property sheet. * @see * CXTPPropertySheet, CXTPPropertySheet::DoModal, CXTPPropertyPageNavigator */ class _XTP_EXT_CLASS CXTPPropertyPage : public CPropertyPage , public CXTPResize { /** @cond */ DECLARE_DYNCREATE(CXTPPropertyPage) /** @endcond */ public: /** * @brief * Constructs a CXTPPropertyPage object. * @details * Use this member function to construct a CXTPPropertyPage object. * To display the property sheet, call DoModal or Create. * The string contained in the first parameter will be placed in the * caption bar for the property sheet. */ CXTPPropertyPage(); /** * @brief * Constructs a CXTPPropertyPage object. * @param nIDTemplate ID of the template used for this page. * @param nIDCaption ID of the name to be placed in the tab for this page. * If 0, then the name will be taken from the dialog * template for this page. * @details * Use this member function to construct a CXTPPropertyPage object. * To display the property sheet, call DoModal or Create. * The string contained in the first parameter will be placed in the * caption bar for the property sheet. */ CXTPPropertyPage(UINT nIDTemplate, UINT nIDCaption = 0); /** * @brief * Constructs a CXTPPropertyPage object. * @param lpszTemplateName Pointer to a string containing the name of the * template for this page. Cannot be NULL. * @param nIDCaption ID of the name to be placed in the tab for this page. * If 0, then the name will be taken from the dialog * template for this page. * @details * Use this member function to construct a CXTPPropertyPage object. * To display the property sheet, call DoModal or Create. * The string contained in the first parameter will be placed in the * caption bar for the property sheet. */ CXTPPropertyPage(LPCTSTR lpszTemplateName, UINT nIDCaption = 0); /** * @brief * Destroys a CXTPPropertyPage object, handles cleanup and deallocation. */ ~CXTPPropertyPage(); public: /** * @brief * Retrieves the caption text used for property sheet tabs. * @return * The caption text used for property sheet tabs. */ CString GetCaption() const; /** * @brief * Sets the caption text used to draw property sheet tabs. * @param lpszCaption New caption text to be set. */ void SetCaption(LPCTSTR lpszCaption); /** * @brief * Forces a page to update its internal data as this data is * supposed to be changed from outside the page. */ virtual void UpdatePage(void); /** @cond */ public: void EndDialog(int nID); /** * provided for new SDK in VS2012 that uses another implementation of SetModified, based on * http://msdn.microsoft.com/en-us/library/bb531344.aspx */ void SetModified(BOOL bChanged = TRUE); protected: virtual BOOL CreatePage(CWnd* pParentWnd); virtual BOOL LoadTemplate(); virtual BOOL LoadTemplate(HGLOBAL& hTemplate, HINSTANCE& hInst); BOOL MeasureTemplate(SIZE& szDlg); void CommonConstruct(); void UpdateBars(); BOOL GetTrueClientSize(CSize& size, CSize& sizeSb); void GetScrollBarSizes(CSize& sizeSb); void GetScrollBarState(CSize sizeClient, CSize& needSb, CSize& sizeRange, CPoint& ptMove, BOOL bInsideClient); CPoint GetDeviceScrollPosition() const; void ScrollToDevicePosition(POINT ptDev); BOOL OnScroll(UINT nScrollCode, UINT nPos, BOOL bDoScroll = TRUE); BOOL DoMouseWheel(UINT fFlags, short zDelta, CPoint point); BOOL OnScrollBy(CSize sizeScroll, BOOL bDoScroll); virtual void AdjustResizeRect(CSize& rcWindow); void ScrollPage(int xAmount, int yAmount); void OnChildSetFocus(HWND hWndFocus); /** @endcond */ protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPPropertyPage) protected: virtual void DoDataExchange(CDataExchange* pDX); /**< DDX/DDV support */ virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); virtual BOOL OnInitDialog(); //}}AFX_VIRTUAL //{{AFX_MSG(CXTPPropertyPage) afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); afx_msg BOOL OnMouseWheel(UINT fFlags, short zDelta, CPoint point); afx_msg void OnNcPaint(); afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp); //}}AFX_MSG /** @endcond */ friend class CXTPPropertySheet; public: DWORD_PTR m_dwData; /**< Page specific 32-bit value. */ protected: CXTPPropertySheet* m_pSheet; /**< Parent CXTPPropertySheet object. */ BOOL m_bModified; /**< TRUE to indicate that the property page settings have been modified. */ BOOL m_bInsideUpdate; CSize m_totalDev; CSize m_lineDev; BOOL m_bCreated; }; /** @cond */ class _XTP_EXT_CLASS CXTPPropertyPageStaticCaption : public CWnd { public: CXTPPropertyPageStaticCaption(); public: DECLARE_MESSAGE_MAP() afx_msg void OnPaint(); afx_msg BOOL OnEraseBkgnd(CDC* pDC); }; /** @endcond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPPROPERTYPAGE_H__) /** @endcond */