ResizableDialog.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. // 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. #include "ResizableState.h"
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CResizableDialog window
  27. class CResizableDialog : public CDialog, public CResizableLayout,
  28. public CResizableGrip, public CResizableMinMax,
  29. public CResizableState
  30. {
  31. // Construction
  32. public:
  33. CResizableDialog();
  34. CResizableDialog(UINT nIDTemplate, CWnd* pParentWnd = NULL);
  35. CResizableDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL);
  36. // Attributes
  37. private:
  38. // support for temporarily hiding the grip
  39. DWORD m_dwGripTempState;
  40. // flags
  41. BOOL m_bEnableSaveRestore;
  42. BOOL m_bRectOnly;
  43. // internal status
  44. CString m_sSection; // section name (identifies a parent window)
  45. // Operations
  46. public:
  47. // Overrides
  48. // ClassWizard generated virtual function overrides
  49. //{{AFX_VIRTUAL(CResizableDialog)
  50. protected:
  51. //}}AFX_VIRTUAL
  52. // Implementation
  53. public:
  54. virtual ~CResizableDialog();
  55. // used internally
  56. private:
  57. void PrivateConstruct();
  58. // callable from derived classes
  59. protected:
  60. // section to use in app's profile
  61. void EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly = FALSE);
  62. virtual CWnd* GetResizableWnd()
  63. {
  64. // make the layout know its parent window
  65. return this;
  66. };
  67. // Generated message map functions
  68. protected:
  69. //{{AFX_MSG(CResizableDialog)
  70. afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
  71. afx_msg void OnSize(UINT nType, int cx, int cy);
  72. afx_msg void OnDestroy();
  73. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  74. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  75. //}}AFX_MSG
  76. DECLARE_MESSAGE_MAP()
  77. };
  78. /////////////////////////////////////////////////////////////////////////////
  79. //{{AFX_INSERT_LOCATION}}
  80. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  81. #endif // !defined(AFX_RESIZABLEDIALOG_H__INCLUDED_)