NSFlexPropertyPage.h

Go to the documentation of this file.
00001 // This code is a part of the NanoSoft NSViews C++ Library.
00002 // Copyright (C) 1996 NanoSoft Corporation. All rights reserved.
00003 
00004 #ifndef __NSFlexPropertyPage_h__
00005 #define __NSFlexPropertyPage_h__
00006 
00007 #include "NSViewsAfxExt.h"
00008 #include "NSFlexConstraints.h"
00009 
00010 class CNSFlexConstraintList;
00011 
00012 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00013 
00014 // CNSFlexPropertyPage turns a normal CPropertyPage into a "flexible" property
00015 // page that automatically repositions its controls when the property page
00016 // window is resized.
00017 
00018 // Make sure to use a CNSFlexPropertySheet with a CNSFlexPropertyPage! See the
00019 // MFC CPropertyPage documentation for additional information.
00020 
00021 class AFX_EXT_NSVIEWS CNSFlexPropertyPage : public CPropertyPage
00022 {
00023 
00024   DECLARE_DYNAMIC(CNSFlexPropertyPage)
00025 
00026   // --------------------------------------------------------------------------
00027 
00028   public:
00029 
00030     // Constructors.
00031     CNSFlexPropertyPage();
00032     CNSFlexPropertyPage(UINT nIDTemplate, UINT nIDCaption = 0);
00033     CNSFlexPropertyPage(LPCTSTR lpszTemplateName, UINT nIDCaption = 0);
00034     // nIDTemplate - Contains the ID number of a dialog-box template resource.
00035     // lpszTemplateName - Contains a null-terminated string that is the name
00036     //   of a dialog-box template resource.
00037     // nIDCaption - ID of the name to be placed in the tab for this page. If 0, 
00038     //  the name will be taken from the dialog template for this page.
00039 
00040     // Destructor.
00041     virtual ~CNSFlexPropertyPage();
00042 
00043     // Add horizontal and vertical positioning constraints to a specified  
00044     // control that will be applied when the window is resized.
00045     void AddFlexConstraint(UINT nControlID,
00046         const CNSFlexHorizontalConstraint& HorizontalConstraint,
00047         const CNSFlexVerticalConstraint& VerticalConstraint);
00048     //  nControlID - ID of specified dialog control.
00049     //  HorizontalConstraint - Horizontal positioning constraint.
00050     //  Vertical Constraint - Vertical positioning constraint.
00051       
00052     // Get document object for any CNSFlexPropertyPage that is contained in a
00053     // CNSFlexPropertySheetView. This function makes a CNSFlexPropertyPage look
00054     // and feel a lot like a CView. Returns NULL if the CNSFlexPropertyPage is
00055     // not contained in a CNSFlexPropertySheetView.
00056     CDocument* GetDocument() const;
00057 
00058     // Get view object for any CNSFlexPropertyPage that is contained in a
00059     // CNSFlexPropertySheetView. Returns NULL if the CNSFlexPropertyPage is not
00060     // contained in a CNSFlexPropertySheetView.
00061     CView* GetView() const;
00062 
00063     // Called after the CNSFlexPropertySheetView’s document has been modified. 
00064     // This function makes a CNSFlexPropertyPage look and feel a lot like a 
00065     // CView. This function is only applicable for a CNSFlexPropertyPage that 
00066     // is contained in a CNSFlexPropertySheetView.
00067     virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);    
00068 
00069   // --------------------------------------------------------------------------
00070 
00071   public:
00072 
00073     // ClassWizard
00074     //{{AFX_VIRTUAL(CNSFlexPropertyPage)
00075     public:
00076     virtual BOOL OnSetActive();
00077     //}}AFX_VIRTUAL
00078     
00079   protected:
00080 
00081     // ClassWizard
00082     //{{AFX_MSG(CNSFlexPropertyPage)
00083     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00084     afx_msg void OnSize(UINT nType, int cx, int cy);
00085     virtual BOOL OnInitDialog();
00086     //}}AFX_MSG
00087     DECLARE_MESSAGE_MAP()
00088 
00089   private:
00090 
00091     CNSFlexConstraintList* m_pFlexConstraintList;
00092 
00093 };
00094 
00095 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00096 
00097 #endif

Generated on Thu Nov 20 04:28:49 2008 for HOOPLE Libraries by  doxygen 1.5.1