当前位置: 首页>>代码示例>>C++>>正文


C++ CDuiRect::GetHeight方法代码示例

本文整理汇总了C++中CDuiRect::GetHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ CDuiRect::GetHeight方法的具体用法?C++ CDuiRect::GetHeight怎么用?C++ CDuiRect::GetHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDuiRect的用法示例。


在下文中一共展示了CDuiRect::GetHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CalPos

	RECT CEditWnd::CalPos()
	{
		CDuiRect rcPos = m_pOwner->GetPos();
		RECT rcInset = m_pOwner->GetTextPadding();
		rcPos.left += rcInset.left;
		rcPos.top += rcInset.top;
		rcPos.right -= rcInset.right;
		rcPos.bottom -= rcInset.bottom;
		LONG lEditHeight = m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->tm.tmHeight;
		if( lEditHeight < rcPos.GetHeight() ) {
			rcPos.top += (rcPos.GetHeight() - lEditHeight) / 2;
			rcPos.bottom = rcPos.top + lEditHeight;
		}

		CControlUI* pParent = m_pOwner;
		RECT rcParent;
		while( pParent = pParent->GetParent() ) {
			if( !pParent->IsVisible() ) {
				rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
				break;
			}
			rcParent = pParent->GetClientPos();
			if( !::IntersectRect(&rcPos, &rcPos, &rcParent) ) {
				rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
				break;
			}
		}

		return rcPos;
	}
开发者ID:FJSDS,项目名称:DuiLib_Ultimate,代码行数:30,代码来源:UIEdit.cpp

示例2: InitWindow

void MainDialog::InitWindow()
{
	MONITORINFO oMonitor = {};
	oMonitor.cbSize = sizeof(oMonitor);
	::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
	CDuiRect rcWork = oMonitor.rcWork;

	CDuiRect rcWnd;
	GetWindowRect(m_hWnd, &rcWnd);
	int nWidth = rcWnd.GetWidth();
	int nHeight = rcWnd.GetHeight();
	SetWindowPos(m_hWnd, HWND_TOPMOST, rcWork.GetWidth() - nWidth - 100, 100, 280, rcWork.GetHeight()-200, SWP_SHOWWINDOW);

}
开发者ID:baoruxing,项目名称:TTWinClient,代码行数:14,代码来源:MainDialog.cpp

示例3: CalPos

	RECT CEditWnd::CalPos()
	{
		CDuiRect rcPos = m_pOwner->GetPos();
		RECT rcInset = m_pOwner->GetTextPadding();
		rcPos.left += rcInset.left;
		rcPos.top += rcInset.top;
		rcPos.right -= rcInset.right;
		rcPos.bottom -= rcInset.bottom;
		LONG lEditHeight = m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->tm.tmHeight;
		if( lEditHeight < rcPos.GetHeight() ) {
			rcPos.top += (rcPos.GetHeight() - lEditHeight) / 2;
			rcPos.bottom = rcPos.top + lEditHeight;
		}
		return rcPos;
	}
开发者ID:yuechuanbingzhi163,项目名称:myduilib,代码行数:15,代码来源:UIEdit.cpp

示例4: ResizeMenu

	void CMenuWnd::ResizeMenu()
	{
		CControlUI* pRoot = m_pm.GetRoot();

#if defined(WIN32) && !defined(UNDER_CE)
		MONITORINFO oMonitor = {}; 
		oMonitor.cbSize = sizeof(oMonitor);
		::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
		CDuiRect rcWork = oMonitor.rcWork;
#else
		CDuiRect rcWork;
		GetWindowRect(m_pOwner->GetManager()->GetPaintWindow(), &rcWork);
#endif
		SIZE szAvailable = { rcWork.right - rcWork.left, rcWork.bottom - rcWork.top };
		szAvailable = pRoot->EstimateSize(szAvailable);
		m_pm.SetInitSize(szAvailable.cx, szAvailable.cy);

		//必须是Menu标签作为xml的根节点
		CMenuUI *pMenuRoot = static_cast<CMenuUI*>(pRoot);
		ASSERT(pMenuRoot);

		SIZE szInit = m_pm.GetInitSize();
		CDuiRect rc;
		CDuiPoint point = m_BasedPoint;
		rc.left = point.x;
		rc.top = point.y;
		rc.right = rc.left + szInit.cx;
		rc.bottom = rc.top + szInit.cy;

		int nWidth = rc.GetWidth();
		int nHeight = rc.GetHeight();

		if (m_dwAlignment & eMenuAlignment_Right)
		{
			rc.right = point.x;
			rc.left = rc.right - nWidth;
		}

		if (m_dwAlignment & eMenuAlignment_Bottom)
		{
			rc.bottom = point.y;
			rc.top = rc.bottom - nHeight;
		}

		SetForegroundWindow(m_hWnd);
		MoveWindow(m_hWnd, rc.left, rc.top, rc.GetWidth(), rc.GetHeight(), FALSE);
		SetWindowPos(m_hWnd, HWND_TOPMOST, rc.left, rc.top, rc.GetWidth(), rc.GetHeight() + pMenuRoot->GetInset().bottom + pMenuRoot->GetInset().top, SWP_SHOWWINDOW);
	}
