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


C++ CBCGPGridRow::GetParent方法代码示例

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


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

示例1: GetNewPanelIndex

//**********************************************************************
int CBCGPRibbonCustomizeRibbonPage::GetNewPanelIndex()
{
#ifndef BCGP_EXCLUDE_GRID_CTRL
	// Calculate destination index:

	if (m_pSelCategoryDest != NULL)
	{
		int nVisiblePanels = 0;

		for (int i = 0; i < m_pSelCategoryDest->GetPanelCount(); i++)
		{
			CBCGPRibbonPanel* pPanel = m_pSelCategoryDest->GetPanel(i);
			if (pPanel != NULL && !pPanel->m_bToBeDeleted)
			{
				nVisiblePanels++;
			}
		}

		return nVisiblePanels - 1;
	}

	CBCGPRibbonPanel* pCurrPanelDest = m_pSelPanelDest;
	if (pCurrPanelDest == NULL && m_pSelElemDest != NULL)
	{
		pCurrPanelDest = m_pSelElemDest->GetParentPanel();
	}

	if (pCurrPanelDest != NULL)
	{
		for (int i = 0; i < m_wndRibbonTreeDest.GetRowCount(); i++)
		{
			CBCGPGridRow* pRow = m_wndRibbonTreeDest.GetRow(i);
			ASSERT_VALID(pRow);

			if (pRow->GetParent() != NULL && pRow->IsGroup())
			{
				if (pRow->GetData() == (DWORD_PTR)pCurrPanelDest)
				{
					int nCurIndex = m_CustomizationData.GetPanelIndex(pCurrPanelDest);
					ASSERT(nCurIndex >= 0);

					return nCurIndex + 1;
				}
			}
		}
	}
#endif
	return -1;
}
开发者ID:iclosure,项目名称:jframework,代码行数:50,代码来源:BCGPRibbonCustomizePage.cpp

示例2: GetNewTabIndex

