Exemple #1
0
void WContainerWidget::removeChild(WWidget *child)
{
  bool ignoreThisChildRemove = false;

  if (transientImpl_) {
    if (Utils::erase(transientImpl_->addedChildren_, child)) {
      /*
       * Child was just added: do not render a child remove, since it
       * is not yet part of the DOM
       */
      ignoreThisChildRemove = true;
    }
  }

#ifndef WT_NO_LAYOUT
  if (layout_) {
    ignoreThisChildRemove = true; // will be re-rendered by layout
    if (layout_->removeWidget(child))
      return;
  }
#endif // WT_NO_LAYOUT

  if (ignoreThisChildRemove)
    if (ignoreChildRemoves())
      ignoreThisChildRemove = false; // was already ignoring them

  if (ignoreThisChildRemove)
    setIgnoreChildRemoves(true);

  WWebWidget::removeChild(child);

  if (ignoreThisChildRemove)
    setIgnoreChildRemoves(false);
}
Exemple #2
0
void WTemplate::clear()
{
  setIgnoreChildRemoves(true);
  for (WidgetMap::iterator i = widgets_.begin(); i != widgets_.end(); ++i)
    delete i->second;
  setIgnoreChildRemoves(false);

  widgets_.clear();
  strings_.clear();
  conditions_.clear();

  changed_ = true;
  repaint(RepaintInnerHtml);  
}
Exemple #3
0
WTable::WTable(WContainerWidget *parent)
  : WInteractWidget(parent),
    cellPadding_(0),
    gridChanged_(false),
    paddingChanged_(false)
{ 
  setInline(false);
  setIgnoreChildRemoves(true);
}
Exemple #4
0
void WTemplate::clear()
{
  setIgnoreChildRemoves(true);
  /*
   * We need to copy them first so that removeChild() will not be confused
   * by it.
   */
  WidgetMap toDelete = widgets_;
  widgets_ = WidgetMap();
  for (WidgetMap::iterator i = toDelete.begin(); i != toDelete.end(); ++i)
    delete i->second;
  setIgnoreChildRemoves(false);

  strings_.clear();
  conditions_.clear();

  changed_ = true;
  repaint(RepaintSizeAffected);  
}
Exemple #5
0
WTable::WTable(WContainerWidget *parent)
  : WInteractWidget(parent),
    rowsChanged_(0),
    rowsAdded_(0),
    headerRowCount_(0),
    headerColumnCount_(0)
{ 
  setInline(false);
  setIgnoreChildRemoves(true);
}