开发者ID:Crawping,项目名称:IocpServerClient_Side,代码行数:48,代码来源:UIMenu.cpp

示例5: OnNcCalcSize

LRESULT WindowImplBase::OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	LPRECT pRect=NULL;

	if ( wParam == TRUE)
	{
		LPNCCALCSIZE_PARAMS pParam = (LPNCCALCSIZE_PARAMS)lParam;
		pRect=&pParam->rgrc[0];
	}
	else
	{
		pRect=(LPRECT)lParam;
	}

	if ( ::IsZoomed(m_hWnd))
	{	// 最大化时,计算当前显示器最适合宽高度
		MONITORINFO oMonitor = {};
		oMonitor.cbSize = sizeof(oMonitor);
		::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTONEAREST), &oMonitor);
		CDuiRect rcWork = oMonitor.rcWork;
		CDuiRect rcMonitor = oMonitor.rcMonitor;
		rcWork.Offset(-oMonitor.rcMonitor.left, -oMonitor.rcMonitor.top);

		pRect->right = pRect->left + rcWork.GetWidth();
		pRect->bottom = pRect->top + rcWork.GetHeight();
		return WVR_REDRAW;
	}

	return 0;
}
开发者ID:2php,项目名称:duilib,代码行数:30,代码来源:WinImplBase.cpp

示例6: OnGetMinMaxInfo

LRESULT WindowImplBase::OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	LPMINMAXINFO lpMMI = (LPMINMAXINFO) lParam;

	MONITORINFO oMonitor = {};
	oMonitor.cbSize = sizeof(oMonitor);
	::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTONEAREST), &oMonitor);
	CDuiRect rcWork = oMonitor.rcWork;
	CDuiRect rcMonitor = oMonitor.rcMonitor;
	rcWork.Offset(-oMonitor.rcMonitor.left, -oMonitor.rcMonitor.top);

	// 计算最大化时,正确的原点坐标
	lpMMI->ptMaxPosition.x	= rcWork.left;
	lpMMI->ptMaxPosition.y	= rcWork.top;

	lpMMI->ptMaxTrackSize.x = lpMMI->ptMaxSize.x = rcWork.GetWidth();
	lpMMI->ptMaxTrackSize.y = lpMMI->ptMaxSize.y = rcWork.GetHeight();
	if (m_PaintManager.GetMaxInfo().cx != 0) {
		lpMMI->ptMaxTrackSize.x = lpMMI->ptMaxSize.x = m_PaintManager.GetMaxInfo().cx;
	}
	if (m_PaintManager.GetMaxInfo().cy != 0) {
		lpMMI->ptMaxTrackSize.y = lpMMI->ptMaxSize.y = m_PaintManager.GetMaxInfo().cy;
	}
	lpMMI->ptMinTrackSize.x =m_PaintManager.GetMinInfo().cx;
	lpMMI->ptMinTrackSize.y =m_PaintManager.GetMinInfo().cy;

	bHandled = TRUE;
	return 0;
}
开发者ID:ZhuBicen,项目名称:DuiGallery,代码行数:29,代码来源:WinImplBase.cpp

示例7: CreateTransColorRgn

HRGN CreateTransColorRgn(HDC dc,HWND hwnd,COLORREF TransColor)
{
	COLORREF   cl; 
	CDuiRect   cRect;
	HRGN   wndRgn; 
	::GetWindowRect(hwnd,&cRect);
	wndRgn = ::CreateRectRgn(0,0,cRect.GetWidth(),cRect.GetHeight());

	for(int x = 0,len = cRect.GetWidth(); x <= len; x++)
	{  
		int y1,y2;
		int height = cRect.GetHeight();
		for(y1 = 0; y1 <=height; y1++)
		{
			cl = ::GetPixel(dc,x,y1);
			if(cl == TransColor)
			{
				HRGN rgnTemp = ::CreateRectRgn(x,   y1,   x+1,   y1+1);
				::CombineRgn(wndRgn,wndRgn,rgnTemp,RGN_XOR);
				::DeleteObject(rgnTemp);
			} 
			else
			{
				break;
			}
		} 

		for(y2 = height-1; y2 >= y1; y2--)
		{
			cl = ::GetPixel(dc,x, y2); 
			if(cl == TransColor)
			{
				HRGN rgnTemp = ::CreateRectRgn(x,   y2,   x+1,   y2+1);
				::CombineRgn(wndRgn,wndRgn,rgnTemp, RGN_XOR); 
				::DeleteObject(rgnTemp);   
			} 
			else
			{
				break;
			}
		} 
	} 
	return wndRgn;
}
开发者ID:yuechuanbingzhi163,项目名称:myduilib,代码行数:44,代码来源:InfoWindow.cpp

