ResizableMinMax.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // This file is part of ResizableLib
  4. // https://github.com/ppescher/resizablelib
  5. //
  6. // Copyright (C) 2000-2015 by Paolo Messina
  7. // mailto:ppescher@hotmail.com
  8. //
  9. // The contents of this file are subject to the Artistic License 2.0
  10. // http://opensource.org/licenses/Artistic-2.0
  11. //
  12. // If you find this code useful, credits would be nice!
  13. //
  14. /////////////////////////////////////////////////////////////////////////////
  15. /*!
  16. * @file
  17. * @brief Interface for the CResizableMinMax class.
  18. */
  19. #if !defined(AFX_RESIZABLEMINMAX_H__INCLUDED_)
  20. #define AFX_RESIZABLEMINMAX_H__INCLUDED_
  21. #if _MSC_VER > 1000
  22. #pragma once
  23. #endif // _MSC_VER > 1000
  24. /*! @addtogroup CoreComponents
  25. * @{
  26. */
  27. //! @brief brief_description
  28. /*!
  29. * long_description
  30. */
  31. class CResizableMinMax
  32. {
  33. // Attributes
  34. private:
  35. // flags
  36. BOOL m_bUseMaxTrack;
  37. BOOL m_bUseMinTrack;
  38. BOOL m_bUseMaxRect;
  39. POINT m_ptMinTrackSize; // min tracking size
  40. POINT m_ptMaxTrackSize; // max tracking size
  41. POINT m_ptMaxPos; // maximized position
  42. POINT m_ptMaxSize; // maximized size
  43. public:
  44. CResizableMinMax();
  45. virtual ~CResizableMinMax();
  46. protected:
  47. void MinMaxInfo(LPMINMAXINFO lpMMI);
  48. void ChainMinMaxInfo(LPMINMAXINFO lpMMI, CWnd* pParentFrame, CWnd* pWnd);
  49. void ChainMinMaxInfo(LPMINMAXINFO lpMMI, HWND hWndChild, CSize sizeExtra);
  50. void ChainMinMaxInfo(LPMINMAXINFO lpMMI, CWnd* pParentWnd, UINT nID, CSize sizeExtra)
  51. {
  52. ChainMinMaxInfo(lpMMI,
  53. ::GetDlgItem(pParentWnd->GetSafeHwnd(), nID), sizeExtra);
  54. }
  55. void ChainMinMaxInfoCB(LPMINMAXINFO lpMMI, HWND hWndChild);
  56. virtual BOOL CalcSizeExtra(HWND hWndChild, CSize sizeChild, CSize& sizeExtra);
  57. void ResetAllRects();
  58. void SetMaximizedRect(const CRect& rc); // set window rect when maximized
  59. void ResetMaximizedRect(); // reset to default maximized rect
  60. void SetMinTrackSize(const CSize& size); // set minimum tracking size
  61. void ResetMinTrackSize(); // reset to default minimum tracking size
  62. void SetMaxTrackSize(const CSize& size); // set maximum tracking size
  63. void ResetMaxTrackSize(); // reset to default maximum tracking size
  64. };
  65. // @}
  66. #endif // !defined(AFX_RESIZABLEMINMAX_H__INCLUDED_)