ResizableDialog.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #if !defined(AFX_RESIZABLEDIALOG_H__INCLUDED_)
  2. #define AFX_RESIZABLEDIALOG_H__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // ResizableDialog.h : header file
  7. //
  8. /////////////////////////////////////////////////////////////////////////////
  9. //
  10. // This file is part of ResizableLib
  11. // https://github.com/ppescher/resizablelib
  12. //
  13. // Copyright (C) 2000-2015 by Paolo Messina
  14. // mailto:ppescher@hotmail.com
  15. //
  16. // The contents of this file are subject to the Artistic License 2.0
  17. // http://opensource.org/licenses/Artistic-2.0
  18. //
  19. // If you find this code useful, credits would be nice!
  20. //
  21. /////////////////////////////////////////////////////////////////////////////
  22. #include "ResizableLayout.h"
  23. #include "ResizableGrip.h"
  24. #include "ResizableMinMax.h"
  25. #include "ResizableWndState.h"
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CResizableDialog window
  28. class CResizableDialog : public CDialog, public CResizableLayout,
  29. public CResizableGrip, public CResizableMinMax,
  30. public CResizableWndState
  31. {
  32. // Construction
  33. public:
  34. CResizableDialog();
  35. CResizableDialog(UINT nIDTemplate, CWnd* pParentWnd = NULL);
  36. CResizableDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL);
  37. // Attributes
  38. private:
  39. // support for temporarily hiding the grip
  40. DWORD m_dwGripTempState;
  41. // flags
  42. BOOL m_bEnableSaveRestore;
  43. BOOL m_bRectOnly;
  44. // internal status
  45. CString m_sSection; // section name (identifies a parent window)
  46. // Operations
  47. public:
  48. // Overrides
  49. // ClassWizard generated virtual function overrides
  50. //{{AFX_VIRTUAL(CResizableDialog)
  51. protected:
  52. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  53. //}}AFX_VIRTUAL
  54. // Implementation
  55. public:
  56. virtual ~CResizableDialog();
  57. // used internally
  58. private:
  59. void PrivateConstruct();
  60. // callable from derived classes
  61. protected:
  62. // section to use in app's profile
  63. void EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly = FALSE);
  64. virtual CWnd* GetResizableWnd() const
  65. {
  66. // make the layout know its parent window
  67. return CWnd::FromHandle(m_hWnd);
  68. };
  69. // Generated message map functions
  70. protected:
  71. //{{AFX_MSG(CResizableDialog)
  72. afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
  73. afx_msg void OnSize(UINT nType, int cx, int cy);
  74. afx_msg void OnDestroy();
  75. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  76. afx_msg BOOL OnNcCreate(LPCREATESTRUCT lpCreateStruct);
  77. //}}AFX_MSG
  78. DECLARE_MESSAGE_MAP()
  79. };
  80. /////////////////////////////////////////////////////////////////////////////
  81. //{{AFX_INSERT_LOCATION}}
  82. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  83. #endif // !defined(AFX_RESIZABLEDIALOG_H__INCLUDED_)