ResizableFormView.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #if !defined(AFX_RESIZABLEFORMVIEW_H__INCLUDED_)
  2. #define AFX_RESIZABLEFORMVIEW_H__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // ResizableFormView.h : header file
  7. //
  8. /////////////////////////////////////////////////////////////////////////////
  9. //
  10. // Copyright (C) 2000-2001 by Paolo Messina
  11. // (http://www.geocities.com/ppescher - ppescher@yahoo.com)
  12. //
  13. // The contents of this file are subject to the Artistic License (the "License").
  14. // You may not use this file except in compliance with the License.
  15. // You may obtain a copy of the License at:
  16. // http://www.opensource.org/licenses/artistic-license.html
  17. //
  18. // If you find this code useful, credits would be nice!
  19. //
  20. /////////////////////////////////////////////////////////////////////////////
  21. #include "ResizableLayout.h"
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CResizableFormView form view
  24. #ifndef __AFXEXT_H__
  25. #include <afxext.h>
  26. #endif
  27. class CResizableFormView : public CFormView, public CResizableLayout
  28. {
  29. DECLARE_DYNAMIC(CResizableFormView)
  30. // Construction
  31. protected: // must derive your own class
  32. CResizableFormView(UINT nIDTemplate);
  33. CResizableFormView(LPCTSTR lpszTemplateName);
  34. virtual ~CResizableFormView();
  35. private:
  36. void Construct();
  37. // internal status
  38. BOOL m_bInitDone; // if all internal vars initialized
  39. // called from base class
  40. protected:
  41. virtual void GetTotalClientRect(LPRECT lpRect);
  42. virtual CWnd* GetResizableWnd()
  43. {
  44. // make the layout know its parent window
  45. return this;
  46. };
  47. // Attributes
  48. public:
  49. // Operations
  50. public:
  51. // Overrides
  52. public:
  53. // ClassWizard generated virtual function overrides
  54. //{{AFX_VIRTUAL(CResizableFormView)
  55. virtual void OnInitialUpdate();
  56. //}}AFX_VIRTUAL
  57. // Implementation
  58. protected:
  59. #ifdef _DEBUG
  60. virtual void AssertValid() const;
  61. virtual void Dump(CDumpContext& dc) const;
  62. #endif
  63. // Generated message map functions
  64. //{{AFX_MSG(CResizableFormView)
  65. afx_msg void OnSize(UINT nType, int cx, int cy);
  66. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  67. //}}AFX_MSG
  68. DECLARE_MESSAGE_MAP()
  69. };
  70. /////////////////////////////////////////////////////////////////////////////
  71. //{{AFX_INSERT_LOCATION}}
  72. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  73. #endif // !defined(AFX_RESIZABLEFORMVIEW_H__INCLUDED_)