Update UNRAR.H
[xy_vsfilter.git] / src / ui / ResizableLib / ResizableMinMax.cpp
blob74e576d99fb07f9858974e4454fdb0f4fcfc306e
1 // ResizableMinMax.cpp: implementation of the CResizableMinMax class.
2 //
3 /////////////////////////////////////////////////////////////////////////////
4 //
5 // Copyright (C) 2000-2002 by Paolo Messina
6 // (http://www.geocities.com/ppescher - ppescher@yahoo.com)
7 //
8 // The contents of this file are subject to the Artistic License (the "License").
9 // You may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at:
11 // http://www.opensource.org/licenses/artistic-license.html
13 // If you find this code useful, credits would be nice!
15 /////////////////////////////////////////////////////////////////////////////
17 #include "stdafx.h"
18 #include "ResizableMinMax.h"
20 #ifdef _DEBUG
21 #undef THIS_FILE
22 static char THIS_FILE[]=__FILE__;
23 #define new DEBUG_NEW
24 #endif
26 //////////////////////////////////////////////////////////////////////
27 // Construction/Destruction
28 //////////////////////////////////////////////////////////////////////
30 CResizableMinMax::CResizableMinMax()
32 m_bUseMinTrack = FALSE;
33 m_bUseMaxTrack = FALSE;
34 m_bUseMaxRect = FALSE;
37 CResizableMinMax::~CResizableMinMax()
42 void CResizableMinMax::MinMaxInfo(LPMINMAXINFO lpMMI)
44 if (m_bUseMinTrack)
45 lpMMI->ptMinTrackSize = m_ptMinTrackSize;
47 if (m_bUseMaxTrack)
48 lpMMI->ptMaxTrackSize = m_ptMaxTrackSize;
50 if (m_bUseMaxRect)
52 lpMMI->ptMaxPosition = m_ptMaxPos;
53 lpMMI->ptMaxSize = m_ptMaxSize;
57 void CResizableMinMax::SetMaximizedRect(const CRect& rc)
59 m_bUseMaxRect = TRUE;
61 m_ptMaxPos = rc.TopLeft();
62 m_ptMaxSize.x = rc.Width();
63 m_ptMaxSize.y = rc.Height();
66 void CResizableMinMax::ResetMaximizedRect()
68 m_bUseMaxRect = FALSE;
71 void CResizableMinMax::SetMinTrackSize(const CSize& size)
73 m_bUseMinTrack = TRUE;
75 m_ptMinTrackSize.x = size.cx;
76 m_ptMinTrackSize.y = size.cy;
79 void CResizableMinMax::ResetMinTrackSize()
81 m_bUseMinTrack = FALSE;
84 void CResizableMinMax::SetMaxTrackSize(const CSize& size)
86 m_bUseMaxTrack = TRUE;
88 m_ptMaxTrackSize.x = size.cx;
89 m_ptMaxTrackSize.y = size.cy;
92 void CResizableMinMax::ResetMaxTrackSize()
94 m_bUseMaxTrack = FALSE;