- Main Page
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

# ResizableSheet.h

    00001 #if !defined(AFX_RESIZABLESHEET_H__INCLUDED_)
    00002 #define AFX_RESIZABLESHEET_H__INCLUDED_
    00003
    00004 #if _MSC_VER > 1000
    00005 #pragma once
    00006 #endif // _MSC_VER > 1000
    00007
    00009 //
    00010 // Copyright (C) 2000-2002 by Paolo Messina
    00011 // (http://www.geocities.com/ppescher - ppescher@yahoo.com)
    00012 //
    00013 // The contents of this file are subject to the Artistic License (the "License").
    00014 // You may not use this file except in compliance with the License.
    00015 // You may obtain a copy of the License at:
    00016 // http://www.opensource.org/licenses/artistic-license.html
    00017 //
    00018 // If you find this code useful, credits would be nice!
    00019 //
    00021
    00022 #include "ResizableLayout.h"
    00023 #include "ResizableGrip.h"
    00024 #include "ResizableMinMax.h"
    00025 #include "ResizableState.h"
    00026
    00028 // ResizableSheet.h : header file
    00029 //
    00030
    00031 class CResizableSheet : public CPropertySheet, public CResizableLayout,
    00032                                                 public CResizableGrip, public CResizableMinMax,
    00033                                                 public CResizableState
    00034 {
    00035         DECLARE_DYNAMIC(CResizableSheet)
    00036
    00037 // Construction
    00038 public:
    00039         CResizableSheet();
    00040         CResizableSheet(UINT nIDCaption, CWnd *pParentWnd = NULL, UINT iSelectPage = 0);
    00041         CResizableSheet(LPCTSTR pszCaption, CWnd *pParentWnd = NULL, UINT iSelectPage = 0);
    00042
    00043 // Attributes
    00044 private:
    00045         // support for temporarily hiding the grip
    00046         DWORD m_dwGripTempState;
    00047
    00048         // flags
    00049         BOOL m_bEnableSaveRestore;
    00050         BOOL m_bRectOnly;
    00051         BOOL m_bSavePage;
    00052
    00053         // layout vars
    00054         CSize m_sizePageTL, m_sizePageBR;
    00055
    00056         // internal status
    00057         CString m_sSection;                     // section name (identifies a parent window)
    00058
    00059 // Operations
    00060 public:
    00061
    00062 // Overrides
    00063         // ClassWizard generated virtual function overrides
    00064         //{{AFX_VIRTUAL(CResizableSheet)
    00065         public:
    00066         virtual BOOL OnInitDialog();
    00067         //}}AFX_VIRTUAL
    00068         protected:
    00069
    00070 // Implementation
    00071 public:
    00072         void RefreshLayout();
    00073         virtual ~CResizableSheet();
    00074
    00075 // used internally
    00076 private:
    00077         void PresetLayout();
    00078         void PrivateConstruct();
    00079         void SavePage();
    00080         void LoadPage();
    00081
    00082         BOOL IsWizard() { return (m_psh.dwFlags & PSH_WIZARD); }
    00083
    00084 // callable from derived classes
    00085 protected:
    00086         // section to use in app's profile
    00087         void EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly = FALSE,
    00088                 BOOL bWithPage = FALSE);
    00089         int GetMinWidth();      // minimum width to display all buttons
    00090
    00091
    00092         virtual CWnd* GetResizableWnd()
    00093         {
    00094                 // make the layout know its parent window
    00095                 return this;
    00096         };
    00097
    00098 // Generated message map functions
    00099 protected:
    00100         virtual BOOL ArrangeLayoutCallback(LayoutInfo& layout);
    00101         //{{AFX_MSG(CResizableSheet)
    00102         afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
    00103         afx_msg void OnSize(UINT nType, int cx, int cy);
    00104         afx_msg void OnDestroy();
    00105         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
    00106         afx_msg BOOL OnEraseBkgnd(CDC* pDC);
    00107         //}}AFX_MSG
    00108         afx_msg BOOL OnPageChanging(NMHDR* pNotifyStruct, LRESULT* pResult);
    00109         DECLARE_MESSAGE_MAP()
    00110 };
    00111
    00113
    00114 #endif  // AFX_RESIZABLESHEET_H__INCLUDED_