コード例 #1
0
void CXTPDockingPaneTabbedContainer::OnTabsChanged()
{
	if (!m_hWnd)
		return;

	m_nLockReposition += 1;

	DeleteAllItems();

	m_bCloseItemButton = GetDockingPaneManager()->m_bShowCloseTabButton;

	POSITION pos = GetHeadPosition();
	while (pos)
	{
		CXTPDockingPane* pPane = (CXTPDockingPane*)GetNext(pos);

		CXTPTabManagerItem* pItem = AddItem(GetItemCount());
		if (m_pSelectedPane == pPane) SetSelectedItem(pItem);

		pItem->SetCaption(pPane->GetTabCaption());
		pItem->SetColor(pPane->GetItemColor());
		pItem->SetTooltip(pPane->GetTitle());
		pItem->SetEnabled(pPane->GetEnabled() & xtpPaneEnableClient);
		pItem->SetClosable((pPane->GetOptions() & xtpPaneNoCloseable) == 0);

		pItem->SetData((DWORD_PTR)pPane);
	}
	//////////////////////////////////////////////////////////////////////////

	m_pCaptionButtons->CheckForMouseOver(CPoint(-1, -1));

	m_nLockReposition -= 1;
}
コード例 #2
0
void CXTPPropertyPageTabNavigator::OnPageChanged()
{
	DeleteAllItems();

	for (int i = 0; i < m_pSheet->GetPageCount(); i++)
	{
		CXTPPropertyPage* pPage = m_pSheet->GetPage(i);

		CString strCaption = pPage->GetCaption();

		CXTPTabManagerItem* pItem = InsertItem(i, strCaption);
		pItem->SetData((DWORD_PTR)pPage);
		pPage->m_dwData = (DWORD_PTR)pItem;
	}
}