亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? controlpos.cpp

?? 人事管理系統 (包括論文、SQL腳本) 語言:C++、Sqlserver2
?? CPP
字號:
//------------------------------------------------------------------------------
// ControlPos.cpp
// 
//	CControlPos 
//	Position controls on a form's resize 
// 
//		Copyright (c) 2000 Paul Wendt
// 
//		VERSION#	DATE			NAME	DESCRIPTION OF CHANGE
//		--------	----------	----	---------------------
//		1.01  	07/11/2000	PRW	Original creation.
// 
#include "StdAfx.h"
#include "ControlPos.h"

//------------------------------------------------------------------------------
// CControlPos::CControlPos
// 
//	default constructor 
// 
//	Access: public
// 
//	Args:
//		CWnd* pParent				=	pointer to parent window
// 
//	Return:
//		none
// 
CControlPos::CControlPos(CWnd* pParent /* = NULL */)
{
	m_pParent = pParent;
	UpdateParentSize();

	m_nOldParentHeight = 0;
	m_nOldParentWidth = 0;
	
	SetNegativeMoves(FALSE);

	ResetControls();
}

//------------------------------------------------------------------------------
// CControlPos::~CControlPos
// 
//	default destructor -- It deletes all controls. 
// 
//	Access: public
// 
//	Args:
//		none
// 
//	Return:
//		none
// 
CControlPos::~CControlPos()
{
	ResetControls();
}

//------------------------------------------------------------------------------
// CControlPos::SetParent
// 
//	This sets the parent window. It should be called from a CWnd's 
//    post-constructor function, like OnInitdialog or InitialUpdate. 
// 
//	Access: public
// 
//	Args:
//		CWnd* pParent	=	parent window
// 
//	Return:
//		none
// 
void CControlPos::SetParent(CWnd* pParent)
{
	CRect rcParentOriginalSize;

	m_pParent = pParent;

	m_pParent->GetClientRect(rcParentOriginalSize);
	m_nOriginalParentWidth = rcParentOriginalSize.right;
	m_nOriginalParentHeight = rcParentOriginalSize.bottom;

	UpdateParentSize();
}

//------------------------------------------------------------------------------
// CControlPos::AddControl
// 
//	This adds a control to the internal list of controls in CControlPos.  
// 
//	Access: public
// 
//	Args:
//		CWnd* pControl				=	pointer to the control to be added
//		const DWORD& dwStyle		=  how the window should be moved -- see #define's
//                               in the header file
// 
//	Return:
//		BOOL 	=	TRUE if the control was added successfully, FALSE otherwise
// 
BOOL CControlPos::AddControl(CWnd* pControl, const DWORD& dwStyle /* = CP_MOVE_H */)
{
	BOOL fReturnValue = TRUE;

	if (pControl && m_pParent)
	{
		LPCONTROLDATA pstControl = new CONTROLDATA;
		pstControl->hControl = pControl->GetSafeHwnd();
		pstControl->dwStyle = dwStyle;
		m_awndControls.Add(((CObject*)pstControl));
	}
	else
	{
		fReturnValue = FALSE;
	}

	return (fReturnValue);
}

//------------------------------------------------------------------------------
// CControlPos::AddControl
// 
//	This adds a control the internal list of controls in CControlPos. 
// 
//	Access: public
// 
//	Args:
//		const UINT& unID			=	ID of the control to add
//		const DWORD& dwStyle		=	how the window should be moved -- see #define's
//                               in the header file
// 
//	Return:
//		BOOL 	=	TRUE if the control was added successfully, FALSE otherwise
// 
BOOL CControlPos::AddControl(const UINT& unID, const DWORD& dwStyle /* = CP_MOVE_H */)
{
	CWnd* pControl;

	if (m_pParent)
	{
		pControl = m_pParent->GetDlgItem(unID);
		return (AddControl(pControl, dwStyle));
	}
	else
	{
		return (FALSE);
	}
}

