/** * @file XTPGridPageSetupDialog.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(__XTPGRIDPAGESETUPDIALOG_H__) # define __XTPGRIDPAGESETUPDIALOG_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * This class is used to store printing options. * @see * CXTPPrintOptions, CXTPPrintPageHeaderFooter */ class _XTP_EXT_CLASS CXTPGridViewPrintOptions : public CXTPPrintOptions { /** @cond */ DECLARE_DYNAMIC(CXTPGridViewPrintOptions) /** @endcond */ public: /** * @brief * Constructs a CXTPGridViewPrintOptions object. */ CXTPGridViewPrintOptions(); /** * @brief * Override this member function in a derived class to retrieve * the active locale ID. * @return * Locale ID. Base implementation returns LOCALE_USER_DEFAULT; */ virtual LCID GetActiveLCID(); /** * @brief * Copies members from a specified source object. * @param pSrc Pointer to a source object to copy data from. */ virtual void Set(const CXTPGridViewPrintOptions* pSrc); BOOL m_bRepeatHeaderRows; /**< If TRUE, then the header rows will be printed on every page. FALSE by default. */ BOOL m_bRepeatFooterRows; /**< If TRUE, then the footer rows will be printed on every page. FALSE by default. */ protected: /** @cond */ # ifdef _XTP_ACTIVEX DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridViewPrintOptions); # endif /** @endcond */ }; /** * @brief * Customized Grid control page setup dialog. * @details * Use this class when you want to allow users to customize printing * options for the Grid control. * * This class enhances the standard MFC page setup dialog, which encapsulates * the services provided by the Windows common OLE Page Setup dialog box * with additional support for setting and modifying print margins. * This class is designed to take the place of the Print Setup dialog box. * * @see * CXTPGridViewPrintOptions overview, * CPageSetupDialog overview */ class _XTP_EXT_CLASS CXTPGridPageSetupDialog : public CPageSetupDialog { public: /** @cond */ enum { IDD = XTP_IDD_GRID_PRINT_PAGE_SETUP }; /** @endcond */ /** * @brief * Class constructor. * @param pOptions Pointer to an associated CXTPGridViewPrintOptions * object for storing user's interaction results. * @param dwFlags One or more flags you can use to customize the settings of the * dialog box. The values can be combined using the bitwise-OR * operator. For more details, see CPageSetupDialog::CPageSetupDialog. * @param pParentWnd Pointer to the dialog box's parent or owner. * @details * Use the DoModal function to display the dialog box. * @see * CPageSetupDialog::CPageSetupDialog() */ CXTPGridPageSetupDialog(CXTPGridViewPrintOptions* pOptions, DWORD dwFlags = PSD_MARGINS | PSD_INWININIINTLMEASURE, CWnd* pParentWnd = NULL); /** * @brief * Destroys a CXTPGridPageSetupDialog object, handles cleanup and deallocation. */ virtual ~CXTPGridPageSetupDialog(); protected: CXTPGridViewPrintOptions* m_pOptions; /**< Pointer to associated print options object. */ /** * @brief * Dialog-box initialization. * @return * FALSE because it must explicitly set the input focus to one of the * controls in the dialog box. * @see * CPageSetupDialog::OnInitDialog(). */ virtual BOOL OnInitDialog(); /** * @brief * Called when the user clicks the OK button (i.e. the button with an ID of IDOK). * @details * Saves all values into the m_pOptions structure. * @see * CPageSetupDialog::OnOK(). */ virtual void OnOK(); /** @cond */ CEdit m_ctrlHeaderFormat; CEdit m_ctrlFooterFormat; CButton m_ctrlHeaderFormatBtn; CButton m_ctrlFooterFormatBtn; afx_msg void OnBnClickedHeaderFormat(); afx_msg void OnBnClickedFooterFormat(); DECLARE_MESSAGE_MAP() /** @endcond */ }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPGRIDPAGESETUPDIALOG_H__) /** @endcond */