本文整理汇总了C++中CBCGPDrawManager::DrawRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPDrawManager::DrawRect方法的具体用法?C++ CBCGPDrawManager::DrawRect怎么用?C++ CBCGPDrawManager::DrawRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPDrawManager
的用法示例。
在下文中一共展示了CBCGPDrawManager::DrawRect方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dm
//***********************************************************************************
void CBCGPVisualManagerVS2005::OnFillHighlightedArea (CDC* pDC, CRect rect,
CBrush* pBrush, CBCGPToolbarButton* pButton)
{
if (pButton != NULL &&
(m_CurrAppTheme == WinXpTheme_Blue || m_CurrAppTheme == WinXpTheme_Olive))
{
ASSERT_VALID (pButton);
CBCGPToolbarMenuButton* pMenuButton =
DYNAMIC_DOWNCAST (CBCGPToolbarMenuButton, pButton);
BOOL bIsPopupMenu = pMenuButton != NULL &&
pMenuButton->GetParentWnd () != NULL &&
pMenuButton->GetParentWnd ()->IsKindOf (RUNTIME_CLASS (CBCGPPopupMenuBar));
if (bIsPopupMenu &&
(pButton->m_nStyle & TBBS_CHECKED) &&
pBrush == &m_brHighlightDn)
{
if (CBCGPToolBarImages::m_bIsDrawOnGlass)
{
CBCGPDrawManager dm (*pDC);
dm.DrawRect (rect, m_clrBarBkgnd, (COLORREF)-1);
}
else
{
pDC->FillRect (rect, &m_brMenuItemCheckedHighlight);
}
return;
}
if (pMenuButton != NULL && !bIsPopupMenu && pMenuButton->IsDroppedDown ())
{
if (CBCGPToolBarImages::m_bIsDrawOnGlass)
{
CBCGPDrawManager dm (*pDC);
dm.DrawRect (rect, m_clrBarBkgnd, (COLORREF)-1);
}
else
{
pDC->FillRect (rect, &m_brMenuButtonDroppedDown);
}
return;
}
}
CBCGPVisualManager2003::OnFillHighlightedArea (pDC, rect, pBrush, pButton);
}
示例2: OnDraw
void CPeraProcessDesignerView::OnDraw(CDC* pDC)
{
CPeraProcessDesignerDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CRect rc;
GetWindowRect(&rc);
rc.MoveToXY(0,0);
CBCGPDrawManager dm (*pDC);
dm.DrawRect( rc, g_crBarBorderIn, g_crBarBorderOut );
if ( m_pViewData != NULL )
{
if ( m_pViewData->m_strFlag.CollateNoCase( viewflagModel ) == 0 )
{
//有时候结构树标题栏下边有条边线不绘制问题
if ( theApp.m_pBarJianmoTree != NULL
&& IsWindow( theApp.m_pBarJianmoTree->GetSafeHwnd() ) )
{
::PostMessage( theApp.m_pBarJianmoTree->GetSafeHwnd(), WM_NCPAINT, 0, 0 );
}
}
}
}
示例3: OnDraw
//*****************************************************************************************
void CBCGPSpinButtonCtrl::OnDraw (CDC* pDC)
{
ASSERT_VALID (this);
ASSERT_VALID (pDC);
CRect rectClient;
GetClientRect (rectClient);
if (GetBuddy ()->GetSafeHwnd () != NULL && (m_bOnGlass || CBCGPToolBarImages::m_bIsDrawOnGlass || m_bVisualManagerStyle))
{
CRect rectBorder (0, 0, 0, 0);
if (GetStyle () & UDS_ALIGNRIGHT)
{
rectBorder = rectClient;
rectClient.DeflateRect (1, 1);
}
else if (GetStyle () & UDS_ALIGNLEFT)
{
rectBorder = rectClient;
rectClient.DeflateRect (1, 1);
}
if (!rectBorder.IsRectEmpty ())
{
visualManager->OnDrawControlBorder (
pDC, rectBorder, this, CBCGPToolBarImages::m_bIsDrawOnGlass || m_bOnGlass);
}
}
if (CBCGPToolBarImages::m_bIsDrawOnGlass || m_bOnGlass)
{
CBCGPDrawManager dm (*pDC);
dm.DrawRect (rectClient, globalData.clrWindow, (COLORREF)-1);
}
else
{
pDC->FillRect (rectClient, &globalData.brWindow);
}
int nState = 0;
if (m_bIsButtonPressedUp)
{
nState |= SPIN_PRESSEDUP;
}
if (m_bIsButtonPressedDown)
{
nState |= SPIN_PRESSEDDOWN;
}
if (m_bIsButtonHighligtedUp)
{
nState |= SPIN_HIGHLIGHTEDUP;
}
if (m_bIsButtonHighligtedDown)
{
nState |= SPIN_HIGHLIGHTEDDOWN;
}
if (!IsWindowEnabled ())
{
nState |= SPIN_DISABLED;
}
CBCGPDrawOnGlass dog (m_bOnGlass || CBCGPToolBarImages::m_bIsDrawOnGlass);
visualManager->OnDrawSpinButtons (
pDC, rectClient, nState, (GetStyle() & UDS_HORZ) == UDS_HORZ, this);
}
示例4: OnPaint
//**************************************************************************
void CBCGPComboBox::OnPaint()
{
#ifndef _BCGSUITE_
if (globalData.bIsWindows9x)
{
Default();
return;
}
#endif
if ((GetStyle () & 0x0003L) == CBS_SIMPLE)
{
Default ();
return;
}
if (!m_bVisualManagerStyle && !m_bOnGlass)
{
Default ();
return;
}
CPaintDC dc(this); // device context for painting
BYTE alpha = 0;
if (m_bOnGlass)
{
alpha = 255;
}
CBCGPMemDC memDC (dc, this, alpha);
CDC* pDC = &memDC.GetDC ();
CRect rectClient;
GetClientRect (rectClient);
CBCGPDrawManager dm (*pDC);
dm.DrawRect (rectClient, globalData.clrWindow, (COLORREF)-1);
SendMessage (WM_PRINTCLIENT, (WPARAM) pDC->GetSafeHdc (), (LPARAM) PRF_CLIENT);
const int cxDropDown = ::GetSystemMetrics (SM_CXVSCROLL) + 4;
m_rectBtn = rectClient;
m_rectBtn.left = m_rectBtn.right - cxDropDown;
m_rectBtn.DeflateRect (2, 2);
CBCGPDrawOnGlass dog (m_bOnGlass);
CBCGPToolbarComboBoxButton buttonDummy;
#ifndef _BCGSUITE_
buttonDummy.m_bIsCtrl = TRUE;
CBCGPVisualManager::GetInstance ()->OnDrawComboDropButton (
pDC, m_rectBtn, !IsWindowEnabled (), m_bIsDroppedDown,
m_bIsButtonHighlighted,
&buttonDummy);
#else
CMFCVisualManager::GetInstance ()->OnDrawComboDropButton (
pDC, m_rectBtn, !IsWindowEnabled (), m_bIsDroppedDown,
m_bIsButtonHighlighted,
&buttonDummy);
#endif
dm.DrawRect (rectClient, (COLORREF)-1, globalData.clrBarShadow);
rectClient.DeflateRect (1, 1);
dm.DrawRect (rectClient, (COLORREF)-1, globalData.clrWindow);
}
示例5: OnDraw
//*****************************************************************************************
void CBCGPColorButton::OnDraw (CDC* pDC, const CRect& rect, UINT uiState)
{
ASSERT_VALID (pDC);
if (m_pPalette == NULL)
{
RebuildPalette (NULL);
}
CPalette* pCurPalette = pDC->SelectPalette (m_pPalette, FALSE);
pDC->RealizePalette();
CSize sizeArrow = CBCGPMenuImages::Size ();
CRect rectColor = rect;
rectColor.right -= sizeArrow.cx + nImageHorzMargin;
CRect rectArrow = rect;
rectArrow.left = rectColor.right;
COLORREF color = m_Color;
if (color == (COLORREF) -1) // Automatic
{
//---------------------------
// Draw automatic text label:
//---------------------------
color = m_ColorAutomatic;
if (!m_strAutoColorText.IsEmpty ())
{
rectColor.right = rectColor.left + rectColor.Height ();
CRect rectText = rect;
rectText.left = rectColor.right;
rectText.right = rectArrow.left;
CFont* pOldFont = SelectFont (pDC);
ASSERT(pOldFont != NULL);
pDC->SetBkMode (TRANSPARENT);
pDC->SetTextColor (globalData.clrBtnText);
UINT nFormat = DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS;
if (m_bOnGlass)
{
CBCGPVisualManager::GetInstance ()->DrawTextOnGlass (pDC,
m_strAutoColorText, rectText, nFormat, 0);
}
else
{
pDC->DrawText (m_strAutoColorText, rectText, nFormat);
}
pDC->SelectObject (pOldFont);
}
}
//----------------
// Draw color box:
//----------------
rectColor.DeflateRect (2, 2);
if (m_bOnGlass)
{
CBCGPDrawManager dm (*pDC);
dm.DrawRect (rectColor, (COLORREF)-1, globalData.clrBtnDkShadow);
}
else
{
pDC->Draw3dRect (rectColor, globalData.clrBtnHilite, globalData.clrBtnHilite);
rectColor.DeflateRect (1, 1);
pDC->Draw3dRect (rectColor, globalData.clrBtnDkShadow, globalData.clrBtnDkShadow);
}
rectColor.DeflateRect (1, 1);
if (color != (COLORREF)-1 && (uiState & ODS_DISABLED) == 0)
{
if (globalData.m_nBitsPerPixel == 8) // 256 colors
{
ASSERT_VALID (m_pPalette);
color = PALETTEINDEX (m_pPalette->GetNearestPaletteIndex (color));
}
if (m_bOnGlass)
{
CBCGPDrawManager dm (*pDC);
dm.DrawRect (rectColor, color, (COLORREF)-1);
}
else
{
CBrush br (color);
pDC->FillRect (rectColor, &br);
}
}
//----------------------
// Draw drop-down arrow:
//.........这里部分代码省略.........
示例6: OnPaint
void CKofBCGPFontComboBox::OnPaint()
{
if ((GetStyle () & 0x0003L) == CBS_SIMPLE)
{
Default ();
return;
}
if (!m_bVisualManagerStyle && !m_bOnGlass)
{
Default ();
return;
}
CPaintDC dc(this); // device context for painting
BYTE alpha = 0;
if (m_bOnGlass)
{
alpha = 255;
}
CBCGPMemDC memDC (dc, this, alpha);
CDC* pDC = &memDC.GetDC ();
CRect rectClient;
GetClientRect (rectClient);
CBCGPDrawManager dm (*pDC);
dm.DrawRect (rectClient, globalData.clrWindow, (COLORREF)-1);
// 得注释掉这句话
// SendMessage (WM_PRINTCLIENT, (WPARAM) pDC->GetSafeHdc (), (LPARAM) PRF_CLIENT);
const int cxDropDown = ::GetSystemMetrics (SM_CXVSCROLL) + 4;
int nCurSel = GetCurSel();
if (CB_ERR != nCurSel)
{
if (m_Images.GetSafeHandle () == NULL)
{
CBCGPLocalResource locaRes;
m_Images.Create (IDB_BCGBARRES_FONT, nImageWidth, 0, RGB (255, 255, 255));
}
CFont fontSelected;
CFont* pOldFont = NULL;
CRect rc(rectClient);
rc.right -= cxDropDown;
CBCGPFontDesc* pDesc = (CBCGPFontDesc*)GetItemDataPtr(nCurSel);
if (pDesc != NULL)
{
if (pDesc->m_nType & (DEVICE_FONTTYPE | TRUETYPE_FONTTYPE))
{
CPoint ptImage (rc.left + 3, rc.top + (rc.Height () - nImageHeight) / 2);
m_Images.Draw (pDC, pDesc->GetImageIndex (), ptImage, ILD_NORMAL);
}
rc.left += nImageWidth + 9;
if (m_bDrawUsingFont && pDesc->m_nCharSet != SYMBOL_CHARSET)
{
LOGFONT lf;
globalData.fontRegular.GetLogFont (&lf);
lstrcpy (lf.lfFaceName, pDesc->m_strName);
if (pDesc->m_nCharSet != DEFAULT_CHARSET)
{
lf.lfCharSet = pDesc->m_nCharSet;
}
if (lf.lfHeight < 0)
{
lf.lfHeight -= 4;
}
else
{
lf.lfHeight += 4;
}
fontSelected.CreateFontIndirect (&lf);
pOldFont = pDC->SelectObject (&fontSelected);
}
}
CString strText;
GetLBText (nCurSel, strText);
pDC->DrawText (strText, rc, DT_SINGLELINE | DT_VCENTER);
if (pOldFont != NULL)
{
pDC->SelectObject (pOldFont);
}
}
m_rectBtn = rectClient;
m_rectBtn.left = m_rectBtn.right - cxDropDown;
m_rectBtn.DeflateRect (2, 2);
CBCGPDrawOnGlass dog (m_bOnGlass);
//.........这里部分代码省略.........