//------------------------------------------------------------------------------
// CControlPos::RemoveControl
// 
//	If a client ever wants to remove a control programmatically, this 
//    function will do it. 
// 
//	Access: public
// 
//	Args:
//		CWnd* pControl	=	pointer of the window who should be removed from 
//								the internal control list [ie: will not be repositioned]
// 
//	Return:
//		BOOL 	=	TRUE if the control was found [and deleted], FALSE otherwise
// 
BOOL CControlPos::RemoveControl(CWnd* pControl)
{
	BOOL fReturnValue = FALSE;

	for (int i = 0; i < m_awndControls.GetSize(); i++)
	{
		LPCONTROLDATA pstControl = ((LPCONTROLDATA)m_awndControls.GetAt(i));
		
		if (pstControl->hControl == pControl->GetSafeHwnd())
		{
			m_awndControls.RemoveAt(i);
			delete pstControl;
			fReturnValue = TRUE;
			break;
		}
	}

	return (fReturnValue);
}

//------------------------------------------------------------------------------
// CControlPos::RemoveControl
// 
//	If a client ever wants to remove a control programmatically, this 
//    function will do it. 
// 
//	Access: public
// 
//	Args:
//		const UINT& unID  =  ID of the control that should be removed from the
//                         internal control list [ie: will not be repositioned]
// 
//	Return:
//		BOOL 	=	TRUE if the control was found [and deleted], FALSE otherwise
// 
BOOL CControlPos::RemoveControl(const UINT& unID)
{
	CWnd* pControl;

	if (m_pParent)
	{
		pControl = m_pParent->GetDlgItem(unID);
		return (RemoveControl(pControl));
	}
	else
	{
		return (FALSE);
	}
}

//------------------------------------------------------------------------------
// CControlPos::ResetControls
// 
//	This function removes all controls from the CControlPos object 
// 
//	Access: public
// 
//	Args:
//		none
// 
//	Return:
//		none
// 
void CControlPos::ResetControls(void)
{
	while (m_awndControls.GetSize() > 0)
	{
		int   nHighIDx = m_awndControls.GetUpperBound();
		LPCONTROLDATA pstControl = ((LPCONTROLDATA)m_awndControls.GetAt(nHighIDx));
		if (pstControl)
		{
			m_awndControls.RemoveAt(nHighIDx);
			delete pstControl;
		}
	}
}

