- Main Page
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

# ResizableMinMax.cpp

    00001 // ResizableMinMax.cpp: implementation of the CResizableMinMax class.
    00002 //
    00004 //
    00005 // Copyright (C) 2000-2002 by Paolo Messina
    00006 // (http://www.geocities.com/ppescher - ppescher@yahoo.com)
    00007 //
    00008 // The contents of this file are subject to the Artistic License (the "License").
    00009 // You may not use this file except in compliance with the License.
    00010 // You may obtain a copy of the License at:
    00011 // http://www.opensource.org/licenses/artistic-license.html
    00012 //
    00013 // If you find this code useful, credits would be nice!
    00014 //
    00016
    00017 #include "stdafx.h"
    00018 #include "ResizableMinMax.h"
    00019
    00020 #ifdef _DEBUG
    00021 #undef THIS_FILE
    00022 static char THIS_FILE[]=__FILE__;
    00023 #define new DEBUG_NEW
    00024 #endif
    00025
    00027 // Construction/Destruction
    00029
    00030 CResizableMinMax::CResizableMinMax()
    00031 {
    00032         m_bUseMinTrack = FALSE;
    00033         m_bUseMaxTrack = FALSE;
    00034         m_bUseMaxRect = FALSE;
    00035 }
    00036
    00037 CResizableMinMax::~CResizableMinMax()
    00038 {
    00039
    00040 }
    00041
    00042 void CResizableMinMax::MinMaxInfo(LPMINMAXINFO lpMMI)
    00043 {
    00044         if (m_bUseMinTrack)
    00045                 lpMMI->ptMinTrackSize = m_ptMinTrackSize;
    00046
    00047         if (m_bUseMaxTrack)
    00048                 lpMMI->ptMaxTrackSize = m_ptMaxTrackSize;
    00049
    00050         if (m_bUseMaxRect)
    00051         {
    00052                 lpMMI->ptMaxPosition = m_ptMaxPos;
    00053                 lpMMI->ptMaxSize = m_ptMaxSize;
    00054         }
    00055 }
    00056
    00057 void CResizableMinMax::SetMaximizedRect(const CRect& rc)
    00058 {
    00059         m_bUseMaxRect = TRUE;
    00060
    00061         m_ptMaxPos = rc.TopLeft();
    00062         m_ptMaxSize.x = rc.Width();
    00063         m_ptMaxSize.y = rc.Height();
    00064 }
    00065
    00066 void CResizableMinMax::ResetMaximizedRect()
    00067 {
    00068         m_bUseMaxRect = FALSE;
    00069 }
    00070
    00071 void CResizableMinMax::SetMinTrackSize(const CSize& size)
    00072 {
    00073         m_bUseMinTrack = TRUE;
    00074
    00075         m_ptMinTrackSize.x = size.cx;
    00076         m_ptMinTrackSize.y = size.cy;
    00077 }
    00078
    00079 void CResizableMinMax::ResetMinTrackSize()
    00080 {
    00081         m_bUseMinTrack = FALSE;
    00082 }
    00083
    00084 void CResizableMinMax::SetMaxTrackSize(const CSize& size)
    00085 {
    00086         m_bUseMaxTrack = TRUE;
    00087
    00088         m_ptMaxTrackSize.x = size.cx;
    00089         m_ptMaxTrackSize.y = size.cy;
    00090 }
    00091
    00092 void CResizableMinMax::ResetMaxTrackSize()
    00093 {
    00094         m_bUseMaxTrack = FALSE;
    00095 }