ResizableDialog.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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-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. #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. // flags
  39. BOOL m_bEnableSaveRestore;
  40. BOOL m_bRectOnly;
  41. // internal status
  42. CString m_sSection; // section name (identifies a parent window)
  43. BOOL m_bInitDone; // if all internal vars initialized
  44. // Operations
  45. public:
  46. // Overrides
  47. // ClassWizard generated virtual function overrides
  48. //{{AFX_VIRTUAL(CResizableDialog)
  49. protected:
  50. //}}AFX_VIRTUAL
  51. // Implementation
  52. public:
  53. virtual ~CResizableDialog();
  54. // used internally
  55. private:
  56. void Construct();
  57. // callable from derived classes
  58. protected:
  59. // section to use in app's profile
  60. void EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly = FALSE);
  61. virtual CWnd* GetResizableWnd()
  62. {
  63. // make the layout know its parent window
  64. return this;
  65. };
  66. // Generated message map functions
  67. protected:
  68. //{{AFX_MSG(CResizableDialog)
  69. virtual BOOL OnInitDialog();
  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_)