示例8: OnSize

LRESULT CWkeWebkitWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	CDuiRect rcWnd;
	::GetWindowRect(*this, &rcWnd);

	m_pWebView->resize(rcWnd.GetWidth(), rcWnd.GetHeight());
	m_pWebView->tick();
	
	::InvalidateRect(m_hWnd, NULL, FALSE);
	return 0;
}
开发者ID:yz254316702,项目名称:DuiLib_OwenYi,代码行数:11,代码来源:WkeWebkit.cpp

示例9: AdjustPostion

void CMenuWnd::AdjustPostion()
{
	CDuiRect rcWnd;
	GetWindowRect(m_hWnd, &rcWnd);
	int nWidth = rcWnd.GetWidth();
	int nHeight = rcWnd.GetHeight();
	rcWnd.left = m_ptPos.x;
	rcWnd.top = m_ptPos.y;
	rcWnd.right = rcWnd.left + nWidth;
	rcWnd.bottom = rcWnd.top + nHeight;
	MONITORINFO oMonitor = {};
	oMonitor.cbSize = sizeof(oMonitor);
	::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
	CDuiRect rcWork = oMonitor.rcWork;

	if( rcWnd.bottom > rcWork.bottom ) {
		if( nHeight >= rcWork.GetHeight() ) {
			rcWnd.top = 0;
			rcWnd.bottom = nHeight;
		}
		else {
			rcWnd.bottom = rcWork.bottom;
			rcWnd.top = rcWnd.bottom - nHeight;
		}
	}
	if( rcWnd.right > rcWork.right ) {
		if( nWidth >= rcWork.GetWidth() ) {
			rcWnd.left = 0;
			rcWnd.right = nWidth;
		}
		else {
			rcWnd.right = rcWork.right;
			rcWnd.left = rcWnd.right - nWidth;
		}
	}
	::SetWindowPos(m_hWnd, NULL, rcWnd.left, rcWnd.top, rcWnd.GetWidth(), rcWnd.GetHeight(), SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
}
开发者ID:dragonwarrior95,项目名称:ListXml,代码行数:37,代码来源:MenuWnd.cpp

示例10: FullScreen

void CWindowWnd::FullScreen()
{
	::GetClientRect(m_hWnd,&m_RestoreRect);
	CPoint point;
	::ClientToScreen(m_hWnd,&point);
	m_RestoreRect.left=point.x;
	m_RestoreRect.top=point.y;
	m_RestoreRect.right+=point.x;
	m_RestoreRect.bottom+=point.y;
	MONITORINFO oMonitor = {};
	oMonitor.cbSize = sizeof(oMonitor);
	::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTONEAREST), &oMonitor);
	CDuiRect rcWork = oMonitor.rcWork;

	::SetWindowPos( m_hWnd, NULL, rcWork.left, rcWork.top, rcWork.GetWidth(), rcWork.GetHeight(), SWP_SHOWWINDOW | SWP_NOZORDER );
}
开发者ID:tiger7456,项目名称:OpenDuilib,代码行数:16,代码来源:UIBase.cpp

示例11: OnGetMinMaxInfo

LRESULT WindowImplBase::OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	MONITORINFO oMonitor = {};
	oMonitor.cbSize = sizeof(oMonitor);
	::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
	CDuiRect rcWork = oMonitor.rcWork;
	rcWork.Offset(-oMonitor.rcMonitor.left, -oMonitor.rcMonitor.top);

	LPMINMAXINFO lpMMI = (LPMINMAXINFO) lParam;
	lpMMI->ptMaxPosition.x	= rcWork.left;
	lpMMI->ptMaxPosition.y	= rcWork.top;
	lpMMI->ptMaxSize.x		= rcWork.GetWidth();
	lpMMI->ptMaxSize.y		= rcWork.GetHeight();

	bHandled = FALSE;
	return 0;
}
开发者ID:wyrover,项目名称:myhistoryprojects,代码行数:17,代码来源:WinImplBase.cpp

