本文整理汇总了C++中WWidget::parent方法的典型用法代码示例。如果您正苦于以下问题:C++ WWidget::parent方法的具体用法?C++ WWidget::parent怎么用?C++ WWidget::parent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WWidget
的用法示例。
在下文中一共展示了WWidget::parent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: containsExposed
bool WWidget::containsExposed(WWidget *w) const
{
if (w == this)
return true;
for (WWidget *p = w; p; p = p->parent())
if (p == this)
return true;
return false;
}
示例2: move
std::unique_ptr<WWidget> WMenuItem::removeContents()
{
auto contents = oContents_.get();
oContents_.reset();
WWidget *c = contentsInStack();
if (c) {
/* Remove from stack */
std::unique_ptr<WWidget> w = c->parent()->removeWidget(c);
if (oContentsContainer_)
return oContentsContainer_->removeWidget(contents);
else
return w;
} else
return std::move(uContents_);
}
示例3: isExposed
bool WPopupMenu::isExposed(WWidget *w)
{
/*
* w is the popupmenu or contained by the popup menu
*/
if (WCompositeWidget::isExposed(w))
return true;
if (w == WApplication::instance()->root())
return true;
/*
* w is the location at which the popup was positioned, we ignore
* events on this widget without closing the popup
*/
if (w == location_)
return false;
/*
* w is a contained popup menu or contained by a sub-popup menu
*/
for (int i = 0; i < count(); ++i) {
WPopupMenuItem *item = itemAt(i);
if (item->popupMenu())
if (item->popupMenu()->isExposed(w))
return true;
}
// Signal outside of the menu:
// - signal of a widget that is an ancestor of location_: ignore it
// - otherwise: close the menu and let it be handled.
if (location_) {
for (WWidget *p = location_->parent(); p; p = p->parent())
if (w == p)
return false;
}
if (!parentItem_) {
done();
return true;
} else
return false;
}