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


C++ CBCGPDrawManager::MirrorRect方法代码示例

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


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

示例1: dm

//*********************************************************************************************************
void CBCGPVisualManagerVS2008::OnDrawAutoHideButtonBorder (CDC* pDC, CRect rect, CRect rectBorderSize, CBCGPAutoHideButton* pButton)
{
	ASSERT_VALID (pDC);
	ASSERT_VALID (pButton);

	if (globalData.m_nBitsPerPixel <= 8 || globalData.IsHighContastMode () ||
		m_hThemeTab == NULL)
	{
		CBCGPVisualManagerVS2005::OnDrawAutoHideButtonBorder (pDC, rect, rectBorderSize, pButton);
		return;
	}

	const int nState = pButton->IsHighlighted () ? TIS_HOT : TIS_NORMAL;
	const DWORD dwAlign = (pButton->GetAlignment ()) & CBRS_ALIGN_ANY;

	CBCGPDrawManager dm (*pDC);

	switch (dwAlign)
	{
	case CBRS_ALIGN_LEFT:
	case CBRS_ALIGN_RIGHT:
		{
			CRect rectTab (0, 0, rect.Height (), rect.Width ());

			CDC dcMem;
			dcMem.CreateCompatibleDC (pDC);

			CBitmap bmpMem;
			bmpMem.CreateCompatibleBitmap (pDC, rectTab.Width (), rectTab.Height ());

			CBitmap* pBmpOld = (CBitmap*) dcMem.SelectObject (&bmpMem);

			(*m_pfDrawThemeBackground) (m_hThemeTab, dcMem.GetSafeHdc(), TABP_TABITEM, nState, &rectTab, 0);

			dm.DrawRotated (rect, dcMem, dwAlign == CBRS_ALIGN_LEFT);
			dcMem.SelectObject (pBmpOld);
		}
		break;

	case CBRS_ALIGN_TOP:
	case CBRS_ALIGN_BOTTOM:
		(*m_pfDrawThemeBackground) (m_hThemeTab, pDC->GetSafeHdc(), TABP_TABITEM, nState, &rect, 0);

		if (dwAlign == CBRS_ALIGN_TOP)
		{
			dm.MirrorRect (rect, FALSE);
			break;
		}
	}
}
开发者ID:iclosure,项目名称:jframework,代码行数:51,代码来源:BCGPVisualManagerVS2008.cpp

示例2: if

//*********************************************************************************************************
void CBCGPVisualManagerVS2008::OnDrawTab (CDC* pDC, CRect rectTab,
						int iTab, BOOL bIsActive, const CBCGPBaseTabWnd* pTabWnd)
{
	ASSERT_VALID (pTabWnd);
	ASSERT_VALID (pDC);

	const COLORREF clrTab = pTabWnd->GetTabBkColor (iTab);
	const BOOL bIsHighlight = (iTab == pTabWnd->GetHighlightedTab ());

	if (globalData.m_nBitsPerPixel <= 8 || globalData.IsHighContastMode () ||
		pTabWnd->IsDialogControl () ||
		pTabWnd->IsFlatTab () || pTabWnd->IsPointerStyle() ||
		clrTab != (COLORREF)-1)
	{
		CBCGPVisualManagerVS2005::OnDrawTab (pDC, rectTab, iTab, bIsActive, pTabWnd);
		return;
	}

	if ((bIsActive || bIsHighlight || m_bOSColors) && pTabWnd->IsVS2005Style ())
	{
		((CBCGPBaseTabWnd*)pTabWnd)->SetTabBkColor (iTab, 
			bIsActive ? m_clrHighlight : 
			bIsHighlight ? m_clrHighlightDnGradientDark : GetThemeColor (m_hThemeButton, 2));

		CBCGPVisualManagerVS2005::OnDrawTab (pDC, rectTab, iTab, bIsActive, pTabWnd);

		((CBCGPBaseTabWnd*)pTabWnd)->SetTabBkColor (iTab, clrTab);
		return;
	}

	if (m_hThemeTab == NULL ||
		pTabWnd->IsOneNoteStyle () || pTabWnd->IsVS2005Style () ||
		pTabWnd->IsLeftRightRounded ())
	{
		CRect rectClip = rectTab;
		rectClip.bottom -= 2;

		CRgn rgn;
		rgn.CreateRectRgnIndirect (&rectClip);

		pDC->SelectClipRgn (&rgn);

		CBCGPVisualManagerVS2005::OnDrawTab (pDC, rectTab, iTab, bIsActive, pTabWnd);
		
		pDC->SelectClipRgn (NULL);
		return;
	}

	int nState = TIS_NORMAL;
	if (bIsActive)
	{
		nState = TIS_SELECTED;
	}
	else if (iTab == pTabWnd->GetHighlightedTab ())
	{
		nState = TIS_HOT;
	}

	rectTab.right += 2;

	if (!bIsActive)
	{
		rectTab.bottom--;
	}
	else if (pTabWnd->GetLocation () == CBCGPBaseTabWnd::LOCATION_BOTTOM)
	{
		rectTab.top--;
		rectTab.bottom++;
	}

	if (rectTab.Width () > 25)	// DrawThemeBackground will draw < 25 width tab bad
	{
		CRect rectDraw = rectTab;

		if (bIsActive && pTabWnd->GetLocation () == CBCGPBaseTabWnd::LOCATION_BOTTOM)
		{
			rectDraw.bottom++;
		}

		(*m_pfDrawThemeBackground) (m_hThemeTab, pDC->GetSafeHdc(), TABP_TABITEM, nState, &rectDraw, 0);

		if (pTabWnd->GetLocation () == CBCGPBaseTabWnd::LOCATION_BOTTOM)
		{
			CBCGPDrawManager dm (*pDC);
			dm.MirrorRect (rectTab, FALSE);
		}
	}

	COLORREF clrTabText = globalData.clrWindowText;

	if (pTabWnd->GetTabTextColor(iTab) != (COLORREF)-1)
	{
		clrTabText = pTabWnd->GetTabTextColor(iTab);
	}
	else
	{
		if (!bIsActive)
		{
			clrTabText = globalData.clrBtnDkShadow;
//.........这里部分代码省略.........
开发者ID:iclosure,项目名称:jframework,代码行数:101,代码来源:BCGPVisualManagerVS2008.cpp


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