void WMenuItem::enableAjax() { if (menu_->internalPathEnabled()) resetLearnedSlots(); WContainerWidget::enableAjax(); }
void WTreeNode::insertChildNode(int index, WTreeNode *node) { childNodes_.insert(childNodes_.begin() + index, node); node->parentNode_ = this; if (childrenLoaded_) childContainer()->insertWidget(index, node); else node->setParent(0); // because node->hasParent() has Changed descendantAdded(node); if (loadPolicy_ != node->loadPolicy_) node->setLoadPolicy(loadPolicy_); if (childCountPolicy_ != node->childCountPolicy_) node->setChildCountPolicy(childCountPolicy_); /* * If newly inserted node is last, then previous last node needs to * be updated. */ if (index == (int)childNodes_.size() - 1 && childNodes_.size() > 1) childNodes_[childNodes_.size() - 2]->update(); node->update(); update(); resetLearnedSlots(); }
void WTreeNode::updateChildren(bool recursive) { for (unsigned i = 0; i < childNodes_.size(); ++i) if (recursive) childNodes_[i]->updateChildren(recursive); else childNodes_[i]->update(); update(); resetLearnedSlots(); }
void WTreeNode::loadChildren() { if (!childrenLoaded_) { doPopulate(); for (unsigned i = 0; i < childNodes_.size(); ++i) childContainer()->addWidget(childNodes_[i]); expandIcon_->icon1Clicked().connect(this, &WTreeNode::doExpand); expandIcon_->icon2Clicked().connect(this, &WTreeNode::doCollapse); resetLearnedSlots(); childrenLoaded_ = true; } }
void WTreeNode::updateChildren(bool recursive) { for (unsigned i = 0; i < childNodes_.size(); ++i) if (recursive) childNodes_[i]->updateChildren(recursive); else childNodes_[i]->update(); update(); if (childCountLabel_) { if (childNodes_.size()) childCountLabel_ ->setText(L"(" + boost::lexical_cast<std::wstring>(childNodes_.size()) + L")"); else childCountLabel_->setText(L""); } resetLearnedSlots(); }
void WTreeNode::loadChildren() { if (!childrenLoaded_) { if (!populated_) { populate(); populated_ = true; } for (unsigned i = 0; i < childNodes_.size(); ++i) { expandedContent_->addWidget(childNodes_[i]); if (!childNodes_[i]->populated_) { childNodes_[i]->populate(); childNodes_[i]->populated_ = true; } } expandIcon_->icon1Clicked.connect(SLOT(this, WTreeNode::doExpand)); expandIcon_->icon2Clicked.connect(SLOT(this, WTreeNode::doCollapse)); resetLearnedSlots(); childrenLoaded_ = true; } }