示例12: MoveWindowToPoint

	BOOL CWin::MoveWindowToPoint(LPPOINT lpPoint)
	{
		assert(lpPoint);
		assert(::IsWindow(m_hWnd));

		RECT rcWnd;
		GetWindowRect(&rcWnd);
		const int nWidth = rcWnd.right - rcWnd.left;
		const int nHeight = rcWnd.bottom - rcWnd.top;
		rcWnd.left = lpPoint->x;
		rcWnd.top = lpPoint->y;
		rcWnd.right = rcWnd.left + nWidth;
		rcWnd.bottom = rcWnd.top + nHeight;
		MONITORINFO oMonitor = {0};
		oMonitor.cbSize = sizeof(oMonitor);
		::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
		CDuiRect rcWork = oMonitor.rcWork;

		if( rcWnd.bottom > rcWork.bottom ) {
			if( nHeight >= rcWork.GetHeight() ) {
				rcWnd.top = 0;
				rcWnd.bottom = nHeight;
			}
			else {
				rcWnd.bottom = lpPoint->y;//rcWork.bottom;
				rcWnd.top = rcWnd.bottom - nHeight;
			}
		}
		if( rcWnd.right > rcWork.right ) {
			if( nWidth >= rcWork.GetWidth() ) {
				rcWnd.left = 0;
				rcWnd.right = nWidth;
			}
			else {
				rcWnd.right = lpPoint->x;//rcWork.right;
				rcWnd.left = rcWnd.right - nWidth;
			}
		}
		return SetWindowPos(NULL,&rcWnd,SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
	}
开发者ID:uvbs,项目名称:myduilib,代码行数:40,代码来源:Window.cpp

示例13: AdjustWindow

void CInfoWindow::AdjustWindow(HWND hparent,POINT pt)
{
	if(hparent)
		::ClientToScreen(hparent,&pt);	

	CDuiRect rtWnd;
	GetWindowRect(&rtWnd);
	const int nWidth  = rtWnd.GetWidth();
	const int nHeight = rtWnd.GetHeight();

	rtWnd.left        = pt.x;
	rtWnd.right       = rtWnd.left + nWidth;
	rtWnd.bottom      = pt.y;// - _ptOffsize.cy;
	rtWnd.top         = rtWnd.bottom - nHeight;

	SetWindowPos(HWND_TOPMOST,&rtWnd,0);
// 	{
// 		CDuiRect rect;
// 		GetWindowRect(&rect);
// 		HDC dc = ::GetDC(m_hWnd);
// 		HDC memdc = ::CreateCompatibleDC(dc);
// 		COLORREF clr = RGB(255,0,255);
// 		COLORREF clrOld = ::SetBkColor(memdc, clr);
// 		ASSERT(clrOld != CLR_INVALID);
// 		if(clrOld != CLR_INVALID)
// 		{
// 			::ExtTextOut(memdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);
// 			::SetBkColor(memdc, clrOld);
// 		}
// 		VERIFY(CRenderEngine::DrawImageString(memdc,GetPaintMgr(),rect,rect,GetPaintMgr()->GetRoot()->GetBkImage()));
// 		HRGN hrgn = CreateTransColorRgn(memdc,m_hWnd,clr);
// 		ASSERT(hrgn);
// 		::SetWindowRgn(m_hWnd,hrgn, true);
// 		::DeleteObject(hrgn);
// 		::DeleteDC(memdc);
// 		::ReleaseDC(m_hWnd,dc);
// 	}
	Invalidate(FALSE);
}
开发者ID:yuechuanbingzhi163,项目名称:myduilib,代码行数:39,代码来源:InfoWindow.cpp

示例14: SetPos

void CControlUI::SetPos(const CDuiRect& rc)
{
    m_rcItem = rc;
	if(m_rcItem.right < m_rcItem.left) m_rcItem.right  = m_rcItem.left;
	if(m_rcItem.bottom< m_rcItem.top)  m_rcItem.bottom = m_rcItem.top;

	SIZE tmpsz = {m_rcItem.GetWidth(), m_rcItem.GetHeight()};
	SetPostSize(tmpsz);

	if(!IsWindow(m_hWnd) || m_rcItem.IsNull()) 
		return;

	CDuiRect rct = m_rcItem;
	rct = m_rcItem;

	rct.left   += m_rcInset.left;
	rct.top    += m_rcInset.top;
	rct.right  -= m_rcInset.right;
	rct.bottom -= m_rcInset.bottom;

	::SetWindowPos(m_hWnd, 0, rct.left, rct.top, rct.GetWidth(), rct.GetHeight(), SWP_NOZORDER);
}
开发者ID:578141611,项目名称:common,代码行数:22,代码来源:UIControl.cpp

示例15: SetPos

void CSysComboUI::SetPos(RECT rc)
{
	__super::SetPos(rc);
	CDuiRect r = GetPos();
	::SetWindowPos(*m_pWnd,0,r.left, r.top, r.GetWidth(), r.GetHeight(), SWP_NOZORDER | ::IsWindowVisible(*m_pWnd)?SWP_SHOWWINDOW:SWP_HIDEWINDOW);
}
开发者ID:asdlei00,项目名称:duilib-1,代码行数:6,代码来源:SysCombo.cpp


注:本文中的CDuiRect::GetHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。