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


C++ WWidget::parent方法代码示例

本文整理汇总了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;
}
开发者ID:bytemaster,项目名称:wt-1,代码行数:11,代码来源:WWidget.C

示例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_);
}
开发者ID:AlexanderKotliar,项目名称:wt,代码行数:18,代码来源:WMenuItem.C

示例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;
}
开发者ID:,项目名称:,代码行数:43,代码来源:


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