From e5fa774d622d6852fe8e1f033045aed221649108 Mon Sep 17 00:00:00 2001
From: LYW <leeyeanwoo@diteam.co.kr>
Date: 금, 15 10월 2021 13:24:54 +0900
Subject: [PATCH] Ongoing80 #3662 CF AOI Review 전설비 알람 발생 조치

---
 ReviewHistory/ReveiwHistory/akWndArrange.cpp |   98 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/ReviewHistory/ReveiwHistory/akWndArrange.cpp b/ReviewHistory/ReveiwHistory/akWndArrange.cpp
new file mode 100644
index 0000000..3593aa8
--- /dev/null
+++ b/ReviewHistory/ReveiwHistory/akWndArrange.cpp
@@ -0,0 +1,98 @@
+#include "StdAfx.h"
+#include "akWndArrange.h"
+
+
+CakWndArrange::CakWndArrange(void)
+{
+	m_pWndParent = NULL;
+	m_rectOriginal.SetRect(0,0,0,0);
+}
+
+
+CakWndArrange::~CakWndArrange(void)
+{
+	clear();
+}
+
+void CakWndArrange::clear()
+{
+	m_vecWndChild.clear();
+}
+
+void CakWndArrange::setParentWnd( CWnd* pWnd )
+{
+	m_pWndParent = pWnd;
+	pWnd->GetClientRect(m_rectOriginal);
+}
+
+void CakWndArrange::addChildWnd( CWnd* pWnd, int nStyle )
+{
+	
+	_WndData data;
+	data.nStyle = nStyle;
+	data.hWnd = pWnd->GetSafeHwnd();
+
+	pWnd->GetWindowRect(&data.rectOrginal);
+	m_pWndParent->ScreenToClient(&data.rectOrginal);
+
+	m_vecWndChild.push_back(data);
+}
+
+void CakWndArrange::setChildStyle( CWnd* pWnd, int nStyle )
+{
+	HWND hWnd = pWnd->GetSafeHwnd();
+	for(int i=0; i<m_vecWndChild.size(); i++)
+	{
+		if(m_vecWndChild[i].hWnd == hWnd)
+		{
+			m_vecWndChild[i].nStyle = nStyle;
+		}
+	}
+}
+
+void CakWndArrange::process( int nWidth, int nHeight )
+{
+	if(nWidth*nHeight <= 0) return;
+	int nSize = m_vecWndChild.size();
+
+	_WndData WndChild;
+	CRect rectParentOrg = m_rectOriginal;
+	CRect rectNew;
+	for(int i=0; i<nSize; i++)
+	{
+		WndChild = m_vecWndChild[i];
+		
+		rectNew = WndChild.rectOrginal;
+		if(WA_RIGHTTOP & WndChild.nStyle)
+		{
+			rectNew.left = nWidth - ((rectParentOrg.right)-WndChild.rectOrginal.left);
+			rectNew.right = rectNew.left + WndChild.rectOrginal.Width();
+		}
+		else if(WA_LEFTBOTTOM & WndChild.nStyle)
+		{
+			rectNew.top = nHeight - ((rectParentOrg.bottom)-WndChild.rectOrginal.top);
+			rectNew.bottom = rectNew.top + WndChild.rectOrginal.Height();
+		}
+		else if(WA_RIGHTBOTTOM & WndChild.nStyle)
+		{
+			rectNew.left = nWidth - ((rectParentOrg.right)-WndChild.rectOrginal.left);
+			rectNew.right = rectNew.left + WndChild.rectOrginal.Width();
+		}
+		else if(WA_LEFTTOP & WndChild.nStyle)
+		{
+
+		}
+
+		if(WA_RESIZE_WIDTH & WndChild.nStyle)
+		{
+			rectNew.right += (nWidth-rectParentOrg.Width());
+		}
+		if(WA_RESIZE_HEIGHT & WndChild.nStyle)
+		{
+			rectNew.bottom += (nHeight-rectParentOrg.Height());
+		}
+		
+		MoveWindow(WndChild.hWnd, rectNew.left, rectNew.top, rectNew.Width(), rectNew.Height(), TRUE);
+	}
+
+}

--
Gitblit v1.9.3