ResizableDialog.h 799 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * ResizableDialog.h
  3. * -----------------
  4. * Purpose: A wrapper for resizable MFC dialogs that fixes the dialog's minimum size
  5. * (as MFC does not scale controls properly if the user makes the dialog smaller than it originally was)
  6. * Notes : (currently none)
  7. * Authors: OpenMPT Devs
  8. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  9. */
  10. #pragma once
  11. #include "openmpt/all/BuildSettings.hpp"
  12. OPENMPT_NAMESPACE_BEGIN
  13. class ResizableDialog : public CDialog
  14. {
  15. private:
  16. CPoint m_minSize;
  17. public:
  18. ResizableDialog() = default;
  19. explicit ResizableDialog(UINT nIDTemplate, CWnd *pParentWnd = nullptr);
  20. protected:
  21. BOOL OnInitDialog() override;
  22. afx_msg void OnGetMinMaxInfo(MINMAXINFO *mmi);
  23. DECLARE_MESSAGE_MAP()
  24. };
  25. OPENMPT_NAMESPACE_END