1 // ResizableMinMax.cpp: implementation of the CResizableMinMax class.
3 /////////////////////////////////////////////////////////////////////////////
5 // Copyright (C) 2000-2002 by Paolo Messina
6 // (http://www.geocities.com/ppescher - ppescher@yahoo.com)
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 /////////////////////////////////////////////////////////////////////////////
18 #include "ResizableMinMax.h"
22 static char THIS_FILE
[]=__FILE__
;
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
)
45 lpMMI
->ptMinTrackSize
= m_ptMinTrackSize
;
48 lpMMI
->ptMaxTrackSize
= m_ptMaxTrackSize
;
52 lpMMI
->ptMaxPosition
= m_ptMaxPos
;
53 lpMMI
->ptMaxSize
= m_ptMaxSize
;
57 void CResizableMinMax::SetMaximizedRect(const CRect
& rc
)
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
;