//------------------------------------------------------------------------------
// CControlPos::MoveControls
// 
//	This function takes care of moving all controls that have been added to 
//    the object [see AddControl].  This function should be called from the 
//    WM_SIZE handler-function [typically OnSize]. 
// 
//	Access: public
// 
//	Args:
//		none
// 
//	Return:
//		none
// 
void CControlPos::MoveControls(void)
{
	if (m_pParent)
	{
		//--------------------------------------------------------------------
		// for each control that has been added to our object, we want to
		// check its style and move it based off of the parent control's
		// movements.
		// the thing to keep in mind is that when you resize a window, you
		// can resize by more than one pixel at a time. this is important
		// when, for example, you start with a width smaller than the
		// original width and you finish with a width larger than the
		// original width. you know that you want to move the control, but
		// by how much? that is why so many if's and calculations are made
		//
		for (int i = 0; i < m_awndControls.GetSize(); i++)
		{
			LPCONTROLDATA pstControl = ((LPCONTROLDATA)m_awndControls.GetAt(i));
			CRect rcParentBounds;
			CRect rcBounds;
			CWnd* pControl = m_pParent->FromHandle(pstControl->hControl);

			pControl->GetWindowRect(rcBounds);
			m_pParent->GetClientRect(rcParentBounds);

			if ((pstControl->dwStyle & (CP_RESIZE_V)) == (CP_RESIZE_V))
			{
				if (!m_fNegativeMoves)
				{
					if (rcParentBounds.bottom > m_nOriginalParentHeight)
					{
						if (m_nOriginalParentHeight <= m_nOldParentHeight)
						{
							rcBounds.bottom += rcParentBounds.bottom - m_nOldParentHeight;
						}
						else
						{
							rcBounds.bottom += rcParentBounds.bottom - m_nOriginalParentHeight;
						}
					}
					else
					{
						if (m_nOldParentHeight > m_nOriginalParentHeight)
						{
							rcBounds.bottom += m_nOriginalParentHeight - m_nOldParentHeight;
						}
					}
				}
				else
				{
					rcBounds.bottom += rcParentBounds.bottom - m_nOldParentHeight;
				}
			}

			if ((pstControl->dwStyle & (CP_RESIZE_H)) == (CP_RESIZE_H))
			{
				if (!m_fNegativeMoves)
				{
					if (rcParentBounds.right > m_nOriginalParentWidth)
					{
						if (m_nOriginalParentWidth <= m_nOldParentWidth)
						{
							rcBounds.right += rcParentBounds.right - m_nOldParentWidth;
						}
						else
						{
							rcBounds.right += rcParentBounds.right - m_nOriginalParentWidth;
						}
					}
					else
					{
						if (m_nOldParentWidth > m_nOriginalParentWidth)
						{
							rcBounds.right += m_nOriginalParentWidth - m_nOldParentWidth;
						}
					}
				}
				else
				{
					rcBounds.right += rcParentBounds.right - m_nOldParentWidth;
				}
			}

			if ((pstControl->dwStyle & (CP_MOVE_V)) == (CP_MOVE_V))
			{
				if (!m_fNegativeMoves)
				{
					if (rcParentBounds.bottom > m_nOriginalParentHeight)
					{
						if (m_nOriginalParentHeight <= m_nOldParentHeight)
						{
							rcBounds.bottom += rcParentBounds.bottom - m_nOldParentHeight;
							rcBounds.top += rcParentBounds.bottom - m_nOldParentHeight;
						}
						else
						{
							rcBounds.bottom += rcParentBounds.bottom - m_nOriginalParentHeight;
							rcBounds.top += rcParentBounds.bottom - m_nOriginalParentHeight;
						}
					}
					else
					{
						if (m_nOldParentHeight > m_nOriginalParentHeight)
						{
							rcBounds.bottom += m_nOriginalParentHeight - m_nOldParentHeight;
							rcBounds.top += m_nOriginalParentHeight - m_nOldParentHeight;
						}
					}
				}
				else
				{
					rcBounds.bottom += rcParentBounds.bottom - m_nOldParentHeight;
					rcBounds.top += rcParentBounds.bottom - m_nOldParentHeight;
				}
			}

			if ((pstControl->dwStyle & (CP_MOVE_H)) == (CP_MOVE_H))
			{
				if (!m_fNegativeMoves)
				{
					if (rcParentBounds.right > m_nOriginalParentWidth)
					{
						if (m_nOriginalParentWidth <= m_nOldParentWidth)
						{
							rcBounds.right += rcParentBounds.right - m_nOldParentWidth;
							rcBounds.left += rcParentBounds.right - m_nOldParentWidth;
						}
						else
						{
							rcBounds.right += rcParentBounds.right - m_nOriginalParentWidth;
							rcBounds.left += rcParentBounds.right - m_nOriginalParentWidth;
						}
					}
					else
					{
						if (m_nOldParentWidth > m_nOriginalParentWidth)
						{
							rcBounds.right += m_nOriginalParentWidth - m_nOldParentWidth;
							rcBounds.left += m_nOriginalParentWidth - m_nOldParentWidth;
						}
					}
				}
				else
				{
					rcBounds.right += rcParentBounds.right - m_nOldParentWidth;
					rcBounds.left += rcParentBounds.right - m_nOldParentWidth;
				}
			}

			m_pParent->ScreenToClient(rcBounds);
			pControl->MoveWindow(rcBounds);
		}

		UpdateParentSize();
	}
}

