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


C++ CControlUI::DoPaint方法代码示例

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


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

示例1: DoPaint

void CContainerUI::DoPaint(HDC hDC, const RECT& rcPaint)
{
   RECT rcTemp = { 0 };
   if( !::IntersectRect(&rcTemp, &rcPaint, &m_rcItem) ) return;

   CRenderClip clip;
   CBlueRenderEngineUI::GenerateClip(hDC, m_rcItem, clip);

   for( int it = 0; it < m_items.GetSize(); it++ ) {
      CControlUI* pControl = static_cast<CControlUI*>(m_items[it]);
      if( !pControl->IsVisible() ) continue;
      if( !::IntersectRect(&rcTemp, &rcPaint, &pControl->GetPos()) ) continue;
      if( !::IntersectRect(&rcTemp, &m_rcItem, &pControl->GetPos()) ) continue;
      pControl->DoPaint(hDC, rcPaint);
   }
}
开发者ID:0buffer,项目名称:DirectUI,代码行数:16,代码来源:UIContainer.cpp

示例2: DoPaint

void CDropDownUI::DoPaint(HDC hDC, const RECT& rcPaint)
{
	// Paint the nice frame
	int cy = m_rcItem.bottom - m_rcItem.top;
	::SetRect(&m_rcButton, m_rcItem.right - cy, m_rcItem.top, m_rcItem.right, m_rcItem.bottom);
	RECT rcText = { m_rcItem.left, m_rcItem.top, m_rcButton.left + 1, m_rcItem.bottom };
	if( !IsEnabled() ) {
		CBlueRenderEngineUI::DoPaintFrame(hDC, m_pManager, rcText, UICOLOR_CONTROL_BORDER_DISABLED, UICOLOR__INVALID, UICOLOR__INVALID);
	}
	else {
		CBlueRenderEngineUI::DoPaintFrame(hDC, m_pManager, rcText, UICOLOR_CONTROL_BORDER_NORMAL, UICOLOR_CONTROL_BORDER_NORMAL, UICOLOR__INVALID);
	}
	// Paint dropdown edit box
	::InflateRect(&rcText, -1, -1);
	if( m_iCurSel >= 0 ) {
		CControlUI* pControl = static_cast<CControlUI*>(m_items[m_iCurSel]);
		IListItemUI* pElement = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
		if( pElement != NULL ) {
			// Render item with specific draw-style
			pElement->DrawItem(hDC, rcText, UIDRAWSTYLE_INPLACE | (m_bFocused ? UIDRAWSTYLE_FOCUS : 0));
		}
		else {
			// Allow non-listitems to render as well.
			RECT rcOldPos = pControl->GetPos();
			pControl->SetPos(rcText);
			pControl->DoPaint(hDC, rcText);
			pControl->SetPos(rcOldPos);
		}
	}
	else {
		CBlueRenderEngineUI::DoFillRect(hDC, m_pManager, rcText, UICOLOR_CONTROL_BACKGROUND_NORMAL);
	}
	// Paint dropdown button
	RECT rcPadding = { 0 };
	CBlueRenderEngineUI::DoPaintButton(hDC, m_pManager, m_rcButton, _T("<i 6>"), rcPadding, m_uButtonState, 0);
}
开发者ID:kovrov,项目名称:scrap,代码行数:36,代码来源:UICombo.cpp

示例3: PaintText

	void CComboBoxUI::PaintText(HDC hDC)
	{
		RECT rcText = m_rcItem;
		rcText.left += m_rcTextPadding.left;
		rcText.right -= m_rcTextPadding.right;
		rcText.top += m_rcTextPadding.top;
		rcText.bottom -= m_rcTextPadding.bottom;

		rcText.right -= m_nArrowWidth; // add this line than CComboUI::PaintText(HDC hDC)

		if( m_iCurSel >= 0 ) {
			CControlUI* pControl = static_cast<CControlUI*>(m_items[m_iCurSel]);
			IListItemUI* pElement = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
			if( pElement != NULL ) {
				pElement->DrawItemText(hDC, rcText);
			}
			else {
				RECT rcOldPos = pControl->GetPos();
				pControl->SetPos(rcText);
				pControl->DoPaint(hDC, rcText);
				pControl->SetPos(rcOldPos);
			}
		}
	}
