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


C++ CBCGPBaseRibbonElement::IsSeparator方法代码示例

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


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

示例1: OnAdd

//**********************************************************************
void CBCGPRibbonCustomizeQATPage::OnAdd() 
{
	CBCGPBaseRibbonElement* pCmd = m_wndCommandsList.GetSelected ();
	if (pCmd == NULL)
	{
		return;
	}

	ASSERT_VALID (pCmd);

	if (pCmd->IsSeparator () && m_wndQATList.GetCount () == 0)
	{
		// Don't add separator to the empty QAT
		MessageBeep ((UINT)-1);
		return;
	}
	
	if (!m_wndQATList.AddCommand (pCmd, TRUE, FALSE))
	{
		return;
	}

	int nSel = m_wndCommandsList.GetCurSel ();
	if (nSel < m_wndCommandsList.GetCount () - 1)
	{
		m_wndCommandsList.SetCurSel (nSel + 1);
	}

	OnSelchangeQATCommands();
	OnSelchangeCommandsList();
}
开发者ID:iclosure,项目名称:jframework,代码行数:32,代码来源:BCGPRibbonCustomizeQATPage.cpp

示例2: OnAfterChangeRect

//********************************************************************************
void CBCGPRibbonButtonsGroup::OnAfterChangeRect (CDC* pDC)
{
	ASSERT_VALID (this);

	BOOL bIsFirst = TRUE;

	const BOOL bIsOnStatusBar = IsStatusBarMode();
	const BOOL bIsQATOnBottom = IsQAT () && !m_pRibbonBar->IsQuickAccessToolbarOnTop ();

	const int nMarginX = IsQAT () ? 2 : 0;
	const int nMarginTop = bIsQATOnBottom ? 2 : bIsOnStatusBar ? 1 : 0;
	const int nMarginBottom = (IsQAT () || bIsOnStatusBar) ? 1 : 0;

	const int nButtonHeight = m_rect.Height () - nMarginTop - nMarginBottom;

	CRect rectGroup = m_rect;

	if (!IsQAT() && !bIsOnStatusBar && m_pParentMenu == NULL)
	{
		rectGroup.DeflateRect(CBCGPVisualManager::GetInstance ()->GetRibbonButtonsGroupHorzMargin(), 0);
	}

	int x = rectGroup.left + nMarginX;

	int nCustomizeButtonIndex = -1;

	if (IsQAT () && m_arButtons.GetSize () > 0)
	{
		//---------------------------------------------
		// Last button is customize - it always visible.
		// Leave space for it:
		//---------------------------------------------
		nCustomizeButtonIndex = (int) m_arButtons.GetSize () - 1;

		CBCGPBaseRibbonElement* pButton = m_arButtons [nCustomizeButtonIndex];
		ASSERT_VALID (pButton);

		CSize sizeButton = pButton->GetSize (pDC);
		rectGroup.right -= sizeButton.cx;
	}

	BOOL bHasHiddenItems = FALSE;

	for (int i = 0; i < m_arButtons.GetSize (); i++)
	{
		CBCGPBaseRibbonElement* pButton = m_arButtons [i];
		ASSERT_VALID (pButton);

		pButton->m_bShowGroupBorder = TRUE;

		if (pButton->m_pRibbonBar != NULL && 
			!pButton->m_pRibbonBar->IsShowGroupBorder (this))
		{
			pButton->m_bShowGroupBorder = FALSE;
		}

		if (m_rect.IsRectEmpty ())
		{
			pButton->m_rect = CRect (0, 0, 0, 0);
			pButton->OnAfterChangeRect (pDC);
			continue;
		}

		BOOL bIsLast = i == m_arButtons.GetSize () - 1;

		pButton->SetParentCategory (m_pParent);

		CSize sizeButton = pButton->GetSize (pDC);
		sizeButton.cy = i != nCustomizeButtonIndex ? nButtonHeight : nButtonHeight - 1;

		const int y = i != nCustomizeButtonIndex ? rectGroup.top + nMarginTop : rectGroup.top;

		pButton->m_rect = CRect (CPoint (x, y), sizeButton);

		const BOOL bIsHiddenSeparator = bHasHiddenItems && pButton->IsSeparator ();

		if ((pButton->m_rect.right > rectGroup.right || bIsHiddenSeparator) &&
			i != nCustomizeButtonIndex)
		{
			pButton->m_rect = CRect (0, 0, 0, 0);
			bHasHiddenItems = TRUE;
		}
		else
		{
			x += sizeButton.cx;
		}

		pButton->OnAfterChangeRect (pDC);

		if (bIsFirst && bIsLast)
		{
			pButton->m_Location = RibbonElementSingleInGroup;
		}
		else if (bIsFirst)
		{
			pButton->m_Location = RibbonElementFirstInGroup;
		}
		else if (bIsLast)
		{
//.........这里部分代码省略.........
开发者ID:iclosure,项目名称:jframework,代码行数:101,代码来源:BCGPRibbonButtonsGroup.cpp


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