/***********************************************************************/ /* Copyright (C) 2002 Definitive Solutions, Inc. All Rights Reserved. */ /* THIS COMPUTER PROGRAM IS PROPRIETARY AND CONFIDENTIAL TO DEFINITIVE */ /* SOLUTIONS, INC. AND ITS LICENSORS AND CONTAINS TRADE SECRETS OF */ /* DEFINITIVE SOLUTIONS, INC. THAT ARE PROVIDED PURSUANT TO A WRITTEN */ /* AGREEMENT CONTAINING RESTRICTIONS ON USE AND DISCLOSURE. ANY USE, */ /* REPRODUCTION, OR TRANSFER EXCEPT AS PROVIDED IN SUCH AGREEMENT */ /* IS STRICTLY PROHIBITED. */ /***********************************************************************/ ///////////////////////////////////////////////////////////////////////////// // How to add this class to your application. // // Add MyPropertyPage.cpp and MyPropertyPage.h to your project in the usual // folders. ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX_MYPROPERTYPAGE_H__D067D84F_B85F_40E6_A10C_A7D63B668C51__INCLUDED_) #define AFX_MYPROPERTYPAGE_H__D067D84F_B85F_40E6_A10C_A7D63B668C51__INCLUDED_ #pragma once ///////////////////////////////////////////////////////////////////////////// // PrintPropPage() and PrintPageHeader() helper struct PRINTPROPPAGEARGS { CDC* pDC; CPrintInfo* pInfo; CFont* pfontNormal; CFont* pfontBold; UINT uiPage; bool bReallyPrint; int* pnX; int* pnY; int nPrintMargin; int nLeading; int nGap; int nPropPage; double dPrintScaleFactor; CRect* prcClip; bool* pbWorkAreaEmpty; }; ///////////////////////////////////////////////////////////////////////////// // ToolTipLParam - needed by non-member function EnumChildProc(). #include "MyToolTipCtrl.h" struct MyPPToolTipLParam { MyToolTipCtrl* m_pToolTip; // Points to the tooltip. CWnd* m_pControl; // Points to the control (button, etc.) // to be "tool-tipped", }; ///////////////////////////////////////////////////////////////////////////// // MyPPControlInfo structure - needed to do control size and position handling struct MyPPControlInfo { bool m_bSetExternally; // Did the client programmer set // this from their dialog's // OnInitDialog( )? UINT uiID; // The resource id of this control. UINT uiInfo; // The size and position constants. CRect rcClient; // The *old* rectangle where this // control was. CString sClassName; // Name of the window class. }; ///////////////////////////////////////////////////////////////////////////// // MyPropertyPage // Declare the class depending on this file is in an EXE project or a DLL one. class #ifdef _WINDLL AFX_EXT_CLASS #endif MyPropertyPage : public CPropertyPage { DECLARE_DYNCREATE(MyPropertyPage) // Construction. public: MyPropertyPage(UINT uiResourceID, int nDialogTemplateWidth = 0, int nDialogTemplateHeight = 0, UINT uiTitleId = 0U); MyPropertyPage(); virtual ~MyPropertyPage(); //{{AFX_VIRTUAL(MyPropertyPage) public: virtual BOOL PreTranslateMessage(MSG* pMsg); protected: virtual void DoDataExchange(CDataExchange* pDX); //}}AFX_VIRTUAL // Interface. public: // How is control to be sized and positioned when the dialog is stretched? #define ANCHOR_LEFT 0x0 // Maintain distance from left side. #define ANCHOR_TOP 0x0 // Maintain distance from top side. #define ANCHOR_RIGHT 0x1 // Maintain distance from right side. #define ANCHOR_BOTTOM 0x2 // Maintain distance from bottom side. #define RESIZE_HORZ 0x4 // Stretch/shrink along width. #define RESIZE_VERT 0x8 // Stretch/shrink along height. #define RESIZE_BOTH (RESIZE_HORZ | RESIZE_VERT) // Set size and position request for a control. void SetControlInfo(UINT uiCtrlID, UINT uiCtrlInfo); void SetPageTitle(const CString& sTitle) const; // Printing. virtual void HandleBeginPrinting(); virtual void HandleEndPrinting(CDC* pDC, CPrintInfo* pInfo); virtual bool PrintPropPage(PRINTPROPPAGEARGS& pppa); virtual void PrintPageHeader(PRINTPROPPAGEARGS& pppa); virtual CString GetDescriptiveText() const; // Implementation. private: void SetControlInfoInternal(UINT uiCtrlID, UINT uiCtrlInfo); void CommonConstruct(); bool AddTipToControl(CWnd* pControl); void SetDefaultControlInfos(); void DoControlsAffectedByHorzStretch(UINT uiIDHorz); void DoControlsAffectedByVertStretch(UINT uiIDHorz); MyPPControlInfo* GetControlInfo(UINT uiID) const; // Implementation. protected: //{{AFX_MSG(MyPropertyPage) //}}AFX_MSG DECLARE_MESSAGE_MAP() virtual BOOL OnSetActive(); // Data. private: MyToolTipCtrl m_ToolTip; // Tool tip for dialog box's controls. CPtrList m_plControlInfo; // Info structure for each control. bool m_bCalledAlready; // Controls one-time initialization. int m_nDialogTemplateWidth; // Used for sizing during printing. int m_nDialogTemplateHeight; // Used for sizing during printing. }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MYPROPERTYPAGE_H__D067D84F_B85F_40E6_A10C_A7D63B668C51__INCLUDED_)