Ejemplo n.º 1
0
DomElement *StdWidgetItemImpl::createDomElement(bool fitWidth, bool fitHeight,
						WApplication *app)
{
  WWidget *w = item_->widget();

  w->setInline(false);

  DomElement *d = w->createSDomElement(app);
  DomElement *result = d;

  if (app->environment().agentIsIElt(9) &&
      (d->type() == DomElement_TEXTAREA || d->type() == DomElement_SELECT
       || d->type() == DomElement_INPUT || d->type() == DomElement_BUTTON)) {
    d->removeProperty(PropertyStyleDisplay);
  }

  // FIXME IE9 does border-box perhaps ?
  if (!app->environment().agentIsIE() && 
      w->javaScriptMember(WWidget::WT_RESIZE_JS).empty() &&
      d->type() != DomElement_TABLE /* buggy in Chrome, see #1856 */ &&
      app->theme()->canBorderBoxElement(*d))
    d->setProperty(PropertyStyleBoxSizing, "border-box");

  return result;
}
Ejemplo n.º 2
0
bool WWidget::isInLayout() const
{
    WWidget *p = parent();
    if (p != 0 &&
            (dynamic_cast<WCompositeWidget *>(p) != 0 ||
             !p->javaScriptMember(WT_RESIZE_JS).empty()))
        return p->isInLayout();

    WContainerWidget *c = dynamic_cast<WContainerWidget *>(p);

    return c != 0 && c->layout() != 0;
}