/** * @file XTPResizeFormView.cpp * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ #include "stdafx.h" #include "Controls/Resize/XTPResizeRect.h" #include "Controls/Resize/XTPResizePoint.h" #include "Controls/Resize/XTPResize.h" #include "Controls/Resize/XTPResizeFormView.h" #include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" #ifdef _DEBUG # undef THIS_FILE static char THIS_FILE[] = __FILE__; # define new DEBUG_NEW #endif #pragma warning(disable : 4355) // 'this' : used in base member initializer list ///////////////////////////////////////////////////////////////////////////// // CXTPResizeFormView IMPLEMENT_DYNCREATE(CXTPResizeFormView, CFormView) #include "Common/Base/Diagnostic/XTPBeginAfxMap.h" BEGIN_MESSAGE_MAP(CXTPResizeFormView, CFormView) //{{AFX_MSG_MAP(CXTPResizeFormView) ON_WM_SIZE() ON_WM_GETMINMAXINFO() ON_WM_DESTROY() //}}AFX_MSG_MAP END_MESSAGE_MAP() #include "Common/Base/Diagnostic/XTPEndAfxMap.h" ///////////////////////////////////////////////////////////////////////////// // CXTPResizeFormView construction/destruction CXTPResizeFormView::CXTPResizeFormView(const UINT nID, const UINT nFlags) : CFormView(nID) , CXTPResize(this, nFlags | xtpResizeNoSizeIcon) { } void CXTPResizeFormView::OnGetMinMaxInfo(MINMAXINFO* pMMI) { // Notice that WM_GETMINMAXINFO must be handled in the parent frame CXTPResize::GetMinMaxInfo(pMMI); } void CXTPResizeFormView::AdjustResizeRect(CSize& szWindow) { CSize szMin = m_totalLog; szWindow.cx = max(szWindow.cx, szMin.cx); szWindow.cy = max(szWindow.cy, szMin.cy); } void CXTPResizeFormView::OnSize(UINT nType, int cx, int cy) { CFormView::OnSize(nType, cx, cy); CXTPResize::Size(); } void CXTPResizeFormView::OnDestroy() { // Save window placement if AutoLoadPlacement was used. if (!m_strSection.IsEmpty()) { SavePlacement(m_strSection); } CFormView::OnDestroy(); } LRESULT CXTPResizeFormView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { LRESULT lRet = CFormView::WindowProc(message, wParam, lParam); if (message == WM_INITDIALOG) { OnInitDialog(); } return lRet; } BOOL CXTPResizeFormView::OnInitDialog() { CXTPResize::Init(); if (!UpdateData(FALSE)) { TRACE0("UpdateData failed during CXTPResizeFormView::OnInitDialog().\n"); } return TRUE; }