开发者ID:Crawping,项目名称:IocpServerClient_Side,代码行数:24,代码来源:UIComboBox.cpp

示例4: DoPaint

	void CContainerUI::DoPaint(HDC hDC, const RECT& rcPaint)
	{
		RECT rcTemp = { 0 };
		if( !::IntersectRect(&rcTemp, &rcPaint, &m_rcItem) ) return;

		CRenderClip clip;
		CRenderClip::GenerateClip(hDC, rcTemp, clip);
		CControlUI::DoPaint(hDC, rcPaint);

		if( m_items.GetSize() > 0 ) {
			RECT rc = m_rcItem;
			rc.left += m_rcInset.left;
			rc.top += m_rcInset.top;
			rc.right -= m_rcInset.right;
			rc.bottom -= m_rcInset.bottom;
			if( m_pVerticalScrollBar && m_pVerticalScrollBar->IsVisible() ) rc.right -= m_pVerticalScrollBar->GetFixedWidth();
			if( m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible() ) rc.bottom -= m_pHorizontalScrollBar->GetFixedHeight();

			if( !::IntersectRect(&rcTemp, &rcPaint, &rc) ) {
				for( int it = 0; it < m_items.GetSize(); it++ ) {
					CControlUI* pControl = static_cast<CControlUI*>(m_items[it]);
					if( !pControl->IsVisible() ) continue;
					if( !::IntersectRect(&rcTemp, &rcPaint, &pControl->GetPos()) ) continue;
					if( pControl ->IsFloat() ) {
						if( !::IntersectRect(&rcTemp, &m_rcItem, &pControl->GetPos()) ) continue;
						pControl->DoPaint(hDC, rcPaint);
					}
				}
			}
			else {
				CRenderClip childClip;
				CRenderClip::GenerateClip(hDC, rcTemp, childClip);
				for( int it = 0; it < m_items.GetSize(); it++ ) {
					CControlUI* pControl = static_cast<CControlUI*>(m_items[it]);
					if( !pControl->IsVisible() ) continue;
					if( !::IntersectRect(&rcTemp, &rcPaint, &pControl->GetPos()) ) continue;
					if( pControl ->IsFloat() ) {
						if( !::IntersectRect(&rcTemp, &m_rcItem, &pControl->GetPos()) ) continue;
						CRenderClip::UseOldClipBegin(hDC, childClip);
						pControl->DoPaint(hDC, rcPaint);
						CRenderClip::UseOldClipEnd(hDC, childClip);
					}
					else {
						if( !::IntersectRect(&rcTemp, &rc, &pControl->GetPos()) ) continue;
						pControl->DoPaint(hDC, rcPaint);
					}
				}
			}
		}

		if( m_pVerticalScrollBar != NULL && m_pVerticalScrollBar->IsVisible() ) {
			if( ::IntersectRect(&rcTemp, &rcPaint, &m_pVerticalScrollBar->GetPos()) ) {
				m_pVerticalScrollBar->DoPaint(hDC, rcPaint);
			}
		}

		if( m_pHorizontalScrollBar != NULL && m_pHorizontalScrollBar->IsVisible() ) {
			if( ::IntersectRect(&rcTemp, &rcPaint, &m_pHorizontalScrollBar->GetPos()) ) {
				m_pHorizontalScrollBar->DoPaint(hDC, rcPaint);
			}
		}
	}
开发者ID:Crawping,项目名称:IocpServerClient_Side,代码行数:62,代码来源:UIContainer.cpp


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