00001 // This code is a part of the NanoSoft NSViews C++ Library. 00002 // Copyright (C) 1996 NanoSoft Corporation. All rights reserved. 00003 00004 #ifndef __NSFlexFormView_h__ 00005 #define __NSFlexFormView_h__ 00006 00007 #include "NSViewsAfxExt.h" 00008 #include "NSFlexConstraints.h" 00009 00010 class CNSFlexConstraintList; 00011 00012 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00013 00014 // CNSFlexFormView turns a normal CFormView into a "flexible" form view that 00015 // automatically repositions its controls when the form view window is resized. 00016 00017 // Make sure to use a CNSFlexMDIChildWnd as the frame window for a 00018 // CNSFlexFormView! See MFC CFormView documentation for additional information. 00019 00020 class AFX_EXT_NSVIEWS CNSFlexFormView : public CFormView 00021 { 00022 00023 DECLARE_DYNAMIC(CNSFlexFormView) 00024 00025 // -------------------------------------------------------------------------- 00026 00027 public: 00028 00029 // Constructors. 00030 CNSFlexFormView(UINT nIDTemplate); 00031 CNSFlexFormView(LPCTSTR lpszTemplateName); 00032 // nIDTemplate - Contains the ID number of a dialog-box template resource. 00033 // lpszTemplateName - Contains a null-terminated string that is the name 00034 // of a dialog-box template resource. 00035 00036 // Destructor. 00037 virtual ~CNSFlexFormView(); 00038 00039 // Add horizontal and vertical positioning constraints to a specified 00040 // control that will be applied when the window is resized. 00041 void AddFlexConstraint(UINT nControlID, 00042 const CNSFlexHorizontalConstraint& HorizontalConstraint, 00043 const CNSFlexVerticalConstraint& VerticalConstraint); 00044 // nControlID - ID of specified dialog control. 00045 // HorizontalConstraint - Horizontal positioning constraint. 00046 // Vertical Constraint - Vertical positioning constraint. 00047 00048 // -------------------------------------------------------------------------- 00049 00050 public: 00051 00052 // ClassWizard 00053 //{{AFX_VIRTUAL(CNSFlexFormView) 00054 public: 00055 virtual void OnInitialUpdate(); 00056 //}}AFX_VIRTUAL 00057 00058 protected: 00059 00060 // ClassWizard 00061 //{{AFX_MSG(CNSFlexFormView) 00062 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 00063 afx_msg void OnSize(UINT nType, int cx, int cy); 00064 //}}AFX_MSG 00065 DECLARE_MESSAGE_MAP() 00066 00067 private: 00068 00069 CNSFlexConstraintList* m_pFlexConstraintList; 00070 00071 // REVISION 4/10/97 TO WORK WITH SDI APPLICATIONS (Ed Smetak) 00072 BOOL m_bNeedInitialUpdate; 00073 // END REVISION (Ver 1.04) 00074 00075 }; 00076 00077 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00078 00079 #endif
1.5.1