Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2012-07-05 01:49:25 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2012-07-05 01:49:25 +0400
commit7ac6c5e686548c8dcaf4abe438c542ed108c15c8 (patch)
tree242acbb466c153a60a9b7d44e5cd74c5158220df /src/thirdparty/ResizableLib
parentb08b3d4ac330971921d3ba3a41949a63b2d38add (diff)
move thirdparty/ui one dir up
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@5361 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/thirdparty/ResizableLib')
-rw-r--r--src/thirdparty/ResizableLib/Artistic-License.txt99
-rw-r--r--src/thirdparty/ResizableLib/ResizableDialog.cpp155
-rw-r--r--src/thirdparty/ResizableLib/ResizableDialog.h101
-rw-r--r--src/thirdparty/ResizableLib/ResizableGrip.cpp304
-rw-r--r--src/thirdparty/ResizableLib/ResizableGrip.h81
-rw-r--r--src/thirdparty/ResizableLib/ResizableLayout.cpp520
-rw-r--r--src/thirdparty/ResizableLib/ResizableLayout.h196
-rw-r--r--src/thirdparty/ResizableLib/ResizableLib.vcxproj122
-rw-r--r--src/thirdparty/ResizableLib/ResizableLib.vcxproj.filters73
-rw-r--r--src/thirdparty/ResizableLib/ResizableMinMax.cpp89
-rw-r--r--src/thirdparty/ResizableLib/ResizableMinMax.h53
-rw-r--r--src/thirdparty/ResizableLib/ResizableMsgSupport.h61
-rw-r--r--src/thirdparty/ResizableLib/ResizableMsgSupport.inl56
-rw-r--r--src/thirdparty/ResizableLib/ResizablePage.cpp72
-rw-r--r--src/thirdparty/ResizableLib/ResizablePage.h78
-rw-r--r--src/thirdparty/ResizableLib/ResizableSheet.cpp349
-rw-r--r--src/thirdparty/ResizableLib/ResizableSheet.h114
-rw-r--r--src/thirdparty/ResizableLib/ResizableState.cpp105
-rw-r--r--src/thirdparty/ResizableLib/ResizableState.h38
-rw-r--r--src/thirdparty/ResizableLib/stdafx.cpp24
-rw-r--r--src/thirdparty/ResizableLib/stdafx.h40
21 files changed, 2730 insertions, 0 deletions
diff --git a/src/thirdparty/ResizableLib/Artistic-License.txt b/src/thirdparty/ResizableLib/Artistic-License.txt
new file mode 100644
index 000000000..5b5e8550f
--- /dev/null
+++ b/src/thirdparty/ResizableLib/Artistic-License.txt
@@ -0,0 +1,99 @@
+The Artistic License
+
+Preamble
+
+The intent of this document is to state the conditions under which a Package
+may be copied, such that the Copyright Holder maintains some semblance of
+artistic control over the development of the package, while giving the users of
+the package the right to use and distribute the Package in a more-or-less
+customary fashion, plus the right to make reasonable modifications.
+
+Definitions:
+
+ * "Package" refers to the collection of files distributed by the Copyright
+ Holder, and derivatives of that collection of files created through textual
+ modification.
+ * "Standard Version" refers to such a Package if it has not been modified,
+ or has been modified in accordance with the wishes of the Copyright Holder.
+ * "Copyright Holder" is whoever is named in the copyright or copyrights for
+ the package.
+ * "You" is you, if you're thinking about copying or distributing this
+ Package.
+ * "Reasonable copying fee" is whatever you can justify on the basis of media
+ cost, duplication charges, time of people involved, and so on. (You will not
+ be required to justify it to the Copyright Holder, but only to the computing
+ community at large as a market that must bear the fee.)
+ * "Freely Available" means that no fee is charged for the item itself,
+ though there may be fees involved in handling the item. It also means that
+ recipients of the item may redistribute it under the same conditions they
+ received it.
+
+1. You may make and give away verbatim copies of the source form of the
+ Standard Version of this Package without restriction, provided that you
+ duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications derived
+ from the Public Domain or from the Copyright Holder. A Package modified in such
+ a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided
+ that you insert a prominent notice in each changed file stating how and when you
+ changed that file, and provided that you do at least ONE of the following:
+
+ a) place your modifications in the Public Domain or otherwise make them
+ Freely Available, such as by posting said modifications to Usenet or an
+ equivalent medium, or placing the modifications on a major archive site such
+ as ftp.uu.net, or by allowing the Copyright Holder to include your
+ modifications in the Standard Version of the Package.
+
+ b) use the modified Package only within your corporation or
+ organization.
+
+ c) rename any non-standard executables so the names do not conflict with
+ standard executables, which must also be provided, and provide a separate
+ manual page for each non-standard executable that clearly documents how it
+ differs from the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or
+ executable form, provided that you do at least ONE of the following:
+
+ a) distribute a Standard Version of the executables and library files,
+ together with instructions (in the manual page or equivalent) on where to get
+ the Standard Version.
+
+ b) accompany the distribution with the machine-readable source of the
+ Package with your modifications.
+
+ c) accompany any non-standard executables with their corresponding Standard
+ Version executables, giving the non-standard executables non-standard names,
+ and clearly documenting the differences in manual pages (or equivalent),
+ together with instructions on where to get the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this
+ Package. You may charge any fee you choose for support of this Package. You may
+ not charge a fee for this Package itself. However, you may distribute this
+ Package in aggregate with other (possibly commercial) programs as part of a
+ larger (possibly commercial) software distribution provided that you do not
+ advertise this Package as a product of your own.
+
+6. The scripts and library files supplied as input to or produced as output
+ from the programs of this Package do not automatically fall under the copyright
+ of this Package, but belong to whomever generated them, and may be sold
+ commercially, and may be aggregated with this Package.
+
+7. C or perl subroutines supplied by you and linked into this Package shall
+ not be considered part of this Package.
+
+8. The name of the Copyright Holder may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+The End
diff --git a/src/thirdparty/ResizableLib/ResizableDialog.cpp b/src/thirdparty/ResizableLib/ResizableDialog.cpp
new file mode 100644
index 000000000..af9d16b97
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableDialog.cpp
@@ -0,0 +1,155 @@
+// ResizableDialog.cpp : implementation file
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "ResizableDialog.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CResizableDialog
+
+inline void CResizableDialog::PrivateConstruct()
+{
+ m_bEnableSaveRestore = FALSE;
+ m_dwGripTempState = 1;
+}
+
+CResizableDialog::CResizableDialog()
+{
+ PrivateConstruct();
+}
+
+CResizableDialog::CResizableDialog(UINT nIDTemplate, CWnd* pParentWnd)
+ : CCmdUIDialog(nIDTemplate, pParentWnd)
+{
+ PrivateConstruct();
+}
+
+CResizableDialog::CResizableDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd)
+ : CCmdUIDialog(lpszTemplateName, pParentWnd)
+{
+ PrivateConstruct();
+}
+
+CResizableDialog::~CResizableDialog()
+{
+}
+
+
+BEGIN_MESSAGE_MAP(CResizableDialog, CCmdUIDialog)
+ //{{AFX_MSG_MAP(CResizableDialog)
+ ON_WM_GETMINMAXINFO()
+ ON_WM_SIZE()
+ ON_WM_DESTROY()
+ ON_WM_CREATE()
+ ON_WM_ERASEBKGND()
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CResizableDialog message handlers
+
+int CResizableDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+ if (__super::OnCreate(lpCreateStruct) == -1)
+ return -1;
+
+ // child dialogs don't want resizable border or size grip,
+ // nor they can handle the min/max size constraints
+ BOOL bChild = GetStyle() & WS_CHILD;
+
+ if (!bChild)
+ {
+ // keep client area
+ CRect rect;
+ GetClientRect(&rect);
+ // set resizable style
+ ModifyStyle(DS_MODALFRAME, WS_POPUP | WS_THICKFRAME);
+ // adjust size to reflect new style
+ ::AdjustWindowRectEx(&rect, GetStyle(),
+ ::IsMenu(GetMenu()->GetSafeHmenu()), GetExStyle());
+ SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(), SWP_FRAMECHANGED|
+ SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREPOSITION);
+
+ // set the initial size as the min track size
+ SetMinTrackSize(rect.Size());
+ }
+
+ // create and init the size-grip
+ if (!CreateSizeGrip(!bChild))
+ return -1;
+
+ return 0;
+}
+
+void CResizableDialog::OnDestroy()
+{
+ if (m_bEnableSaveRestore)
+ SaveWindowRect(m_sSection, m_bRectOnly);
+
+ // remove child windows
+ RemoveAllAnchors();
+
+ __super::OnDestroy();
+}
+
+void CResizableDialog::OnSize(UINT nType, int cx, int cy)
+{
+ CWnd::OnSize(nType, cx, cy);
+
+ if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW)
+ return; // arrangement not needed
+
+ if (nType == SIZE_MAXIMIZED)
+ HideSizeGrip(&m_dwGripTempState);
+ else
+ ShowSizeGrip(&m_dwGripTempState);
+
+ // update grip and layout
+ UpdateSizeGrip();
+ ArrangeLayout();
+}
+
+void CResizableDialog::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
+{
+ MinMaxInfo(lpMMI);
+}
+
+// NOTE: this must be called after setting the layout
+// to have the dialog and its controls displayed properly
+void CResizableDialog::EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly)
+{
+ m_sSection = pszSection;
+
+ m_bEnableSaveRestore = TRUE;
+ m_bRectOnly = bRectOnly;
+
+ // restore immediately
+ LoadWindowRect(pszSection, bRectOnly);
+}
+
+
+BOOL CResizableDialog::OnEraseBkgnd(CDC* pDC)
+{
+ // Windows XP doesn't like clipping regions ...try this!
+ EraseBackground(pDC);
+ return TRUE;
+
+/* ClipChildren(pDC); // old-method (for safety)
+
+ return CDialog::OnEraseBkgnd(pDC);
+*/
+}
diff --git a/src/thirdparty/ResizableLib/ResizableDialog.h b/src/thirdparty/ResizableLib/ResizableDialog.h
new file mode 100644
index 000000000..ec3db1829
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableDialog.h
@@ -0,0 +1,101 @@
+#if !defined(AFX_RESIZABLEDIALOG_H__INCLUDED_)
+#define AFX_RESIZABLEDIALOG_H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+// ResizableDialog.h : header file
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "ResizableLayout.h"
+#include "ResizableGrip.h"
+#include "ResizableMinMax.h"
+#include "ResizableState.h"
+#include "../../CmdUI/CmdUI.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CResizableDialog window
+
+class CResizableDialog : public CCmdUIDialog, public CResizableLayout,
+ public CResizableGrip, public CResizableMinMax,
+ public CResizableState
+{
+
+// Construction
+public:
+ CResizableDialog();
+ CResizableDialog(UINT nIDTemplate, CWnd* pParentWnd = NULL);
+ CResizableDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL);
+
+// Attributes
+private:
+ // support for temporarily hiding the grip
+ DWORD m_dwGripTempState;
+
+ // flags
+ BOOL m_bEnableSaveRestore;
+ BOOL m_bRectOnly;
+
+ // internal status
+ CString m_sSection; // section name (identifies a parent window)
+
+// Operations
+public:
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CResizableDialog)
+ protected:
+ //}}AFX_VIRTUAL
+
+// Implementation
+public:
+ virtual ~CResizableDialog();
+
+// used internally
+private:
+ void PrivateConstruct();
+
+// callable from derived classes
+protected:
+ // section to use in app's profile
+ void EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly = FALSE);
+
+ virtual CWnd* GetResizableWnd()
+ {
+ // make the layout know its parent window
+ return this;
+ };
+
+// Generated message map functions
+protected:
+ //{{AFX_MSG(CResizableDialog)
+ afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
+ afx_msg void OnSize(UINT nType, int cx, int cy);
+ afx_msg void OnDestroy();
+ afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+ afx_msg BOOL OnEraseBkgnd(CDC* pDC);
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_RESIZABLEDIALOG_H__INCLUDED_)
diff --git a/src/thirdparty/ResizableLib/ResizableGrip.cpp b/src/thirdparty/ResizableLib/ResizableGrip.cpp
new file mode 100644
index 000000000..d1551ce6b
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableGrip.cpp
@@ -0,0 +1,304 @@
+// ResizableGrip.cpp: implementation of the CResizableGrip class.
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "ResizableGrip.h"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CResizableGrip::CResizableGrip()
+{
+ m_nShowCount = 0;
+}
+
+CResizableGrip::~CResizableGrip()
+{
+
+}
+
+void CResizableGrip::UpdateSizeGrip()
+{
+ ASSERT(::IsWindow(m_wndGrip.m_hWnd));
+
+ // size-grip goes bottom right in the client area
+ // (any right-to-left adjustment should go here)
+
+ RECT rect;
+ GetResizableWnd()->GetClientRect(&rect);
+
+ rect.left = rect.right - m_wndGrip.m_size.cx;
+ rect.top = rect.bottom - m_wndGrip.m_size.cy;
+
+ // must stay below other children
+ m_wndGrip.SetWindowPos(&CWnd::wndBottom, rect.left, rect.top, 0, 0,
+ SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOREPOSITION
+ | (IsSizeGripVisible() ? SWP_SHOWWINDOW : SWP_HIDEWINDOW));
+}
+
+// pbStatus points to a variable, maintained by the caller, that
+// holds its visibility status. Initialize the variable with 1
+// to allow to temporarily hide the grip, 0 to allow to
+// temporarily show the grip (with respect to the dwMask bit).
+
+// NB: visibility is effective only after an update
+
+void CResizableGrip::ShowSizeGrip(DWORD* pStatus, DWORD dwMask /*= 1*/)
+{
+ ASSERT(pStatus != NULL);
+
+ if (!(*pStatus & dwMask))
+ {
+ m_nShowCount++;
+ (*pStatus) |= dwMask;
+ }
+}
+
+void CResizableGrip::HideSizeGrip(DWORD* pStatus, DWORD dwMask /*= 1*/)
+{
+ ASSERT(pStatus != NULL);
+
+ if (*pStatus & dwMask)
+ {
+ m_nShowCount--;
+ (*pStatus) &= ~dwMask;
+ }
+}
+
+BOOL CResizableGrip::IsSizeGripVisible()
+{
+ // NB: visibility is effective only after an update
+ return (m_nShowCount > 0);
+}
+
+void CResizableGrip::SetSizeGripVisibility(BOOL bVisible)
+{
+ if (bVisible)
+ m_nShowCount = 1;
+ else
+ m_nShowCount = 0;
+}
+
+BOOL CResizableGrip::SetSizeGripBkMode(int nBkMode)
+{
+ if (::IsWindow(m_wndGrip.m_hWnd))
+ {
+ if (nBkMode == OPAQUE)
+ m_wndGrip.SetTransparency(FALSE);
+ else if (nBkMode == TRANSPARENT)
+ m_wndGrip.SetTransparency(TRUE);
+ else
+ return FALSE;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void CResizableGrip::SetSizeGripShape(BOOL bTriangular)
+{
+ m_wndGrip.SetTriangularShape(bTriangular);
+}
+
+BOOL CResizableGrip::CreateSizeGrip(BOOL bVisible /*= TRUE*/,
+ BOOL bTriangular /*= TRUE*/, BOOL bTransparent /*= FALSE*/)
+{
+ // create grip
+ CRect rect(0 , 0, m_wndGrip.m_size.cx, m_wndGrip.m_size.cy);
+ BOOL bRet = m_wndGrip.Create(WS_CHILD | WS_CLIPSIBLINGS
+ | SBS_SIZEGRIP, rect, GetResizableWnd(), 0);
+
+ if (bRet)
+ {
+ // set options
+ m_wndGrip.SetTriangularShape(bTriangular);
+ m_wndGrip.SetTransparency(bTransparent);
+ SetSizeGripVisibility(bVisible);
+
+ // update position
+ UpdateSizeGrip();
+ }
+
+ return bRet;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CSizeGrip implementation
+
+BOOL CResizableGrip::CSizeGrip::IsRTL()
+{
+ return GetExStyle() & 0x00400000L/*WS_EX_LAYOUTRTL*/;
+}
+
+BOOL CResizableGrip::CSizeGrip::PreCreateWindow(CREATESTRUCT& cs)
+{
+ // set window size
+ m_size.cx = GetSystemMetrics(SM_CXVSCROLL);
+ m_size.cy = GetSystemMetrics(SM_CYHSCROLL);
+
+ cs.cx = m_size.cx;
+ cs.cy = m_size.cy;
+
+ return CScrollBar::PreCreateWindow(cs);
+}
+
+LRESULT CResizableGrip::CSizeGrip::WindowProc(UINT message,
+ WPARAM wParam, LPARAM lParam)
+{
+ switch (message)
+ {
+ case WM_GETDLGCODE:
+ // fix to prevent the control to gain focus, using arrow keys
+ // (standard grip returns DLGC_WANTARROWS, like any standard scrollbar)
+ return DLGC_STATIC;
+
+ case WM_NCHITTEST:
+ // choose proper cursor shape
+ if (IsRTL())
+ return HTBOTTOMLEFT;
+ else
+ return HTBOTTOMRIGHT;
+ break;
+
+ case WM_SETTINGCHANGE:
+ {
+ // update grip's size
+ CSize sizeOld = m_size;
+ m_size.cx = GetSystemMetrics(SM_CXVSCROLL);
+ m_size.cy = GetSystemMetrics(SM_CYHSCROLL);
+
+ // resize transparency bitmaps
+ if (m_bTransparent)
+ {
+ CClientDC dc(this);
+
+ // destroy bitmaps
+ m_bmGrip.DeleteObject();
+ m_bmMask.DeleteObject();
+
+ // re-create bitmaps
+ m_bmGrip.CreateCompatibleBitmap(&dc, m_size.cx, m_size.cy);
+ m_bmMask.CreateBitmap(m_size.cx, m_size.cy, 1, 1, NULL);
+ }
+
+ // re-calc shape
+ if (m_bTriangular)
+ SetTriangularShape(m_bTriangular);
+
+ // reposition the grip
+ CRect rect;
+ GetWindowRect(rect);
+ rect.InflateRect(m_size.cx - sizeOld.cx, m_size.cy - sizeOld.cy, 0, 0);
+ ::MapWindowPoints(NULL, GetParent()->GetSafeHwnd(), (LPPOINT)&rect, 2);
+ MoveWindow(rect, TRUE);
+ }
+ break;
+
+ case WM_DESTROY:
+ // perform clean up
+ if (m_bTransparent)
+ SetTransparency(FALSE);
+ break;
+
+ case WM_PAINT:
+ if (m_bTransparent)
+ {
+ CPaintDC dc(this);
+
+ // select bitmaps
+ CBitmap *pOldGrip, *pOldMask;
+
+ pOldGrip = m_dcGrip.SelectObject(&m_bmGrip);
+ pOldMask = m_dcMask.SelectObject(&m_bmMask);
+
+ // obtain original grip bitmap, make the mask and prepare masked bitmap
+ CScrollBar::WindowProc(WM_PAINT, (WPARAM)m_dcGrip.GetSafeHdc(), lParam);
+ m_dcGrip.SetBkColor(m_dcGrip.GetPixel(0, 0));
+ m_dcMask.BitBlt(0, 0, m_size.cx, m_size.cy, &m_dcGrip, 0, 0, SRCCOPY);
+ m_dcGrip.BitBlt(0, 0, m_size.cx, m_size.cy, &m_dcMask, 0, 0, 0x00220326);
+
+ // draw transparently
+ dc.BitBlt(0, 0, m_size.cx, m_size.cy, &m_dcMask, 0, 0, SRCAND);
+ dc.BitBlt(0, 0, m_size.cx, m_size.cy, &m_dcGrip, 0, 0, SRCPAINT);
+
+ // unselect bitmaps
+ m_dcGrip.SelectObject(pOldGrip);
+ m_dcMask.SelectObject(pOldMask);
+
+ return 0;
+ }
+ break;
+ }
+
+ return CScrollBar::WindowProc(message, wParam, lParam);
+}
+
+void CResizableGrip::CSizeGrip::SetTransparency(BOOL bActivate)
+{
+ // creates or deletes DCs and Bitmaps used for
+ // implementing a transparent size grip
+
+ if (bActivate && !m_bTransparent)
+ {
+ m_bTransparent = TRUE;
+
+ CClientDC dc(this);
+
+ // create memory DCs and bitmaps
+ m_dcGrip.CreateCompatibleDC(&dc);
+ m_bmGrip.CreateCompatibleBitmap(&dc, m_size.cx, m_size.cy);
+
+ m_dcMask.CreateCompatibleDC(&dc);
+ m_bmMask.CreateBitmap(m_size.cx, m_size.cy, 1, 1, NULL);
+ }
+ else if (!bActivate && m_bTransparent)
+ {
+ m_bTransparent = FALSE;
+
+ // destroy memory DCs and bitmaps
+ m_dcGrip.DeleteDC();
+ m_bmGrip.DeleteObject();
+
+ m_dcMask.DeleteDC();
+ m_bmMask.DeleteObject();
+ }
+}
+
+void CResizableGrip::CSizeGrip::SetTriangularShape(BOOL bEnable)
+{
+ m_bTriangular = bEnable;
+
+ if (bEnable)
+ {
+ // set a triangular window region
+ CRect rect;
+ GetWindowRect(rect);
+ rect.OffsetRect(-rect.TopLeft());
+ POINT arrPoints[] =
+ {
+ { rect.left, rect.bottom },
+ { rect.right, rect.bottom },
+ { rect.right, rect.top }
+ };
+ CRgn rgnGrip;
+ rgnGrip.CreatePolygonRgn(arrPoints, 3, WINDING);
+ SetWindowRgn((HRGN)rgnGrip.Detach(), IsWindowVisible());
+ }
+ else
+ {
+ SetWindowRgn((HRGN)NULL, IsWindowVisible());
+ }
+}
diff --git a/src/thirdparty/ResizableLib/ResizableGrip.h b/src/thirdparty/ResizableLib/ResizableGrip.h
new file mode 100644
index 000000000..0a85514b9
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableGrip.h
@@ -0,0 +1,81 @@
+// ResizableGrip.h: interface for the CResizableGrip class.
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_RESIZABLEGRIP_H__INCLUDED_)
+#define AFX_RESIZABLEGRIP_H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+class CResizableGrip
+{
+private:
+ class CSizeGrip : public CScrollBar
+ {
+ public:
+ CSizeGrip()
+ {
+ m_bTransparent = FALSE;
+ m_bTriangular = FALSE;
+ m_size.cx = 0;
+ m_size.cy = 0;
+ }
+
+ void SetTriangularShape(BOOL bEnable);
+ void SetTransparency(BOOL bActivate);
+
+ BOOL IsRTL(); // right-to-left layout support
+
+ virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
+
+ SIZE m_size; // holds grip size
+
+ protected:
+ virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+
+ BOOL m_bTriangular; // triangular shape active
+ BOOL m_bTransparent; // transparency active
+
+ // memory DCs and bitmaps for transparent grip
+ CDC m_dcGrip, m_dcMask;
+ CBitmap m_bmGrip, m_bmMask;
+ };
+
+ CSizeGrip m_wndGrip; // grip control
+ int m_nShowCount; // support for hiding the grip
+
+protected:
+ // create a size grip, with options
+ BOOL CreateSizeGrip(BOOL bVisible = TRUE,
+ BOOL bTriangular = TRUE, BOOL bTransparent = FALSE);
+
+ BOOL IsSizeGripVisible(); // TRUE if grip is set to be visible
+ void SetSizeGripVisibility(BOOL bVisible); // set default visibility
+ void UpdateSizeGrip(); // update the grip's visibility and position
+ void ShowSizeGrip(DWORD* pStatus, DWORD dwMask = 1); // temp show the size grip
+ void HideSizeGrip(DWORD* pStatus, DWORD dwMask = 1); // temp hide the size grip
+ BOOL SetSizeGripBkMode(int nBkMode); // like CDC::SetBkMode
+ void SetSizeGripShape(BOOL bTriangular);
+
+ virtual CWnd* GetResizableWnd() = 0;
+
+public:
+ CResizableGrip();
+ virtual ~CResizableGrip();
+};
+
+#endif // !defined(AFX_RESIZABLEGRIP_H__INCLUDED_)
diff --git a/src/thirdparty/ResizableLib/ResizableLayout.cpp b/src/thirdparty/ResizableLib/ResizableLayout.cpp
new file mode 100644
index 000000000..8bbf9c4c1
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableLayout.cpp
@@ -0,0 +1,520 @@
+// ResizableLayout.cpp: implementation of the CResizableLayout class.
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "commctrl.h"
+#include "ResizableLayout.h"
+#include "ResizableMsgSupport.inl"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+// In August 2002 Platform SDK, some guy at MS thought it was time to
+// add the missing symbol BS_TYPEMASK, but forgot its original meaning
+// and so now he's telling us not to use that symbol because its
+// value is likely to change in the future SDK releases, including all
+// the BS_* style bits in the mask, not just the button's type as the
+// symbol's name suggests. So now we're forced to use another symbol!
+#define _BS_TYPEMASK 0x0000000FL
+
+void CResizableLayout::AddAnchor(HWND hWnd, CSize sizeTypeTL, CSize sizeTypeBR)
+{
+ CWnd* pParent = GetResizableWnd();
+
+ // child window must be valid
+ ASSERT(::IsWindow(hWnd));
+ // must be child of parent window
+// ASSERT(::IsChild(pParent->GetSafeHwnd(), hWnd));
+ // top-left anchor must be valid
+ ASSERT(sizeTypeTL != NOANCHOR);
+
+ // get control's window class
+ CString sClassName;
+ GetClassName(hWnd, sClassName.GetBufferSetLength(_MAX_PATH), _MAX_PATH);
+ sClassName.ReleaseBuffer();
+
+ // get parent window's rect
+ CRect rectParent;
+ GetTotalClientRect(&rectParent);
+ // and child control's rect
+ CRect rectChild;
+ ::GetWindowRect(hWnd, &rectChild);
+ ::MapWindowPoints(NULL, pParent->m_hWnd, (LPPOINT)&rectChild, 2);
+
+ // adjust position, if client area has been scrolled
+ rectChild.OffsetRect(-rectParent.TopLeft());
+
+ // go calculate margins
+ CSize sizeMarginTL, sizeMarginBR;
+
+ if (sizeTypeBR == NOANCHOR)
+ sizeTypeBR = sizeTypeTL;
+
+ // calculate margin for the top-left corner
+
+ sizeMarginTL.cx = rectChild.left - rectParent.Width() * sizeTypeTL.cx / 100;
+ sizeMarginTL.cy = rectChild.top - rectParent.Height() * sizeTypeTL.cy / 100;
+
+ // calculate margin for the bottom-right corner
+
+ sizeMarginBR.cx = rectChild.right - rectParent.Width() * sizeTypeBR.cx / 100;
+ sizeMarginBR.cy = rectChild.bottom - rectParent.Height() * sizeTypeBR.cy / 100;
+
+ // prepare the structure
+ LayoutInfo layout(hWnd, sizeTypeTL, sizeMarginTL,
+ sizeTypeBR, sizeMarginBR, sClassName);
+
+ // initialize resize properties (overridable)
+ InitResizeProperties(layout);
+
+ // must not be already there!
+ // (this is probably due to a duplicate call to AddAnchor)
+ POSITION pos;
+ ASSERT(!m_mapLayout.Lookup(hWnd, pos));
+
+ // add to the list and the map
+ pos = m_listLayout.AddTail(layout);
+ m_mapLayout.SetAt(hWnd, pos);
+}
+
+void CResizableLayout::AddAnchorCallback(UINT nCallbackID)
+{
+ // one callback control cannot rely upon another callback control's
+ // size and/or position (they're updated all together at the end)
+ // it can however use a non-callback control, which is updated before
+
+ // add to the list
+ LayoutInfo layout;
+ layout.nCallbackID = nCallbackID;
+ m_listLayoutCB.AddTail(layout);
+}
+
+BOOL CResizableLayout::ArrangeLayoutCallback(CResizableLayout::LayoutInfo& /*layout*/)
+{
+ ASSERT(FALSE);
+ // must be overridden, if callback is used
+
+ return FALSE; // no output data
+}
+
+void CResizableLayout::ArrangeLayout()
+{
+ // common vars
+ UINT uFlags;
+ LayoutInfo layout;
+ CRect rectParent, rectChild;
+ GetTotalClientRect(&rectParent); // get parent window's rect
+ int count = m_listLayout.GetCount();
+ int countCB = m_listLayoutCB.GetCount();
+
+ // reposition child windows
+ HDWP hdwp = ::BeginDeferWindowPos(count + countCB);
+
+ POSITION pos = m_listLayout.GetHeadPosition();
+ while (pos != NULL)
+ {
+ // get layout info
+ layout = m_listLayout.GetNext(pos);
+
+ // calculate new child's position, size and flags for SetWindowPos
+ CalcNewChildPosition(layout, rectParent, rectChild, uFlags);
+
+ // only if size or position changed
+ if ((uFlags & (SWP_NOMOVE|SWP_NOSIZE)) != (SWP_NOMOVE|SWP_NOSIZE))
+ {
+ hdwp = ::DeferWindowPos(hdwp, layout.hWnd, NULL, rectChild.left,
+ rectChild.top, rectChild.Width(), rectChild.Height(), uFlags);
+ }
+ }
+
+ // for callback items you may use GetAnchorPosition to know the
+ // new position and size of a non-callback item after resizing
+
+ pos = m_listLayoutCB.GetHeadPosition();
+ while (pos != NULL)
+ {
+ // get layout info
+ layout = m_listLayoutCB.GetNext(pos);
+ // request layout data
+ if (!ArrangeLayoutCallback(layout))
+ continue;
+
+ // calculate new child's position, size and flags for SetWindowPos
+ CalcNewChildPosition(layout, rectParent, rectChild, uFlags);
+
+ // only if size or position changed
+ if ((uFlags & (SWP_NOMOVE|SWP_NOSIZE)) != (SWP_NOMOVE|SWP_NOSIZE))
+ {
+ hdwp = ::DeferWindowPos(hdwp, layout.hWnd, NULL, rectChild.left,
+ rectChild.top, rectChild.Width(), rectChild.Height(), uFlags);
+ }
+ }
+
+ // finally move all the windows at once
+ ::EndDeferWindowPos(hdwp);
+}
+
+void CResizableLayout::ClipChildWindow(const CResizableLayout::LayoutInfo& layout,
+ CRgn* pRegion)
+{
+ // obtain window position
+ CRect rect;
+ ::GetWindowRect(layout.hWnd, &rect);
+ ::MapWindowPoints(NULL, GetResizableWnd()->m_hWnd, (LPPOINT)&rect, 2);
+
+ // use window region if any
+ CRgn rgn;
+ rgn.CreateRectRgn(0,0,0,0);
+ switch (::GetWindowRgn(layout.hWnd, rgn))
+ {
+ case COMPLEXREGION:
+ case SIMPLEREGION:
+ rgn.OffsetRgn(rect.TopLeft());
+ break;
+
+ default:
+ rgn.SetRectRgn(&rect);
+ }
+
+ // get the clipping property
+ BOOL bClipping = layout.properties.bAskClipping ?
+ LikesClipping(layout) : layout.properties.bCachedLikesClipping;
+
+ // modify region accordingly
+ if (bClipping)
+ pRegion->CombineRgn(pRegion, &rgn, RGN_DIFF);
+ else
+ pRegion->CombineRgn(pRegion, &rgn, RGN_OR);
+}
+
+void CResizableLayout::GetClippingRegion(CRgn* pRegion)
+{
+ CWnd* pWnd = GetResizableWnd();
+
+ // System's default clipping area is screen's size,
+ // not enough for max track size, for example:
+ // if screen is 1024 x 768 and resizing border is 4 pixels,
+ // maximized size is 1024+4*2=1032 x 768+4*2=776,
+ // but max track size is 4 pixels bigger 1036 x 780 (don't ask me why!)
+ // So, if you resize the window to maximum size, the last 4 pixels
+ // are clipped out by the default clipping region, that gets created
+ // as soon as you call clipping functions (my guess).
+
+ // reset clipping region to the whole client area
+ CRect rect;
+ pWnd->GetClientRect(&rect);
+ pRegion->CreateRectRgnIndirect(&rect);
+
+ // clip only anchored controls
+ LayoutInfo layout;
+ POSITION pos = m_listLayout.GetHeadPosition();
+ while (pos != NULL)
+ {
+ // get layout info
+ layout = m_listLayout.GetNext(pos);
+
+ if (::IsWindowVisible(layout.hWnd))
+ ClipChildWindow(layout, pRegion);
+ }
+ pos = m_listLayoutCB.GetHeadPosition();
+ while (pos != NULL)
+ {
+ // get layout info
+ layout = m_listLayoutCB.GetNext(pos);
+ // request data
+ if (!ArrangeLayoutCallback(layout))
+ continue;
+
+ if (::IsWindowVisible(layout.hWnd))
+ ClipChildWindow(layout, pRegion);
+ }
+
+ // fix for RTL layouts (1 pixel of horz offset)
+ if (pWnd->GetExStyle() & 0x00400000L/*WS_EX_LAYOUTRTL*/)
+ pRegion->OffsetRgn(-1,0);
+}
+
+void CResizableLayout::EraseBackground(CDC* pDC)
+{
+ HWND hWnd = GetResizableWnd()->GetSafeHwnd();
+
+ // retrieve the background brush
+ HBRUSH hBrush = NULL;
+
+ // is this a dialog box?
+ // (using class atom is quickier than using the class name)
+//mpc-hc custom code start
+ ATOM atomWndClass = (ATOM)::GetClassLongPtr(hWnd, GCW_ATOM);
+//mpc-hc custom code end
+ if (atomWndClass == (ATOM)0x8002)
+ {
+ // send a message to the dialog box
+ hBrush = (HBRUSH)::SendMessage(hWnd, WM_CTLCOLORDLG,
+ (WPARAM)pDC->GetSafeHdc(), (LPARAM)hWnd);
+ }
+ else
+ {
+ // take the background brush from the window's class
+//mpc-hc custom code start
+ hBrush = (HBRUSH)::GetClassLongPtr(hWnd, GCLP_HBRBACKGROUND);
+//mpc-hc custom code end
+ }
+
+ // fill the clipped background
+ CRgn rgn;
+ GetClippingRegion(&rgn);
+
+ ::FillRgn(pDC->GetSafeHdc(), rgn, hBrush);
+}
+
+// support legacy code (will disappear in future versions)
+void CResizableLayout::ClipChildren(CDC* pDC)
+{
+ CRgn rgn;
+ GetClippingRegion(&rgn);
+ // the clipping region is in device units
+ rgn.OffsetRgn(-pDC->GetWindowOrg());
+ pDC->SelectClipRgn(&rgn);
+}
+
+void CResizableLayout::GetTotalClientRect(LPRECT lpRect)
+{
+ GetResizableWnd()->GetClientRect(lpRect);
+}
+
+BOOL CResizableLayout::NeedsRefresh(const CResizableLayout::LayoutInfo& layout,
+ const CRect& rectOld, const CRect& rectNew)
+{
+ if (layout.bMsgSupport)
+ {
+ REFRESHPROPERTY refresh;
+ refresh.rcOld = rectOld;
+ refresh.rcNew = rectNew;
+ if (Send_NeedsRefresh(layout.hWnd, &refresh))
+ return refresh.bNeedsRefresh;
+ }
+
+ int nDiffWidth = (rectNew.Width() - rectOld.Width());
+ int nDiffHeight = (rectNew.Height() - rectOld.Height());
+
+ // is the same size?
+ if (nDiffWidth == 0 && nDiffHeight == 0)
+ return FALSE;
+
+ // optimistic, no need to refresh
+ BOOL bRefresh = FALSE;
+
+ // window classes that need refresh when resized
+ if (layout.sWndClass == WC_STATIC)
+ {
+//mpc-hc custom code start
+ LONG_PTR style = ::GetWindowLongPtr(layout.hWnd, GWL_STYLE);
+//mpc-hc custom code end
+
+ switch (style & SS_TYPEMASK)
+ {
+ case SS_LEFT:
+ case SS_CENTER:
+ case SS_RIGHT:
+ // word-wrapped text
+ bRefresh = bRefresh || (nDiffWidth != 0);
+ // vertically centered text
+ if (style & SS_CENTERIMAGE)
+ bRefresh = bRefresh || (nDiffHeight != 0);
+ break;
+
+ case SS_LEFTNOWORDWRAP:
+ // text with ellipsis
+ if (style & SS_ELLIPSISMASK)
+ bRefresh = bRefresh || (nDiffWidth != 0);
+ // vertically centered text
+ if (style & SS_CENTERIMAGE)
+ bRefresh = bRefresh || (nDiffHeight != 0);
+ break;
+
+ case SS_ENHMETAFILE:
+ case SS_BITMAP:
+ case SS_ICON:
+ // images
+ case SS_BLACKFRAME:
+ case SS_GRAYFRAME:
+ case SS_WHITEFRAME:
+ case SS_ETCHEDFRAME:
+ // and frames
+ bRefresh = TRUE;
+ break;
+ }
+ }
+
+ // window classes that don't redraw client area correctly
+ // when the hor scroll pos changes due to a resizing
+ BOOL bHScroll = FALSE;
+ if (layout.sWndClass == WC_LISTBOX)
+ bHScroll = TRUE;
+
+ // fix for horizontally scrollable windows
+ if (bHScroll && (nDiffWidth > 0))
+ {
+ // get max scroll position
+ SCROLLINFO info;
+ info.cbSize = sizeof(SCROLLINFO);
+ info.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
+ if (::GetScrollInfo(layout.hWnd, SB_HORZ, &info))
+ {
+ // subtract the page size
+ info.nMax -= __max(info.nPage-1,0);
+ }
+
+ // resizing will cause the text to scroll on the right
+ // because the scrollbar is going beyond the right limit
+ if ((info.nMax > 0) && (info.nPos + nDiffWidth > info.nMax))
+ {
+ // needs repainting, due to horiz scrolling
+ bRefresh = TRUE;
+ }
+ }
+
+ return bRefresh;
+}
+
+BOOL CResizableLayout::LikesClipping(const CResizableLayout::LayoutInfo& layout)
+{
+ if (layout.bMsgSupport)
+ {
+ CLIPPINGPROPERTY clipping;
+ if (Send_LikesClipping(layout.hWnd, &clipping))
+ return clipping.bLikesClipping;
+ }
+
+//mpc-hc custom code start
+ LONG_PTR style = ::GetWindowLongPtr(layout.hWnd, GWL_STYLE);
+//mpc-hc custom code end
+
+ // skip windows that wants background repainted
+ if (layout.sWndClass == TOOLBARCLASSNAME && (style & TBSTYLE_TRANSPARENT))
+ return FALSE;
+ else if (layout.sWndClass == WC_BUTTON)
+ {
+ CRect rect;
+ switch (style & _BS_TYPEMASK)
+ {
+ case BS_GROUPBOX:
+ return FALSE;
+
+ case BS_OWNERDRAW:
+ // ownerdraw buttons must return correct hittest code
+ // to notify their transparency to the system and this library
+ ::GetWindowRect(layout.hWnd, &rect);
+ if ( HTTRANSPARENT == ::SendMessage(layout.hWnd,
+ WM_NCHITTEST, 0, MAKELPARAM(rect.left, rect.top)) )
+ return FALSE;
+ break;
+ }
+ return TRUE;
+ }
+ else if (layout.sWndClass == WC_STATIC)
+ {
+ switch (style & SS_TYPEMASK)
+ {
+ case SS_LEFT:
+ case SS_CENTER:
+ case SS_RIGHT:
+ case SS_SIMPLE:
+ case SS_LEFTNOWORDWRAP:
+ // text
+ case SS_BLACKRECT:
+ case SS_GRAYRECT:
+ case SS_WHITERECT:
+ // filled rects
+ case SS_ETCHEDHORZ:
+ case SS_ETCHEDVERT:
+ // etched lines
+ case SS_BITMAP:
+ // bitmaps
+ return TRUE;
+ break;
+
+ case SS_ICON:
+ case SS_ENHMETAFILE:
+ if (style & SS_CENTERIMAGE)
+ return FALSE;
+ return TRUE;
+ break;
+
+ default:
+ return FALSE;
+ }
+ }
+
+ // assume the others like clipping
+ return TRUE;
+}
+
+void CResizableLayout::CalcNewChildPosition(const CResizableLayout::LayoutInfo& layout,
+ const CRect &rectParent, CRect &rectChild, UINT& uFlags)
+{
+ CWnd* pParent = GetResizableWnd();
+
+ ::GetWindowRect(layout.hWnd, &rectChild);
+ ::MapWindowPoints(NULL, pParent->m_hWnd, (LPPOINT)&rectChild, 2);
+
+ CRect rectNew;
+
+ // calculate new top-left corner
+ rectNew.left = layout.sizeMarginTL.cx + rectParent.Width() * layout.sizeTypeTL.cx / 100;
+ rectNew.top = layout.sizeMarginTL.cy + rectParent.Height() * layout.sizeTypeTL.cy / 100;
+
+ // calculate new bottom-right corner
+ rectNew.right = layout.sizeMarginBR.cx + rectParent.Width() * layout.sizeTypeBR.cx / 100;
+ rectNew.bottom = layout.sizeMarginBR.cy + rectParent.Height() * layout.sizeTypeBR.cy / 100;
+
+ // adjust position, if client area has been scrolled
+ rectNew.OffsetRect(rectParent.TopLeft());
+
+ // get the refresh property
+ BOOL bRefresh = layout.properties.bAskRefresh ?
+ NeedsRefresh(layout, rectChild, rectNew) : layout.properties.bCachedNeedsRefresh;
+
+ // set flags
+ uFlags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREPOSITION;
+ if (bRefresh)
+ uFlags |= SWP_NOCOPYBITS;
+ if (rectNew.TopLeft() == rectChild.TopLeft())
+ uFlags |= SWP_NOMOVE;
+ if (rectNew.Size() == rectChild.Size())
+ uFlags |= SWP_NOSIZE;
+
+ // update rect
+ rectChild = rectNew;
+}
+
+void CResizableLayout::InitResizeProperties(CResizableLayout::LayoutInfo &layout)
+{
+ // check if custom window supports this library
+ // (properties must be correctly set by the window)
+ layout.bMsgSupport = Send_QueryProperties(layout.hWnd, &layout.properties);
+
+ // default properties
+ if (!layout.bMsgSupport)
+ {
+ // clipping property is assumed as static
+ layout.properties.bAskClipping = FALSE;
+ layout.properties.bCachedLikesClipping = LikesClipping(layout);
+ // refresh property is assumed as dynamic
+ layout.properties.bAskRefresh = TRUE;
+ }
+}
diff --git a/src/thirdparty/ResizableLib/ResizableLayout.h b/src/thirdparty/ResizableLib/ResizableLayout.h
new file mode 100644
index 000000000..433e1e627
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableLayout.h
@@ -0,0 +1,196 @@
+// ResizableLayout.h: interface for the CResizableLayout class.
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_RESIZABLELAYOUT_H__INCLUDED_)
+#define AFX_RESIZABLELAYOUT_H__INCLUDED_
+
+#include <afxtempl.h>
+#include "ResizableMsgSupport.h"
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+// useful compatibility constants (the only one required is NOANCHOR)
+
+const CSize NOANCHOR(-1,-1),
+ TOP_LEFT(0,0), TOP_CENTER(50,0), TOP_RIGHT(100,0),
+ MIDDLE_LEFT(0,50), MIDDLE_CENTER(50,50), MIDDLE_RIGHT(100,50),
+ BOTTOM_LEFT(0,100), BOTTOM_CENTER(50,100), BOTTOM_RIGHT(100,100);
+
+
+class CResizableLayout
+{
+protected:
+ class LayoutInfo
+ {
+ public:
+ HWND hWnd;
+ UINT nCallbackID;
+
+ CString sWndClass;
+
+ // upper-left corner
+ SIZE sizeTypeTL;
+ SIZE sizeMarginTL;
+
+ // bottom-right corner
+ SIZE sizeTypeBR;
+ SIZE sizeMarginBR;
+
+ // custom window support
+ BOOL bMsgSupport;
+ RESIZEPROPERTIES properties;
+
+ public:
+ LayoutInfo() : hWnd(NULL), nCallbackID(0), bMsgSupport(FALSE)
+ {
+ sizeTypeTL.cx = 0;
+ sizeTypeTL.cy = 0;
+ sizeMarginTL.cx = 0;
+ sizeMarginTL.cy = 0;
+ sizeTypeBR.cx = 0;
+ sizeTypeBR.cy = 0;
+ sizeMarginBR.cx = 0;
+ sizeMarginBR.cy = 0;
+ memset(&properties, 0, sizeof properties);
+ }
+
+ LayoutInfo(HWND hwnd, SIZE tl_t, SIZE tl_m,
+ SIZE br_t, SIZE br_m, CString classname)
+ : hWnd(hwnd), nCallbackID(0),
+ sWndClass(classname), bMsgSupport(FALSE),
+ sizeTypeTL(tl_t), sizeMarginTL(tl_m),
+ sizeTypeBR(br_t), sizeMarginBR(br_m)
+ {
+ memset(&properties, 0, sizeof properties);
+ }
+ };
+
+private:
+ // list of repositionable controls
+ CMap<HWND, HWND, POSITION, POSITION> m_mapLayout;
+ CList<LayoutInfo, LayoutInfo&> m_listLayout;
+ CList<LayoutInfo, LayoutInfo&> m_listLayoutCB;
+
+ void ClipChildWindow(const CResizableLayout::LayoutInfo &layout, CRgn* pRegion);
+
+ void CalcNewChildPosition(const CResizableLayout::LayoutInfo &layout,
+ const CRect &rectParent, CRect &rectChild, UINT& uFlags);
+
+protected:
+ // override to initialize resize properties (clipping, refresh)
+ virtual void InitResizeProperties(CResizableLayout::LayoutInfo& layout);
+
+ // override to specify clipping for unsupported windows
+ virtual BOOL LikesClipping(const CResizableLayout::LayoutInfo &layout);
+
+ // override to specify refresh for unsupported windows
+ virtual BOOL NeedsRefresh(const CResizableLayout::LayoutInfo &layout,
+ const CRect &rectOld, const CRect &rectNew);
+
+ // paint the background on the given DC (for XP theme's compatibility)
+ void EraseBackground(CDC* pDC);
+
+ // clip out child windows from the given DC (support old code)
+ void ClipChildren(CDC* pDC);
+
+ // get the clipping region (without clipped child windows)
+ void GetClippingRegion(CRgn* pRegion);
+
+ // override for scrollable or expanding parent windows
+ virtual void GetTotalClientRect(LPRECT lpRect);
+
+ // add anchors to a control, given its HWND
+ void AddAnchor(HWND hWnd, CSize sizeTypeTL, CSize sizeTypeBR = NOANCHOR);
+
+ // add anchors to a control, given its ID
+ void AddAnchor(UINT nID, CSize sizeTypeTL, CSize sizeTypeBR = NOANCHOR)
+ {
+ AddAnchor(::GetDlgItem(GetResizableWnd()->GetSafeHwnd(), nID),
+ sizeTypeTL, sizeTypeBR);
+ }
+
+ // add a callback (control ID or HWND is unknown or may change)
+ void AddAnchorCallback(UINT nCallbackID);
+
+ // get rect of an anchored window, given the parent's client area
+ BOOL GetAnchorPosition(HWND hWnd, const CRect &rectParent,
+ CRect &rectChild, UINT* lpFlags = NULL)
+ {
+ POSITION pos;
+ if (!m_mapLayout.Lookup(hWnd, pos))
+ return FALSE;
+
+ UINT uTmpFlags = 0;
+ CalcNewChildPosition(m_listLayout.GetAt(pos), rectParent, rectChild,
+ (lpFlags != NULL) ? (*lpFlags) : uTmpFlags);
+ return TRUE;
+ }
+
+ // get rect of an anchored window, given the parent's client area
+ BOOL GetAnchorPosition(UINT nID, const CRect &rectParent,
+ CRect &rectChild, UINT* lpFlags = NULL)
+ {
+ return GetAnchorPosition(::GetDlgItem(GetResizableWnd()->GetSafeHwnd(), nID),
+ rectParent, rectChild, lpFlags);
+ }
+
+ // remove an anchored control from the layout, given its HWND
+ BOOL RemoveAnchor(HWND hWnd)
+ {
+ POSITION pos;
+ if (!m_mapLayout.Lookup(hWnd, pos))
+ return FALSE;
+
+ m_listLayout.RemoveAt(pos);
+ return m_mapLayout.RemoveKey(hWnd);
+ }
+
+ // remove an anchored control from the layout, given its HWND
+ BOOL RemoveAnchor(UINT nID)
+ {
+ return RemoveAnchor(::GetDlgItem(GetResizableWnd()->GetSafeHwnd(), nID));
+ }
+
+ // reset layout content
+ void RemoveAllAnchors()
+ {
+ m_mapLayout.RemoveAll();
+ m_listLayout.RemoveAll();
+ m_listLayoutCB.RemoveAll();
+ }
+
+ // adjust children's layout, when parent's size changes
+ void ArrangeLayout();
+
+ // override to provide dynamic control's layout info
+ virtual BOOL ArrangeLayoutCallback(CResizableLayout::LayoutInfo& layout);
+
+ // override to provide the parent window
+ virtual CWnd* GetResizableWnd() = 0;
+
+public:
+ CResizableLayout() { }
+
+ virtual ~CResizableLayout()
+ {
+ // just for safety
+ RemoveAllAnchors();
+ }
+};
+
+#endif // !defined(AFX_RESIZABLELAYOUT_H__INCLUDED_)
diff --git a/src/thirdparty/ResizableLib/ResizableLib.vcxproj b/src/thirdparty/ResizableLib/ResizableLib.vcxproj
new file mode 100644
index 000000000..1c5304574
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableLib.vcxproj
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}</ProjectGuid>
+ <RootNamespace>ResizableLib</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="..\..\common.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="..\..\common.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="..\..\common.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="..\..\common.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <EnablePREfast>false</EnablePREfast>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <EnablePREfast>false</EnablePREfast>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4244</DisableSpecificWarnings>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="ResizableDialog.cpp" />
+ <ClCompile Include="ResizableGrip.cpp" />
+ <ClCompile Include="ResizableLayout.cpp" />
+ <ClCompile Include="ResizableMinMax.cpp" />
+ <ClCompile Include="ResizablePage.cpp" />
+ <ClCompile Include="ResizableSheet.cpp" />
+ <ClCompile Include="ResizableState.cpp" />
+ <ClCompile Include="stdafx.cpp">
+ <PrecompiledHeader>Create</PrecompiledHeader>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="ResizableDialog.h" />
+ <ClInclude Include="ResizableGrip.h" />
+ <ClInclude Include="ResizableLayout.h" />
+ <ClInclude Include="ResizableMinMax.h" />
+ <ClInclude Include="ResizableMsgSupport.h" />
+ <ClInclude Include="ResizablePage.h" />
+ <ClInclude Include="ResizableSheet.h" />
+ <ClInclude Include="ResizableState.h" />
+ <ClInclude Include="stdafx.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="ResizableMsgSupport.inl" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/thirdparty/ResizableLib/ResizableLib.vcxproj.filters b/src/thirdparty/ResizableLib/ResizableLib.vcxproj.filters
new file mode 100644
index 000000000..53f8a1d66
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableLib.vcxproj.filters
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="ResizableDialog.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ResizableGrip.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ResizableLayout.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ResizableMinMax.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ResizablePage.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ResizableSheet.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ResizableState.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="stdafx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="ResizableDialog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ResizableGrip.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ResizableLayout.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ResizableMinMax.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ResizableMsgSupport.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ResizablePage.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ResizableSheet.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ResizableState.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="stdafx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="ResizableMsgSupport.inl">
+ <Filter>Header Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/src/thirdparty/ResizableLib/ResizableMinMax.cpp b/src/thirdparty/ResizableLib/ResizableMinMax.cpp
new file mode 100644
index 000000000..0a19f3002
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableMinMax.cpp
@@ -0,0 +1,89 @@
+// ResizableMinMax.cpp: implementation of the CResizableMinMax class.
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "ResizableMinMax.h"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CResizableMinMax::CResizableMinMax()
+{
+ m_bUseMinTrack = FALSE;
+ m_bUseMaxTrack = FALSE;
+ m_bUseMaxRect = FALSE;
+}
+
+CResizableMinMax::~CResizableMinMax()
+{
+
+}
+
+void CResizableMinMax::MinMaxInfo(LPMINMAXINFO lpMMI)
+{
+ if (m_bUseMinTrack)
+ lpMMI->ptMinTrackSize = m_ptMinTrackSize;
+
+ if (m_bUseMaxTrack)
+ lpMMI->ptMaxTrackSize = m_ptMaxTrackSize;
+
+ if (m_bUseMaxRect)
+ {
+ lpMMI->ptMaxPosition = m_ptMaxPos;
+ lpMMI->ptMaxSize = m_ptMaxSize;
+ }
+}
+
+void CResizableMinMax::SetMaximizedRect(const CRect& rc)
+{
+ m_bUseMaxRect = TRUE;
+
+ m_ptMaxPos = rc.TopLeft();
+ m_ptMaxSize.x = rc.Width();
+ m_ptMaxSize.y = rc.Height();
+}
+
+void CResizableMinMax::ResetMaximizedRect()
+{
+ m_bUseMaxRect = FALSE;
+}
+
+void CResizableMinMax::SetMinTrackSize(const CSize& size)
+{
+ m_bUseMinTrack = TRUE;
+
+ m_ptMinTrackSize.x = size.cx;
+ m_ptMinTrackSize.y = size.cy;
+}
+
+void CResizableMinMax::ResetMinTrackSize()
+{
+ m_bUseMinTrack = FALSE;
+}
+
+void CResizableMinMax::SetMaxTrackSize(const CSize& size)
+{
+ m_bUseMaxTrack = TRUE;
+
+ m_ptMaxTrackSize.x = size.cx;
+ m_ptMaxTrackSize.y = size.cy;
+}
+
+void CResizableMinMax::ResetMaxTrackSize()
+{
+ m_bUseMaxTrack = FALSE;
+}
diff --git a/src/thirdparty/ResizableLib/ResizableMinMax.h b/src/thirdparty/ResizableLib/ResizableMinMax.h
new file mode 100644
index 000000000..557780323
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableMinMax.h
@@ -0,0 +1,53 @@
+// ResizableMinMax.h: interface for the CResizableMinMax class.
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_RESIZABLEMINMAX_H__INCLUDED_)
+#define AFX_RESIZABLEMINMAX_H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+class CResizableMinMax
+{
+// Attributes
+private:
+ // flags
+ BOOL m_bUseMaxTrack;
+ BOOL m_bUseMinTrack;
+ BOOL m_bUseMaxRect;
+
+ POINT m_ptMinTrackSize; // min tracking size
+ POINT m_ptMaxTrackSize; // max tracking size
+ POINT m_ptMaxPos; // maximized position
+ POINT m_ptMaxSize; // maximized size
+
+public:
+ CResizableMinMax();
+ virtual ~CResizableMinMax();
+
+protected:
+ void MinMaxInfo(LPMINMAXINFO lpMMI);
+
+ void SetMaximizedRect(const CRect& rc); // set window rect when maximized
+ void ResetMaximizedRect(); // reset to default maximized rect
+ void SetMinTrackSize(const CSize& size); // set minimum tracking size
+ void ResetMinTrackSize(); // reset to default minimum tracking size
+ void SetMaxTrackSize(const CSize& size); // set maximum tracking size
+ void ResetMaxTrackSize(); // reset to default maximum tracking size
+};
+
+#endif // !defined(AFX_RESIZABLEMINMAX_H__INCLUDED_)
diff --git a/src/thirdparty/ResizableLib/ResizableMsgSupport.h b/src/thirdparty/ResizableLib/ResizableMsgSupport.h
new file mode 100644
index 000000000..68d45fe9f
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableMsgSupport.h
@@ -0,0 +1,61 @@
+// ResizableMsgSupport.h: some declarations to support custom resizable wnds
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_)
+#define AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+typedef struct tagRESIZEPROPERTIES
+{
+ // wether to ask for resizing properties every time
+ BOOL bAskClipping;
+ BOOL bAskRefresh;
+ // otherwise, use the cached properties
+ BOOL bCachedLikesClipping;
+ BOOL bCachedNeedsRefresh;
+
+ // initialize with valid data
+ tagRESIZEPROPERTIES() : bAskClipping(TRUE), bAskRefresh(TRUE) {}
+
+} RESIZEPROPERTIES, *PRESIZEPROPERTIES, *LPRESIZEPROPERTIES;
+
+
+typedef struct tagCLIPPINGPROPERTY
+{
+ BOOL bLikesClipping;
+
+ // initialize with valid data
+ tagCLIPPINGPROPERTY() : bLikesClipping(FALSE) {}
+
+} CLIPPINGPROPERTY, *PCLIPPINGPROPERTY, *LPCLIPPINGPROPERTY;
+
+
+typedef struct tagREFRESHPROPERTY
+{
+ BOOL bNeedsRefresh;
+ RECT rcOld;
+ RECT rcNew;
+
+ // initialize with valid data
+ tagREFRESHPROPERTY() : bNeedsRefresh(TRUE) {}
+
+} REFRESHPROPERTY, *PREFRESHPROPERTY, *LPREFRESHPROPERTY;
+
+
+#endif // !defined(AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_)
diff --git a/src/thirdparty/ResizableLib/ResizableMsgSupport.inl b/src/thirdparty/ResizableLib/ResizableMsgSupport.inl
new file mode 100644
index 000000000..f8f3b41e8
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableMsgSupport.inl
@@ -0,0 +1,56 @@
+// ResizableMsgSupport.inl: some definitions to support custom resizable wnds
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+
+// registered message to communicate with the library
+// (defined so that in the same executable it is initialized only once)
+const UINT WMU_RESIZESUPPORT = ::RegisterWindowMessage(_T("WMU_RESIZESUPPORT"));
+
+// if the message is implemented the returned value must be non-zero
+// the default window procedure returns zero for unhandled messages
+
+// wParam is one of the following RSZSUP_* values, lParam as specified
+
+#define RSZSUP_QUERYPROPERTIES 101 // lParam = LPRESIZEPROPERTIES
+
+#define RSZSUP_LIKESCLIPPING 102 // lParam = LPCLIPPINGPROPERTY
+
+#define RSZSUP_NEEDSREFRESH 103 // lParam = LPREFRESHPROPERTY
+
+
+/////////////////////////////////////////////////////////////////////////////
+// utility functions
+
+inline BOOL Send_QueryProperties(HWND hWnd, LPRESIZEPROPERTIES pResizeProperties)
+{
+ ASSERT(::IsWindow(hWnd));
+ return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
+ RSZSUP_QUERYPROPERTIES, (LPARAM)pResizeProperties));
+}
+
+inline BOOL Send_LikesClipping(HWND hWnd, LPCLIPPINGPROPERTY pClippingProperty)
+{
+ ASSERT(::IsWindow(hWnd));
+ return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
+ RSZSUP_LIKESCLIPPING, (LPARAM)pClippingProperty));
+}
+
+inline BOOL Send_NeedsRefresh(HWND hWnd, LPREFRESHPROPERTY pRefreshProperty)
+{
+ ASSERT(::IsWindow(hWnd));
+ return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
+ RSZSUP_NEEDSREFRESH, (LPARAM)pRefreshProperty));
+}
diff --git a/src/thirdparty/ResizableLib/ResizablePage.cpp b/src/thirdparty/ResizableLib/ResizablePage.cpp
new file mode 100644
index 000000000..06dcc6b96
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizablePage.cpp
@@ -0,0 +1,72 @@
+// ResizablePage.cpp : implementation file
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "ResizablePage.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CResizablePage
+
+IMPLEMENT_DYNCREATE(CResizablePage, CPropertyPage)
+
+CResizablePage::CResizablePage()
+{
+}
+
+CResizablePage::CResizablePage(UINT nIDTemplate, UINT nIDCaption)
+ : CPropertyPage(nIDTemplate, nIDCaption)
+{
+}
+
+CResizablePage::CResizablePage(LPCTSTR lpszTemplateName, UINT nIDCaption)
+ : CPropertyPage(lpszTemplateName, nIDCaption)
+{
+}
+
+CResizablePage::~CResizablePage()
+{
+}
+
+
+BEGIN_MESSAGE_MAP(CResizablePage, CPropertyPage)
+ //{{AFX_MSG_MAP(CResizablePage)
+ ON_WM_SIZE()
+ ON_WM_ERASEBKGND()
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CResizablePage message handlers
+
+void CResizablePage::OnSize(UINT nType, int cx, int cy)
+{
+ CWnd::OnSize(nType, cx, cy);
+
+ ArrangeLayout();
+}
+
+BOOL CResizablePage::OnEraseBkgnd(CDC* pDC)
+{
+ // Windows XP doesn't like clipping regions ...try this!
+ EraseBackground(pDC);
+ return TRUE;
+
+/* ClipChildren(pDC); // old-method (for safety)
+
+ return CPropertyPage::OnEraseBkgnd(pDC);
+*/
+}
diff --git a/src/thirdparty/ResizableLib/ResizablePage.h b/src/thirdparty/ResizableLib/ResizablePage.h
new file mode 100644
index 000000000..4c8218634
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizablePage.h
@@ -0,0 +1,78 @@
+#if !defined(AFX_RESIZABLEPAGE_H__INCLUDED_)
+#define AFX_RESIZABLEPAGE_H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+// ResizablePage.h : header file
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "ResizableLayout.h"
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CResizablePage window
+
+class CResizablePage : public CPropertyPage, public CResizableLayout
+{
+ DECLARE_DYNCREATE(CResizablePage)
+
+// Construction
+public:
+ CResizablePage();
+ CResizablePage(UINT nIDTemplate, UINT nIDCaption = 0);
+ CResizablePage(LPCTSTR lpszTemplateName, UINT nIDCaption = 0);
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CResizablePage)
+ //}}AFX_VIRTUAL
+
+// Implementation
+public:
+ virtual ~CResizablePage();
+
+// callable from derived classes
+protected:
+
+ virtual CWnd* GetResizableWnd()
+ {
+ // make the layout know its parent window
+ return this;
+ };
+
+// Generated message map functions
+protected:
+ //{{AFX_MSG(CResizablePage)
+ afx_msg void OnSize(UINT nType, int cx, int cy);
+ afx_msg BOOL OnEraseBkgnd(CDC* pDC);
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_RESIZABLEPAGE_H__INCLUDED_)
diff --git a/src/thirdparty/ResizableLib/ResizableSheet.cpp b/src/thirdparty/ResizableLib/ResizableSheet.cpp
new file mode 100644
index 000000000..29ab481bc
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableSheet.cpp
@@ -0,0 +1,349 @@
+// ResizableSheet.cpp : implementation file
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "ResizableSheet.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CResizableSheet
+
+IMPLEMENT_DYNAMIC(CResizableSheet, CPropertySheet)
+
+inline void CResizableSheet::PrivateConstruct()
+{
+ m_bEnableSaveRestore = FALSE;
+ m_bSavePage = FALSE;
+ m_dwGripTempState = 1;
+}
+
+
+CResizableSheet::CResizableSheet()
+{
+ PrivateConstruct();
+}
+
+CResizableSheet::CResizableSheet(UINT nIDCaption, CWnd *pParentWnd, UINT iSelectPage)
+ : CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
+{
+ PrivateConstruct();
+}
+
+CResizableSheet::CResizableSheet(LPCTSTR pszCaption, CWnd *pParentWnd, UINT iSelectPage)
+ : CPropertySheet(pszCaption, pParentWnd, iSelectPage)
+{
+ PrivateConstruct();
+}
+
+CResizableSheet::~CResizableSheet()
+{
+}
+
+BEGIN_MESSAGE_MAP(CResizableSheet, CPropertySheet)
+ //{{AFX_MSG_MAP(CResizableSheet)
+ ON_WM_GETMINMAXINFO()
+ ON_WM_SIZE()
+ ON_WM_DESTROY()
+ ON_WM_CREATE()
+ ON_WM_ERASEBKGND()
+ //}}AFX_MSG_MAP
+ ON_NOTIFY_REFLECT_EX(PSN_SETACTIVE, OnPageChanging)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CResizableSheet message handlers
+
+int CResizableSheet::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+ if (CPropertySheet::OnCreate(lpCreateStruct) == -1)
+ return -1;
+
+ // keep client area
+ CRect rect;
+ GetClientRect(&rect);
+ // set resizable style
+ ModifyStyle(DS_MODALFRAME, WS_POPUP | WS_THICKFRAME);
+ // adjust size to reflect new style
+ ::AdjustWindowRectEx(&rect, GetStyle(),
+ ::IsMenu(GetMenu()->GetSafeHmenu()), GetExStyle());
+ SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(), SWP_FRAMECHANGED|
+ SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREPOSITION);
+
+ // create and init the size-grip
+ if (!CreateSizeGrip())
+ return -1;
+
+ return 0;
+}
+
+BOOL CResizableSheet::OnInitDialog()
+{
+ BOOL bResult = CPropertySheet::OnInitDialog();
+
+ // set the initial size as the min track size
+ CRect rc;
+ GetWindowRect(&rc);
+ SetMinTrackSize(rc.Size());
+
+ // initialize layout
+ PresetLayout();
+
+ // prevent flickering
+ GetTabControl()->ModifyStyle(0, WS_CLIPSIBLINGS);
+
+ return bResult;
+}
+
+void CResizableSheet::OnDestroy()
+{
+ if (m_bEnableSaveRestore)
+ {
+ SaveWindowRect(m_sSection, m_bRectOnly);
+ SavePage();
+ }
+
+ RemoveAllAnchors();
+
+ CPropertySheet::OnDestroy();
+}
+
+// maps an index to a button ID and vice-versa
+static UINT _propButtons[] =
+{
+ IDOK, IDCANCEL, ID_APPLY_NOW, IDHELP,
+ ID_WIZBACK, ID_WIZNEXT, ID_WIZFINISH
+};
+const int _propButtonsCount = _countof(_propButtons);
+
+// horizontal line in wizard mode
+#define ID_WIZLINE ID_WIZFINISH+1
+
+void CResizableSheet::PresetLayout()
+{
+ if (IsWizard()) // wizard mode
+ {
+ // hide tab control
+ GetTabControl()->ShowWindow(SW_HIDE);
+
+ AddAnchor(ID_WIZLINE, BOTTOM_LEFT, BOTTOM_RIGHT);
+ }
+ else // tab mode
+ {
+ AddAnchor(AFX_IDC_TAB_CONTROL, TOP_LEFT, BOTTOM_RIGHT);
+ }
+
+ // add a callback for active page (which can change at run-time)
+ AddAnchorCallback(1);
+
+ // use *total* parent size to have correct margins
+ CRect rectPage, rectSheet;
+ GetTotalClientRect(&rectSheet);
+
+ GetActivePage()->GetWindowRect(&rectPage);
+ ::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rectPage, 2);
+
+ // pre-calculate margins
+ m_sizePageTL = rectPage.TopLeft() - rectSheet.TopLeft();
+ m_sizePageBR = rectPage.BottomRight() - rectSheet.BottomRight();
+
+ // add all possible buttons, if they exist
+ for (int i = 0; i < _propButtonsCount; i++)
+ {
+ if (NULL != GetDlgItem(_propButtons[i]))
+ AddAnchor(_propButtons[i], BOTTOM_RIGHT);
+ }
+}
+
+BOOL CResizableSheet::ArrangeLayoutCallback(LayoutInfo &layout)
+{
+ if (layout.nCallbackID != 1) // we only added 1 callback
+ return CResizableLayout::ArrangeLayoutCallback(layout);
+
+ // set layout info for active page
+ layout.hWnd = (HWND)::SendMessage(m_hWnd, PSM_GETCURRENTPAGEHWND, 0, 0);
+ if (!::IsWindow(layout.hWnd))
+ return FALSE;
+
+ // set margins
+ if (IsWizard()) // wizard mode
+ {
+ // use pre-calculated margins
+ layout.sizeMarginTL = m_sizePageTL;
+ layout.sizeMarginBR = m_sizePageBR;
+ }
+ else // tab mode
+ {
+ CTabCtrl* pTab = GetTabControl();
+ ASSERT(pTab != NULL);
+
+ // get tab position after resizing and calc page rect
+ CRect rectPage, rectSheet;
+ GetTotalClientRect(&rectSheet);
+
+ VERIFY(GetAnchorPosition(pTab->m_hWnd, rectSheet, rectPage));
+ pTab->AdjustRect(FALSE, &rectPage);
+
+ // set margins
+ layout.sizeMarginTL = rectPage.TopLeft() - rectSheet.TopLeft();
+ layout.sizeMarginBR = rectPage.BottomRight() - rectSheet.BottomRight();
+ }
+
+ // set anchor types
+ layout.sizeTypeTL = TOP_LEFT;
+ layout.sizeTypeBR = BOTTOM_RIGHT;
+
+ // use this layout info
+ return TRUE;
+}
+
+void CResizableSheet::OnSize(UINT nType, int cx, int cy)
+{
+ CWnd::OnSize(nType, cx, cy);
+
+ if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW)
+ return; // arrangement not needed
+
+ if (nType == SIZE_MAXIMIZED)
+ HideSizeGrip(&m_dwGripTempState);
+ else
+ ShowSizeGrip(&m_dwGripTempState);
+
+ // update grip and layout
+ UpdateSizeGrip();
+ ArrangeLayout();
+}
+
+BOOL CResizableSheet::OnPageChanging(NMHDR* /*pNotifyStruct*/, LRESULT* /*pResult*/)
+{
+ // update new wizard page
+ // active page changes after this notification
+ PostMessage(WM_SIZE);
+
+ return FALSE; // continue routing
+}
+
+BOOL CResizableSheet::OnEraseBkgnd(CDC* pDC)
+{
+ // Windows XP doesn't like clipping regions ...try this!
+ EraseBackground(pDC);
+ return TRUE;
+
+/* ClipChildren(pDC); // old-method (for safety)
+
+ return CPropertySheet::OnEraseBkgnd(pDC);
+*/
+}
+
+void CResizableSheet::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
+{
+ MinMaxInfo(lpMMI);
+}
+
+// protected members
+
+int CResizableSheet::GetMinWidth()
+{
+ CWnd* pWnd = NULL;
+ CRect rectWnd, rectSheet;
+ GetTotalClientRect(&rectSheet);
+
+ int max = 0, min = rectSheet.Width();
+ // search for leftmost and rightmost button margins
+ for (int i = 0; i < 7; i++)
+ {
+ pWnd = GetDlgItem(_propButtons[i]);
+ // exclude not present or hidden buttons
+ if (pWnd == NULL || !(pWnd->GetStyle() & WS_VISIBLE))
+ continue;
+
+ // left position is relative to the right border
+ // of the parent window (negative value)
+ pWnd->GetWindowRect(&rectWnd);
+ ::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rectWnd, 2);
+ int left = rectSheet.right - rectWnd.left;
+ int right = rectSheet.right - rectWnd.right;
+
+ if (left > max)
+ max = left;
+ if (right < min)
+ min = right;
+ }
+
+ // sizing border width
+ int border = GetSystemMetrics(SM_CXSIZEFRAME);
+
+ // compute total width
+ return max + min + 2*border;
+}
+
+
+// NOTE: this must be called after all the other settings
+// to have the window and its controls displayed properly
+void CResizableSheet::EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly, BOOL bWithPage)
+{
+ m_sSection = pszSection;
+ m_bSavePage = bWithPage;
+
+ m_bEnableSaveRestore = TRUE;
+ m_bRectOnly = bRectOnly;
+
+ // restore immediately
+ LoadWindowRect(pszSection, bRectOnly);
+ LoadPage();
+}
+
+// private memebers
+
+// used to save/restore active page
+// either in the registry or a private .INI file
+// depending on your application settings
+
+#define ACTIVEPAGE _T("ActivePage")
+
+void CResizableSheet::SavePage()
+{
+ if (!m_bSavePage)
+ return;
+
+ // saves active page index, zero (the first) if problems
+ // cannot use GetActivePage, because it always fails
+
+ CTabCtrl *pTab = GetTabControl();
+ int page = 0;
+
+ if (pTab != NULL)
+ page = pTab->GetCurSel();
+ if (page < 0)
+ page = 0;
+
+ AfxGetApp()->WriteProfileInt(m_sSection, ACTIVEPAGE, page);
+}
+
+void CResizableSheet::LoadPage()
+{
+ // restore active page, zero (the first) if not found
+ int page = AfxGetApp()->GetProfileInt(m_sSection, ACTIVEPAGE, 0);
+
+ if (m_bSavePage)
+ {
+ SetActivePage(page);
+ ArrangeLayout(); // needs refresh
+ }
+}
+
+void CResizableSheet::RefreshLayout()
+{
+ SendMessage(WM_SIZE);
+}
diff --git a/src/thirdparty/ResizableLib/ResizableSheet.h b/src/thirdparty/ResizableLib/ResizableSheet.h
new file mode 100644
index 000000000..c82a63798
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableSheet.h
@@ -0,0 +1,114 @@
+#if !defined(AFX_RESIZABLESHEET_H__INCLUDED_)
+#define AFX_RESIZABLESHEET_H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "ResizableLayout.h"
+#include "ResizableGrip.h"
+#include "ResizableMinMax.h"
+#include "ResizableState.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// ResizableSheet.h : header file
+//
+
+class CResizableSheet : public CPropertySheet, public CResizableLayout,
+ public CResizableGrip, public CResizableMinMax,
+ public CResizableState
+{
+ DECLARE_DYNAMIC(CResizableSheet)
+
+// Construction
+public:
+ CResizableSheet();
+ CResizableSheet(UINT nIDCaption, CWnd *pParentWnd = NULL, UINT iSelectPage = 0);
+ CResizableSheet(LPCTSTR pszCaption, CWnd *pParentWnd = NULL, UINT iSelectPage = 0);
+
+// Attributes
+private:
+ // support for temporarily hiding the grip
+ DWORD m_dwGripTempState;
+
+ // flags
+ BOOL m_bEnableSaveRestore;
+ BOOL m_bRectOnly;
+ BOOL m_bSavePage;
+
+ // layout vars
+ CSize m_sizePageTL, m_sizePageBR;
+
+ // internal status
+ CString m_sSection; // section name (identifies a parent window)
+
+// Operations
+public:
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CResizableSheet)
+ public:
+ virtual BOOL OnInitDialog();
+ //}}AFX_VIRTUAL
+ protected:
+
+// Implementation
+public:
+ void RefreshLayout();
+ virtual ~CResizableSheet();
+
+// used internally
+private:
+ void PresetLayout();
+ void PrivateConstruct();
+ void SavePage();
+ void LoadPage();
+
+ BOOL IsWizard() { return (m_psh.dwFlags & PSH_WIZARD); }
+
+// callable from derived classes
+protected:
+ // section to use in app's profile
+ void EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly = FALSE,
+ BOOL bWithPage = FALSE);
+ int GetMinWidth(); // minimum width to display all buttons
+
+
+ virtual CWnd* GetResizableWnd()
+ {
+ // make the layout know its parent window
+ return this;
+ };
+
+// Generated message map functions
+protected:
+ virtual BOOL ArrangeLayoutCallback(LayoutInfo& layout);
+ //{{AFX_MSG(CResizableSheet)
+ afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
+ afx_msg void OnSize(UINT nType, int cx, int cy);
+ afx_msg void OnDestroy();
+ afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+ afx_msg BOOL OnEraseBkgnd(CDC* pDC);
+ //}}AFX_MSG
+ afx_msg BOOL OnPageChanging(NMHDR* pNotifyStruct, LRESULT* pResult);
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+#endif // AFX_RESIZABLESHEET_H__INCLUDED_
diff --git a/src/thirdparty/ResizableLib/ResizableState.cpp b/src/thirdparty/ResizableLib/ResizableState.cpp
new file mode 100644
index 000000000..8dae2e3d8
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableState.cpp
@@ -0,0 +1,105 @@
+// ResizableState.cpp: implementation of the CResizableState class.
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "ResizableState.h"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CResizableState::CResizableState()
+{
+
+}
+
+CResizableState::~CResizableState()
+{
+
+}
+
+
+// used to save/restore window's size and position
+// either in the registry or a private .INI file
+// depending on your application settings
+
+#define PLACEMENT_ENT _T("WindowPlacement")
+#define PLACEMENT_FMT _T("%d,%d,%d,%d,%d,%d")
+
+BOOL CResizableState::SaveWindowRect(LPCTSTR pszSection, BOOL bRectOnly)
+{
+ CString data;
+ WINDOWPLACEMENT wp;
+
+ ZeroMemory(&wp, sizeof(WINDOWPLACEMENT));
+ wp.length = sizeof(WINDOWPLACEMENT);
+ if (!GetResizableWnd()->GetWindowPlacement(&wp))
+ return FALSE;
+
+ RECT& rc = wp.rcNormalPosition; // alias
+
+ if (bRectOnly) // save size/pos only (normal state)
+ {
+ // use screen coordinates
+ GetResizableWnd()->GetWindowRect(&rc);
+
+ data.Format(PLACEMENT_FMT, rc.left, rc.top,
+ rc.right, rc.bottom, SW_NORMAL, 0);
+ }
+ else // save also min/max state
+ {
+ // use workspace coordinates
+ data.Format(PLACEMENT_FMT, rc.left, rc.top,
+ rc.right, rc.bottom, wp.showCmd, wp.flags);
+ }
+
+ return AfxGetApp()->WriteProfileString(pszSection, PLACEMENT_ENT, data);
+}
+
+BOOL CResizableState::LoadWindowRect(LPCTSTR pszSection, BOOL bRectOnly)
+{
+ CString data;
+ WINDOWPLACEMENT wp;
+
+ data = AfxGetApp()->GetProfileString(pszSection, PLACEMENT_ENT);
+
+ if (data.IsEmpty()) // never saved before
+ return FALSE;
+
+ ZeroMemory(&wp, sizeof(WINDOWPLACEMENT));
+ wp.length = sizeof(WINDOWPLACEMENT);
+ if (!GetResizableWnd()->GetWindowPlacement(&wp))
+ return FALSE;
+
+ RECT& rc = wp.rcNormalPosition; // alias
+
+ if (_stscanf_s(data, PLACEMENT_FMT, &rc.left, &rc.top,
+ &rc.right, &rc.bottom, &wp.showCmd, &wp.flags) == 6)
+ {
+ if (bRectOnly) // restore size/pos only
+ {
+ CRect rect(rc);
+ return GetResizableWnd()->SetWindowPos(NULL, rect.left, rect.top,
+ rect.Width(), rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER |
+ SWP_NOREPOSITION);
+ }
+ else // restore also min/max state
+ {
+ return GetResizableWnd()->SetWindowPlacement(&wp);
+ }
+ }
+ return FALSE;
+}
diff --git a/src/thirdparty/ResizableLib/ResizableState.h b/src/thirdparty/ResizableLib/ResizableState.h
new file mode 100644
index 000000000..1e5e7c35f
--- /dev/null
+++ b/src/thirdparty/ResizableLib/ResizableState.h
@@ -0,0 +1,38 @@
+// ResizableState.h: interface for the CResizableState class.
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2000-2002 by Paolo Messina
+// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
+//
+// The contents of this file are subject to the Artistic License (the "License").
+// You may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// http://www.opensource.org/licenses/artistic-license.html
+//
+// If you find this code useful, credits would be nice!
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_RESIZABLESTATE_H__INCLUDED_)
+#define AFX_RESIZABLESTATE_H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+class CResizableState
+{
+protected:
+ // non-zero if successful
+ BOOL LoadWindowRect(LPCTSTR pszSection, BOOL bRectOnly);
+ BOOL SaveWindowRect(LPCTSTR pszSection, BOOL bRectOnly);
+
+ virtual CWnd* GetResizableWnd() = 0;
+
+public:
+ CResizableState();
+ virtual ~CResizableState();
+};
+
+#endif // !defined(AFX_RESIZABLESTATE_H__INCLUDED_)
diff --git a/src/thirdparty/ResizableLib/stdafx.cpp b/src/thirdparty/ResizableLib/stdafx.cpp
new file mode 100644
index 000000000..c842969fa
--- /dev/null
+++ b/src/thirdparty/ResizableLib/stdafx.cpp
@@ -0,0 +1,24 @@
+/*
+ * $Id$
+ *
+ * (C) 2003-2006 Gabest
+ * (C) 2006-2012 see Authors.txt
+ *
+ * This file is part of MPC-HC.
+ *
+ * MPC-HC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * MPC-HC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "stdafx.h"
diff --git a/src/thirdparty/ResizableLib/stdafx.h b/src/thirdparty/ResizableLib/stdafx.h
new file mode 100644
index 000000000..6a859ed68
--- /dev/null
+++ b/src/thirdparty/ResizableLib/stdafx.h
@@ -0,0 +1,40 @@
+/*
+ * $Id$
+ *
+ * (C) 2003-2006 Gabest
+ * (C) 2006-2012 see Authors.txt
+ *
+ * This file is part of MPC-HC.
+ *
+ * MPC-HC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * MPC-HC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#pragma once
+
+#include "../../DSUtil/SharedInclude.h"
+
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#endif
+#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
+
+#ifndef VC_EXTRALEAN
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+#endif
+
+#include <afx.h>
+#include <afxwin.h> // MFC core and standard components
+#include <afxcmn.h>
+#include <afxdlgs.h>