本文整理汇总了C++中Accessible::RelationByType方法的典型用法代码示例。如果您正苦于以下问题:C++ Accessible::RelationByType方法的具体用法?C++ Accessible::RelationByType怎么用?C++ Accessible::RelationByType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Accessible
的用法示例。
在下文中一共展示了Accessible::RelationByType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChildCount
Relation
XULGroupboxAccessible::RelationByType(RelationType aType)
{
Relation rel = AccessibleWrap::RelationByType(aType);
if (aType != RelationType::LABELLED_BY)
return rel;
// The label for xul:groupbox is generated from xul:label that is
// inside the anonymous content of the xul:caption.
// The xul:label has an accessible object but the xul:caption does not
uint32_t childCount = ChildCount();
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
Accessible* childAcc = GetChildAt(childIdx);
if (childAcc->Role() == roles::LABEL) {
// Ensure that it's our label
Relation reverseRel = childAcc->RelationByType(RelationType::LABEL_FOR);
Accessible* testGroupbox = nullptr;
while ((testGroupbox = reverseRel.Next()))
if (testGroupbox == this) {
// The <label> points back to this groupbox
rel.AppendTarget(childAcc);
}
}
}
return rel;
}
示例2: while
bool
DocAccessibleChild::RecvRelationByType(const uint64_t& aID,
const uint32_t& aType,
nsTArray<uint64_t>* aTargets)
{
Accessible* acc = mDoc->GetAccessibleByUniqueID((void*)aID);
if (!acc)
return false;
auto type = static_cast<RelationType>(aType);
Relation rel = acc->RelationByType(type);
while (Accessible* target = rel.Next())
aTargets->AppendElement(reinterpret_cast<uintptr_t>(target));
return true;
}