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


C++ CBCGPBaseRibbonElement类代码示例

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


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

示例1: MouseButtonDown

//********************************************************************************
CBCGPBaseRibbonElement* CBCGPRibbonBackstageViewPanel::MouseButtonDown (CPoint point)
{
	CBCGPBaseRibbonElement* pHit = CBCGPRibbonMainPanel::MouseButtonDown (point);
	if (pHit == NULL || pHit->IsDisabled())
	{
		return NULL;
	}

	if (!m_rectPageTransition.IsRectEmpty())
	{
		StopPageTransition();
		OnPageTransitionFinished();

		if (pHit->GetRect().PtInRect(point))
		{
			SelectView(pHit);
			return pHit;
		}

		return NULL;
	}

	m_bSelectedByMouseClick = TRUE;
	SelectView(pHit);

	return pHit;
}
开发者ID:iclosure,项目名称:jframework,代码行数:28,代码来源:BCGPRibbonBackstageViewPanel.cpp

示例2: accDoDefaultAction

//*******************************************************************************
HRESULT CBCGPRibbonTabsGroup::accDoDefaultAction(VARIANT varChild)
{
	if (varChild.vt != VT_I4)
	{
		return E_INVALIDARG;
	}

	if (varChild.lVal != CHILDID_SELF)
	{
		int nIndex = (int)varChild.lVal - 1;
		if (nIndex < 0 || nIndex >= m_arButtons.GetSize())
		{
			return E_INVALIDARG;
		}

		CBCGPBaseRibbonElement* pElem = m_arButtons[nIndex];
		if (pElem != NULL)
		{
			ASSERT_VALID (pElem);

			pElem->OnAccDefaultAction();
			return S_OK;
		}
	}

	return S_FALSE;
}
开发者ID:iclosure,项目名称:jframework,代码行数:28,代码来源:BCGPRibbonButtonsGroup.cpp

示例3: ASSERT_VALID

//********************************************************************************
CSize CBCGPRibbonButtonsGroup::GetRegularSize (CDC* pDC)
{
	ASSERT_VALID (this);

	const BOOL bIsOnStatusBar = IsStatusBarMode();

	CSize size (0, 0);

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

		pButton->SetInitialMode (TRUE);
		pButton->OnCalcTextSize (pDC);

		CSize sizeButton = pButton->GetSize (pDC);
		
		size.cx += sizeButton.cx;
		size.cy = max (size.cy, sizeButton.cy);
	}

	if (bIsOnStatusBar)
	{
		size.cx += 2;
	}

	if (!IsQAT() && !bIsOnStatusBar && m_pParentMenu == NULL)
	{
		size.cx += CBCGPVisualManager::GetInstance ()->GetRibbonButtonsGroupHorzMargin() * 2;
	}

	return size;
}
开发者ID:iclosure,项目名称:jframework,代码行数:35,代码来源:BCGPRibbonButtonsGroup.cpp

示例4: 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

示例5: CreateCategoryBackstage

void CBCGPRibbonConstructor::ConstructCategoryBackstage (CBCGPRibbonBar& bar, const CBCGPRibbonInfo::XCategoryBackstage& info) const
{
	CBCGPRibbonBackstageViewPanel* pPanel = CreateCategoryBackstage (bar, info);
	ASSERT_VALID (pPanel);

	CBCGPRibbonCategory* pCategory = bar.GetBackstageCategory ();
	ASSERT_VALID (pCategory);

	const_cast<CBCGPToolBarImages&>(info.m_SmallImages.m_Image).CopyTo (pCategory->GetSmallImages ());

	int i = 0;
	for (i = 0; i < info.m_arElements.GetSize (); i++)
	{
		if (info.m_arElements[i]->GetElementName ().Compare (CBCGPRibbonInfo::s_szButton_Command) == 0)
		{
			CBCGPBaseRibbonElement* pElement = 
				CreateElement (*(const CBCGPRibbonInfo::XElement*)info.m_arElements[i]);

			if (pElement != NULL)
			{
				ASSERT_VALID (pElement);

				pElement->SetBackstageViewMode ();
				pPanel->CBCGPRibbonMainPanel::Add (pElement);
			}
		}
	}
}
开发者ID:iclosure,项目名称:jframework,代码行数:28,代码来源:BCGPRibbonConstructor.cpp

示例6: OnDraw

	virtual void OnDraw (CDC* pDC)
	{
		ASSERT_VALID (pDC);

		CBCGPBaseRibbonElement* pElement = (CBCGPBaseRibbonElement*) m_dwData;
		ASSERT_VALID (pElement);

		CBCGPToolbarMenuButton dummy;

		dummy.m_strText = m_strText;

		CString strValue = pElement->GetText ();

		if (strValue.GetLength () > nMaxValueLen)
		{
			strValue = strValue.Left (nMaxValueLen - 1);
		}

		if (!strValue.IsEmpty ())
		{
			dummy.m_strText += _T('\t');
			dummy.m_strText += strValue;
		}

		dummy.m_bMenuMode = TRUE;
		dummy.m_pWndParent = GetParentWnd ();

		if (pElement->IsVisible ())
		{
			dummy.m_nStyle |= TBBS_CHECKED;
		}

		dummy.OnDraw (pDC, m_rect, NULL, TRUE, FALSE, m_bIsHighlighted);
	}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:34,代码来源:BCGPRibbonStatusBar.cpp

