ResizableFormView.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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-2002 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. #include "ResizableGrip.h"
  23. #include "ResizableMinMax.h"
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CResizableFormView form view
  26. #ifndef __AFXEXT_H__
  27. #include <afxext.h>
  28. #endif
  29. class CResizableFormView : public CFormView, public CResizableLayout,
  30. public CResizableGrip, public CResizableMinMax
  31. {
  32. DECLARE_DYNAMIC(CResizableFormView)
  33. // Construction
  34. protected: // must derive your own class
  35. CResizableFormView(UINT nIDTemplate);
  36. CResizableFormView(LPCTSTR lpszTemplateName);
  37. virtual ~CResizableFormView();
  38. private:
  39. void PrivateConstruct();
  40. BOOL m_bInitDone; // if all internal vars initialized
  41. // support for temporarily hiding the grip
  42. DWORD m_dwGripTempState;
  43. enum GripHideReason // bitmask
  44. {
  45. GHR_MAXIMIZED = 0x01,
  46. GHR_SCROLLBAR = 0x02,
  47. GHR_ALIGNMENT = 0x04,
  48. };
  49. // called from base class
  50. protected:
  51. virtual void GetTotalClientRect(LPRECT lpRect);
  52. virtual CWnd* GetResizableWnd()
  53. {
  54. // make the layout know its parent window
  55. return this;
  56. };
  57. // Attributes
  58. public:
  59. // Operations
  60. public:
  61. // Overrides
  62. public:
  63. // ClassWizard generated virtual function overrides
  64. //{{AFX_VIRTUAL(CResizableFormView)
  65. virtual void OnInitialUpdate();
  66. //}}AFX_VIRTUAL
  67. // Implementation
  68. protected:
  69. #ifdef _DEBUG
  70. virtual void AssertValid() const;
  71. virtual void Dump(CDumpContext& dc) const;
  72. #endif
  73. // Generated message map functions
  74. //{{AFX_MSG(CResizableFormView)
  75. afx_msg void OnSize(UINT nType, int cx, int cy);
  76. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  77. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  78. afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
  79. afx_msg void OnDestroy();
  80. //}}AFX_MSG
  81. DECLARE_MESSAGE_MAP()
  82. };
  83. /////////////////////////////////////////////////////////////////////////////
  84. //{{AFX_INSERT_LOCATION}}
  85. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  86. #endif // !defined(AFX_RESIZABLEFORMVIEW_H__INCLUDED_)