//**********************************************************************
int CBCGPRibbonCustomizeRibbonPage::GetNewTabIndex()
{
#ifndef BCGP_EXCLUDE_GRID_CTRL
	// Calculate destination index:
	CBCGPRibbonCategory* pCurrCategoryDest = m_pSelCategoryDest;
	if (pCurrCategoryDest == NULL)
	{
		if (m_pSelPanelDest != NULL)
		{
			pCurrCategoryDest = m_pSelPanelDest->GetParentCategory();
		}
		else if (m_pSelElemDest != NULL)
		{
			pCurrCategoryDest = m_pSelElemDest->GetParentCategory();
		}
	}

	if (pCurrCategoryDest != NULL)
	{
		int nIndex = 0;

		for (int i = 0; i < m_wndRibbonTreeDest.GetRowCount(); i++)
		{
			CBCGPGridRow* pRow = m_wndRibbonTreeDest.GetRow(i);
			ASSERT_VALID(pRow);

			if (pRow->GetParent() == NULL)
			{
				if (pRow->GetData() == (DWORD_PTR)pCurrCategoryDest)
				{
					return nIndex;
				}

				nIndex++;
			}
		}
	}
#endif

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

示例3: PreTranslateMessage

BOOL CIfExpressEditorDlg::PreTranslateMessage(MSG* pMsg)
{
	// TODO: 在此添加专用代码和/或调用基类
	ASSERT(pMsg != NULL);
	if (pMsg->message==WM_LBUTTONDOWN)
	{
		ZTools::WriteZToolsFormatLog("WM_LBUTTONDOWN");
		if (m_wndTreeDropDown.IsWindowVisible())
		{
			m_wndTreeDropDown.ShowWindow(SW_HIDE);
			ZTools::WriteZToolsFormatLog("鼠标点击隐藏树,失去焦点后");
			return TRUE; // 本次点击只隐藏树
		}
		int iTickTime = GetTickCount();
		int iGapTime  = iTickTime - m_iTickCountTreeLeaveFocus;
		if (CPoint(pMsg->pt) == m_PointTreeLeaveFocus && iGapTime < 100)
		{
			ZTools::WriteZToolsFormatLog("鼠标点击使得树失去焦点而隐藏,失去焦点前");
			return TRUE; //屏蔽隐藏树前的点击事件
		}

		CRect rect;
		bool bShowTree = FALSE;
		CCxStructTreeNode *pNodeCur = NULL;
		CString strArrID;
		CString strTextArry;
		if ( pMsg->hwnd == m_EditLeft.GetSafeHwnd())
		{
			bShowTree = TRUE;
			m_EditLeft.GetWindowRect(&rect);
			pNodeCur = m_pNodeLeft;
			if (!m_Express.m_LeftParam.strArry.IsEmpty())
			{
				strArrID = m_Express.m_LeftParam.strID;
				m_EditLeftArry.GetWindowText(strTextArry);
			}
			m_iFocusEidtPCtrlID = IDC_EDIT_LEFT;
		}
		else if (pMsg->hwnd == m_EditRight.GetSafeHwnd())
		{
			if (pMsg->hwnd == m_EditRight.GetSafeHwnd() && m_ComboRightType.GetCurSel()==TP_CONST)
				bShowTree = FALSE;
			else
			{
				bShowTree = TRUE;
				m_EditRight.GetWindowRect(&rect);
				pNodeCur = m_pNodeRight;
				if (!m_Express.m_RightParam.strArry.IsEmpty())
				{
					strArrID = m_Express.m_RightParam.strID;
					m_EditRightArry.GetWindowText(strTextArry);
				}
			}
			m_iFocusEidtPCtrlID = IDC_EDIT_RIGHT;
		}
	
		if (bShowTree)
		{
			if (pNodeCur)
			{
				if (!strTextArry.IsEmpty())
				{
					CCxStructTreeNode *pDefaultSel = FindArryElementNode(strArrID,strTextArry);
					if (pDefaultSel)
					 pNodeCur = pDefaultSel;
				}

				CBCGPGridRow* pSel = m_wndTreeDropDown.m_IfEditTree.FindRowByData((DWORD_PTR)pNodeCur);
				m_wndTreeDropDown.m_IfEditTree.SetCurSel(pSel);
				m_wndTreeDropDown.m_IfEditTree.UpdateSelToParamName(); //选中树的第一列
				if (pSel)
				{
					ASSERT_VALID (pSel);
					CBCGPGridRow* pParent = pSel;
					while ((pParent = pParent->GetParent ())!= NULL &&pParent->GetSubItemsCount()>0)
					{
						ASSERT_VALID (pParent);
						pParent->Expand (TRUE);
					}
					m_wndTreeDropDown.m_IfEditTree.EnsureVisible (pSel, TRUE); // 保证当前选中行可见
				}
			}
			else
			{
				m_wndTreeDropDown.m_IfEditTree.SelectRow(-1);
				m_wndTreeDropDown.m_IfEditTree.ExpandAll(FALSE);
			}
			m_wndTreeDropDown.SetWindowPos(&wndTopMost,rect.left,rect.bottom,0,0,SWP_NOSIZE|SWP_SHOWWINDOW);
			m_wndTreeDropDown.m_IfEditTree.SetFocus();
			return TRUE;
		}
	}
	return CCxBCGPDialog::PreTranslateMessage(pMsg);
}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:94,代码来源:IfExpressEditorDlg.cpp

示例4: OnRemove

//**********************************************************************
void CBCGPRibbonCustomizeRibbonPage::OnRemove() 
{
#ifndef BCGP_EXCLUDE_GRID_CTRL
	CBCGPGridRow* pRow = m_wndRibbonTreeDest.GetCurSel();
	if (pRow == NULL)
	{
		ASSERT(FALSE);
		return;
	}

	m_bDontProcessSelChanged = TRUE;

	ASSERT_VALID(pRow);

	CBCGPGridRow* pParentRow = pRow->GetParent();

	if (m_pSelCategoryDest != NULL)
	{
		ASSERT_VALID(m_pSelCategoryDest);
		ASSERT(m_pSelCategoryDest->IsCustom());

		m_pSelCategoryDest->m_bToBeDeleted = TRUE;
		m_CustomizationData.RemoveCustomTab(*m_pSelCategoryDest);
	}
	else if (m_pSelPanelDest != NULL)
	{
		ASSERT_VALID(m_pSelPanelDest);

		if (m_pSelPanelDest->IsCustom())
		{
			m_pSelPanelDest->m_bToBeDeleted = TRUE;
			m_CustomizationData.RemoveCustomPanel(*m_pSelPanelDest);
		}
		else
		{
			m_CustomizationData.ShowPanel(m_pSelPanelDest, FALSE);
		}
	}
	else if (m_pSelElemDest != NULL)
	{
		ASSERT_VALID(m_pSelElemDest);

		m_CustomizationData.RemoveCustomElement(*m_pSelElemDest);

		if (m_pSelElemDest->m_bIsNew)
		{
			CBCGPRibbonPanel* pPanel = m_pSelElemDest->GetParentPanel();
			ASSERT_VALID(pPanel);

			int nIndex = pPanel->GetIndex(m_pSelElemDest);
			ASSERT(nIndex >= 0);

			pPanel->Remove(nIndex);
		}
	}
	else
	{
		ASSERT(FALSE);
		m_bDontProcessSelChanged = FALSE;
		return;
	}

	int id = pRow->GetRowId();
	
	BOOL bDisableDown = FALSE;
	BOOL bDisableUp = FALSE;

	m_wndRibbonTreeDest.SetRedraw(FALSE);

	if (!m_wndRibbonTreeDest.MoveSelection(TRUE))
	{
		bDisableDown = TRUE;
		bDisableUp = !m_wndRibbonTreeDest.MoveSelection(FALSE);
	}

	CBCGPGridRow* pSelRow = m_wndRibbonTreeDest.GetCurSel();
	m_wndRibbonTreeDest.SetCurSel(NULL, FALSE);

	m_wndRibbonTreeDest.RemoveRow(id);
	m_wndRibbonTreeDest.AdjustLayout ();

	m_bDontProcessSelChanged = FALSE;

	if (bDisableDown && bDisableUp)
	{
		m_wndRibbonTreeDest.SetCurSel(pParentRow);
	}
	else
	{
		m_wndRibbonTreeDest.SetCurSel(pSelRow);
	}
	
	m_wndRibbonTreeDest.SetRedraw();
	m_wndRibbonTreeDest.RedrawWindow();

#endif
}
开发者ID:iclosure,项目名称:jframework,代码行数:98,代码来源:BCGPRibbonCustomizePage.cpp


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