//------------------------------------------------------------------------------
// CControlPos::SetNegativeMoves
// 
//	This sets the NegativeMoves boolean parameter of the object. When the 
//    parent window becomes smaller than it started, setting this to FALSE 
//    will not allow controls to be moved; the parent size may change, but 
//    it'll just force the controls to go off of the 
//    This parameter defaults to FALSE on object creation.
// 
//	Access: public
// 
//	Args:
//		const BOOL& fNegativeMoves /* = TRUE */	=	value to set
// 
//	Return:
//		none
// 
void CControlPos::SetNegativeMoves(const BOOL& fNegativeMoves /* = TRUE */)
{
	m_fNegativeMoves = fNegativeMoves;
}

//------------------------------------------------------------------------------
// CControlPos::GetNegativeMoves
// 
//	This function returns whether or not negative moves are enabled. 
// 
//	Access: public
// 
//	Args:
//		none
// 
//	Return:
//		BOOL 	=	TRUE if negative moves are enabled, FALSE otherwise
// 
BOOL CControlPos::GetNegativeMoves(void) const
{
	return (m_fNegativeMoves);
}

//------------------------------------------------------------------------------
// CControlPos::UpdateParentSize
// 
//	Since CControlPos keeps track of the parent's size, it gets updated 
//    every time it tells us to size the controls. We keep track so we know 
//    how much it changed from the last WM_SIZE message. 
// 
//	Access: protected
// 
//	Args:
//		none
// 
//	Return:
//		none
// 
void CControlPos::UpdateParentSize(void)
{
	if (m_pParent)
	{
		CRect rcBounds;
		m_pParent->GetClientRect(rcBounds);

		m_nOldParentWidth = rcBounds.Width();
		m_nOldParentHeight = rcBounds.Height();
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕精品一区二区精品绿巨人| 婷婷综合五月天| 亚洲五码中文字幕| 国产最新精品免费| 91久久线看在观草草青青| 日韩美女视频在线| 一区二区三区中文在线| 国产精品亚洲午夜一区二区三区 | 一区二区三区精密机械公司| 精品一区免费av| 欧美日韩一区二区三区不卡| 中文字幕二三区不卡| 麻豆91在线播放| 欧美另类videos死尸| 综合在线观看色| 国产精品影视在线| 欧美一区二区三区影视| 亚洲福利一二三区| 色哟哟一区二区在线观看| 国产精品色眯眯| 国产黄色成人av| 日韩精品一区二区三区在线播放| 看片的网站亚洲| 欧美视频日韩视频在线观看| 自拍av一区二区三区| 国产91丝袜在线18| 久久久精品天堂| 激情另类小说区图片区视频区| 欧美日韩国产123区| 一区二区不卡在线视频 午夜欧美不卡在| 国产精品自拍网站| 久久精品免视看| 成人精品视频.| 中文字幕av一区 二区| 国产精品99久| 国产日韩欧美精品一区| 国产成人在线视频免费播放| 国产亚洲精品中文字幕| 极品瑜伽女神91| 久久综合九色欧美综合狠狠| 经典三级一区二区| 欧美韩国日本不卡| 99re热这里只有精品视频| 中文字幕日韩精品一区| 一本到高清视频免费精品| 亚洲女女做受ⅹxx高潮| 欧美日韩免费电影| 日本女人一区二区三区| 精品国内片67194| 国产一区二区电影| 亚洲欧洲精品一区二区三区不卡| 99久久国产综合精品麻豆| 国产精品剧情在线亚洲| 色吊一区二区三区| 日本一区中文字幕| 久久久久久麻豆| 色哟哟国产精品免费观看| 亚洲成在人线免费| 久久天天做天天爱综合色| 成人深夜福利app| 亚洲一区二区av电影| 6080午夜不卡| 高清在线不卡av| 亚洲综合图片区| 欧美成人精精品一区二区频| 成人18视频在线播放| 亚洲综合精品久久| 久久新电视剧免费观看| 一本一道综合狠狠老| 日韩影院精彩在线| 国产精品狼人久久影院观看方式| 欧美日韩一区小说| 国产成人综合网| 丝袜诱惑制服诱惑色一区在线观看 | 国产精品不卡在线| 欧美色爱综合网| 国产精品正在播放| 日韩在线a电影| 亚洲日本免费电影| 久久久天堂av| 欧美日韩精品一区二区三区四区| 国产精品88av| 日韩av网站免费在线| 欧美国产亚洲另类动漫| 亚洲天堂中文字幕| 26uuu精品一区二区| 欧美色精品在线视频| 成人va在线观看| 精品一区二区日韩| 午夜日韩在线观看| 亚洲欧美一区二区三区孕妇| 久久一区二区视频| 在线不卡一区二区| 91激情在线视频| 成人激情视频网站| 国产精品123区| 日本亚洲免费观看| 五月婷婷综合网| 亚洲男女一区二区三区| 欧美韩日一区二区三区| 26uuu国产一区二区三区 | 风间由美一区二区三区在线观看| 日本视频免费一区| 亚洲6080在线| 亚洲综合区在线| 亚洲男人天堂一区| 亚洲同性同志一二三专区| 国产欧美日韩视频一区二区| 精品久久国产字幕高潮| 91麻豆精品国产自产在线| 欧美色图在线观看| 在线精品视频一区二区三四| 99re视频精品| 一本一道久久a久久精品综合蜜臀| 国产成人综合在线播放| 国产aⅴ精品一区二区三区色成熟| 精品一区二区三区不卡| 韩国一区二区视频| 国产乱子伦视频一区二区三区 | 6080国产精品一区二区| 欧美日本一区二区在线观看| 欧美性色黄大片| 91精选在线观看| 欧美一区2区视频在线观看| 欧美一级日韩不卡播放免费| 91精品欧美久久久久久动漫| 91麻豆精品国产自产在线| 欧美成人一区二区三区片免费 | 中文成人综合网| 国产精品视频第一区| 亚洲精品中文在线影院| 亚洲一区二区四区蜜桃| 亚洲第一av色| 蜜臀av国产精品久久久久| 黄色精品一二区| a在线播放不卡| 在线免费av一区| 日韩无一区二区| 国产日韩欧美高清在线| 亚洲激情av在线| 图片区日韩欧美亚洲| 精品亚洲porn| av影院午夜一区| 91精品国产综合久久久久久| 久久影院电视剧免费观看| 日产国产欧美视频一区精品| 激情深爱一区二区| 99热国产精品| 日韩一区二区三区视频在线| 国产亚洲精品aa午夜观看| 一区二区欧美视频| 久久精品国产精品亚洲精品| 春色校园综合激情亚洲| 8x福利精品第一导航| 国产午夜亚洲精品羞羞网站| 亚洲线精品一区二区三区| 国产一区二区三区国产| 91福利国产精品| 亚洲精品一区在线观看| 亚洲欧美日韩国产手机在线| 首页欧美精品中文字幕| 成人av电影在线播放| 91精品国产综合久久福利软件 | 亚洲欧美偷拍三级| 欧美综合色免费| 91精品国产综合久久久蜜臀图片| 国产欧美一区二区精品性色| 亚洲无人区一区| 成人国产精品视频| 日韩一本二本av| 亚洲综合激情网| 风间由美一区二区三区在线观看| 欧美乱妇23p| 夜夜揉揉日日人人青青一国产精品| 久久aⅴ国产欧美74aaa| 欧美亚洲国产bt| 国产精品传媒入口麻豆| 国产在线视频精品一区| 91精品国产手机| 一区二区三区.www| 91免费小视频| 国产精品丝袜久久久久久app| 男女男精品网站| 4438x成人网最大色成网站| 亚洲乱码国产乱码精品精小说 | 精品久久人人做人人爰| 亚洲不卡av一区二区三区| 色乱码一区二区三区88| 中文乱码免费一区二区| 成人自拍视频在线| 久久精品在线观看| 国产精品亚洲专一区二区三区| 日韩精品一区二区三区在线观看| 性感美女极品91精品| 欧美日韩免费观看一区三区| 夜夜精品视频一区二区| 在线视频欧美区| 亚洲一区在线看| 欧美日韩精品久久久| 亚洲国产精品欧美一二99|