本文整理汇总了C++中DomElement::setWasEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ DomElement::setWasEmpty方法的具体用法?C++ DomElement::setWasEmpty怎么用?C++ DomElement::setWasEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DomElement
的用法示例。
在下文中一共展示了DomElement::setWasEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateDomChildren
void WContainerWidget::updateDomChildren(DomElement& parent, WApplication *app)
{
if (!app->session()->renderer().preLearning() && !layout_) {
if (parent.mode() == DomElement::ModeUpdate)
parent.setWasEmpty(wasEmpty());
if (transientImpl_) {
std::vector<int> orderedInserts;
std::vector<WWidget *>& ac = transientImpl_->addedChildren_;
for (unsigned i = 0; i < ac.size(); ++i)
orderedInserts.push_back(Utils::indexOf(*children_, ac[i]));
Utils::sort(orderedInserts);
int addedCount = transientImpl_->addedChildren_.size();
int totalCount = children_->size();
int insertCount = 0;
for (unsigned i = 0; i < orderedInserts.size(); ++i) {
int pos = orderedInserts[i];
DomElement *c = (*children_)[pos]->createSDomElement(app);
if (pos + (addedCount - insertCount) == totalCount)
parent.addChild(c);
else
parent.insertChildAt(c, pos + firstChildIndex());
++insertCount;
}
transientImpl_->addedChildren_.clear();
}
}
#ifndef WT_NO_LAYOUT
if (flags_.test(BIT_LAYOUT_NEEDS_UPDATE)) {
if (layout_)
layoutImpl()->updateDom(parent);
flags_.reset(BIT_LAYOUT_NEEDS_UPDATE);
}
#endif // WT_NO_LAYOUT
}
示例2: itemAt
DomElement *WTable::createRowDomElement(int row, bool withIds, WApplication *app)
{
DomElement *tr = DomElement::createNew(DomElement_TR);
if (withIds)
tr->setId(rows_[row]->id());
rows_[row]->updateDom(*tr, true);
// because of the mix of addChild() and insertChildAt()
tr->setWasEmpty(false);
int spanCounter = 0;
for (int col = 0; col < columnCount(); ++col) {
WTableRow::TableData& d = itemAt(row, col);
if (!d.overSpanned) {
DomElement *td = d.cell->createSDomElement(app);
/*
* So, IE gets confused when doing appendChild() for TH followed by
* insertCell(-1) for TD. But, we cannot insertChild() for element 0,
* so we do TH with appendChild, and insertCell(col).
*/
if (col < headerColumnCount_ || row < headerRowCount_)
tr->addChild(td);
else
tr->insertChildAt(td, col - spanCounter);
for (int i = 0; i < d.cell->rowSpan(); ++i)
for (int j = 0; j < d.cell->columnSpan(); ++j)
if (i + j > 0) {
itemAt(row + i, col + j).overSpanned = true;
itemAt(row + i, col + j).cell->setRendered(false);
}
} else {
spanCounter++;
}
}
return tr;
}