示例7: ConstructBaseElement

void CBCGPRibbonConstructor::ConstructElement (CBCGPBaseRibbonElement& element, const CBCGPRibbonInfo::XElement& info) const
{
	if (info.GetElementName ().Compare (CBCGPRibbonInfo::s_szButton_Main) == 0 &&
		element.IsKindOf (RUNTIME_CLASS (CBCGPRibbonMainButton)))
	{
		ConstructBaseElement (element, info);

		const CBCGPRibbonInfo::XElementButtonMain& infoElement = 
			(const CBCGPRibbonInfo::XElementButtonMain&)info;

		CBCGPRibbonMainButton* pElement = (CBCGPRibbonMainButton*)&element;
		ASSERT_VALID (pElement);

		const_cast<CBCGPToolBarImages&>(infoElement.m_Image.m_Image).CopyTo (pElement->m_Image);
		const_cast<CBCGPToolBarImages&>(infoElement.m_ImageScenic.m_Image).CopyTo (pElement->m_ImageScenic);
	}
	else if (info.GetElementName ().Compare (CBCGPRibbonInfo::s_szButton_Launch) == 0 &&
			 element.IsKindOf (RUNTIME_CLASS (CBCGPRibbonLaunchButton)))
	{
		ConstructBaseElement (element, info);
	}
	else if (info.GetElementName ().Compare (CBCGPRibbonInfo::s_szGroup) == 0 &&
			 element.IsKindOf (RUNTIME_CLASS (CBCGPRibbonButtonsGroup)))
	{
		const CBCGPRibbonInfo::XElementGroup& infoElement = 
			(const CBCGPRibbonInfo::XElementGroup&)info;

		CBCGPRibbonButtonsGroup* pElement = (CBCGPRibbonButtonsGroup*)&element;
		ASSERT_VALID (pElement);

		const_cast<CBCGPToolBarImages&>(infoElement.m_Images.m_Image).CopyTo (pElement->m_Images);

		for (int i = 0; i < infoElement.m_arButtons.GetSize (); i++)
		{
			CBCGPBaseRibbonElement* pButton = CreateElement 
				(*(const CBCGPRibbonInfo::XElement*)infoElement.m_arButtons[i]);

			if (pButton != NULL)
			{
				ASSERT_VALID (pButton);
				pElement->AddButton (pButton);
			}
		}
	}
	else
	{
		ASSERT (FALSE);
	}
}
开发者ID:iclosure,项目名称:jframework,代码行数:49,代码来源:BCGPRibbonConstructor.cpp

示例8: CopyFrom

//******************************************************************************
void CBCGPRibbonQuickStep::CopyFrom(const CBCGPBaseRibbonElement& src)
{
    ASSERT_VALID(this);

    CBCGPRibbonPaletteIcon::CopyFrom(src);
    m_bIsDisabled = src.IsDisabled();
}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:8,代码来源:BCGPRibbonQuickStepsButton.cpp

示例9: ASSERT_VALID

//******************************************************************************
int CBCGPRibbonCommandsListBox::GetCommandIndex (UINT uiID) const
{
	ASSERT_VALID (this);

	for (int i = 0; i < GetCount (); i++)
	{
		CBCGPBaseRibbonElement* pCommand = (CBCGPBaseRibbonElement*) GetItemData (i);
		ASSERT_VALID (pCommand);

		if (pCommand->GetID () == uiID)
		{
			return i;
		}
	}

	return -1;
}
开发者ID:iclosure,项目名称:jframework,代码行数:18,代码来源:BCGPRibbonCommandsListBox.cpp

示例10: OnSelchangeCommandsList

//**********************************************************************
void CBCGPRibbonCustomizeQATPage::OnSelchangeCommandsList() 
{
	BOOL bEnableAddButton = TRUE;

	CBCGPBaseRibbonElement* pCmd = m_wndCommandsList.GetSelected ();
	if (pCmd == NULL)
	{
		bEnableAddButton = FALSE;
	}
	else
	{
		ASSERT_VALID (pCmd);
		bEnableAddButton = 
			pCmd->GetID () == 0 || m_wndQATList.GetCommandIndex (pCmd->GetID ()) < 0;
	}

	m_wndAdd.EnableWindow (bEnableAddButton);
}
开发者ID:iclosure,项目名称:jframework,代码行数:19,代码来源:BCGPRibbonCustomizeQATPage.cpp


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