本文整理汇总了C++中SmartPointer::IsPartVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartPointer::IsPartVisible方法的具体用法?C++ SmartPointer::IsPartVisible怎么用?C++ SmartPointer::IsPartVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartPointer
的用法示例。
在下文中一共展示了SmartPointer::IsPartVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PageActivated
void WWinPartService::PageActivated(SmartPointer<IWorkbenchPage> newPage)
{
// Optimize.
if (newPage == activePage)
{
return;
}
// Fire events in the following order:
// 1. For each open part in the new page, open it and then (if applicable) make it visible
// 2. Deactivate old active part
// 3. Activate the new active part
// 4. For each open part in the old page, make it invisible then close it
// Hook listener on the new page.
if (newPage)
{
std::vector<IWorkbenchPartReference::Pointer> refs(newPage.Cast<
WorkbenchPage> ()->GetOpenParts());
for (std::size_t i = 0; i < refs.size(); i++)
{
IWorkbenchPartReference::Pointer reference = refs[i];
partService.FirePartOpened(reference);
IWorkbenchPart::Pointer part = reference->GetPart(false);
if (part && newPage->IsPartVisible(part))
{
partService.FirePartVisible(reference);
}
}
partService.SetActivePart(newPage->GetActivePartReference());
selectionService.SetActivePart(newPage->GetActivePart());
}
else
{
partService.SetActivePart(IWorkbenchPartReference::Pointer(0));
selectionService.SetActivePart(IWorkbenchPart::Pointer(0));
}
// Unhook listener from the old page.
Reset();
// Update active page.
activePage = newPage.GetPointer();
if (newPage)
{
newPage->AddPartListener(partListener);
}
}