コード例 #1
0
ファイル: WContainerWidget.C プロジェクト: StevenFarley/wt
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);
}
コード例 #2
0
ファイル: WTemplate.C プロジェクト: ScienziatoBestia/wt
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);  
}
コード例 #3
0
WTable::WTable(WContainerWidget *parent)
  : WInteractWidget(parent),
    cellPadding_(0),
    gridChanged_(false),
    paddingChanged_(false)
{ 
  setInline(false);
  setIgnoreChildRemoves(true);
}
コード例 #4
0
ファイル: WTemplate.C プロジェクト: dreamsxin/WebWidgets
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);  
}
コード例 #5
0
ファイル: WTable.C プロジェクト: DTidd/wt
WTable::WTable(WContainerWidget *parent)
  : WInteractWidget(parent),
    rowsChanged_(0),
    rowsAdded_(0),
    headerRowCount_(0),
    headerColumnCount_(0)
{ 
  setInline(false);
  setIgnoreChildRemoves(true);
}