本文整理汇总了C++中CBCGPRibbonBar::GetWindowRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPRibbonBar::GetWindowRect方法的具体用法?C++ CBCGPRibbonBar::GetWindowRect怎么用?C++ CBCGPRibbonBar::GetWindowRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPRibbonBar
的用法示例。
在下文中一共展示了CBCGPRibbonBar::GetWindowRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClick
virtual void OnClick (CPoint /*point*/)
{
CBCGPBaseRibbonElement* pElement = (CBCGPBaseRibbonElement*) m_dwData;
ASSERT_VALID (pElement);
pElement->SetVisible (!pElement->IsVisible ());
Redraw ();
CBCGPRibbonBar* pRibbonStatusBar = pElement->GetParentRibbonBar ();
ASSERT_VALID (pRibbonStatusBar);
pRibbonStatusBar->RecalcLayout ();
pRibbonStatusBar->RedrawWindow ();
CFrameWnd* pParentFrame = pRibbonStatusBar->GetParentFrame ();
ASSERT_VALID (pParentFrame);
pParentFrame->RedrawWindow (NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
CRect rectScreen;
pRibbonStatusBar->GetWindowRect (&rectScreen);
CBCGPPopupMenu::UpdateAllShadows (rectScreen);
}
示例2: OnShow
//**********************************************************************
void CBCGPToolTipCtrl::OnShow(NMHDR* /*pNMHDR*/, LRESULT* pResult)
{
*pResult = 0;
if (m_Params.m_bVislManagerTheme)
{
CBCGPVisualManager::GetInstance ()->GetToolTipParams (m_Params);
m_Params.m_bVislManagerTheme = TRUE;
}
if (m_Params.m_bBallonTooltip)
{
return;
}
CPoint ptCursor;
::GetCursorPos (&ptCursor);
GetHotButton ();
m_sizeImage = m_Params.m_bDrawIcon ? GetIconSize () : CSize (0, 0);
m_ptMargin = CPoint (6, 4);
m_ptMargin.x += m_Params.m_nPaddingX;
m_ptMargin.y += m_Params.m_nPaddingY;
CRect rectMargin;
GetMargin (rectMargin);
CRect rectText;
GetClientRect (rectText);
CClientDC dc (this);
CSize sizeText = OnDrawLabel (&dc, rectText, TRUE);
int cx = sizeText.cx;
int cy = sizeText.cy;
CSize sizeDescr (0, 0);
if (!m_Params.m_bDrawDescription || m_strDescription.IsEmpty ())
{
cy = max (cy, m_sizeImage.cy);
}
else
{
sizeDescr = OnDrawDescription (&dc, rectText, TRUE);
cy += sizeDescr.cy + 2 * m_ptMargin.y;
cx = max (cx, sizeDescr.cx);
cy = max (cy, m_sizeImage.cy);
}
if (m_sizeImage.cx > 0 && m_Params.m_bDrawIcon)
{
cx += m_sizeImage.cx + m_ptMargin.x;
}
cx += 2 * m_ptMargin.x;
cy += 2 * m_ptMargin.y;
int nFixedWidth = GetFixedWidth ();
if (nFixedWidth > 0 && sizeDescr != CSize (0, 0))
{
cx = max (cx, nFixedWidth);
}
CRect rectWindow;
GetWindowRect (rectWindow);
int x = rectWindow.left;
int y = rectWindow.top;
if (m_ptLocation != CPoint (-1, -1))
{
x = m_ptLocation.x;
y = m_ptLocation.y;
*pResult = 1;
}
CRect rectScreen;
MONITORINFO mi;
mi.cbSize = sizeof (MONITORINFO);
if (GetMonitorInfo (MonitorFromPoint (rectWindow.TopLeft (), MONITOR_DEFAULTTONEAREST),
&mi))
{
rectScreen = mi.rcWork;
}
else
{
::SystemParametersInfo (SPI_GETWORKAREA, 0, &rectScreen, 0);
}
int nBottom = max (
ptCursor.y + cy + ::GetSystemMetrics (SM_CYCURSOR),
y + cy + 2);
//.........这里部分代码省略.........