本文整理汇总了C++中WContainerWidget::setZIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ WContainerWidget::setZIndex方法的具体用法?C++ WContainerWidget::setZIndex怎么用?C++ WContainerWidget::setZIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WContainerWidget
的用法示例。
在下文中一共展示了WContainerWidget::setZIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setHidden
void WDialog::setHidden(bool hidden, const WAnimation& animation)
{
if (isHidden() != hidden) {
if (modal_) {
WApplication *app = WApplication::instance();
WContainerWidget *cover = app->dialogCover();
if (!cover)
return; // when application is being destroyed
if (!hidden) {
saveCoverState(app, cover);
if (cover->isHidden()) {
if (!animation.empty()) {
cover->animateShow(WAnimation(WAnimation::Fade, WAnimation::Linear,
animation.duration() * 4));
} else
cover->show();
}
cover->setZIndex(impl_->zIndex() - 1);
app->pushExposedConstraint(this);
// FIXME: this should only blur if the active element is outside
// of the dialog
doJavaScript
("try {"
"""var ae=document.activeElement;"
// On IE when a dialog is shown on startup, activeElement is the
// body. Bluring the body sends the window to the background if
// it is the only tab.
// http://redmine.emweb.be/boards/2/topics/6415
"""if (ae && ae.blur && ae.nodeName != 'BODY') {"
"" "document.activeElement.blur();"
"}"
"} catch (e) { }");
} else
restoreCoverState(app, cover);
}
}
WPopupWidget::setHidden(hidden, animation);
}
示例2: setHidden
void WDialog::setHidden(bool hidden, const WAnimation& animation)
{
if (isHidden() != hidden) {
if (modal_) {
WApplication *app = WApplication::instance();
WContainerWidget *cover = app->dialogCover();
if (!cover)
return; // when application is being destroyed
if (!hidden) {
saveCoverState(app, cover);
if (cover->isHidden()) {
if (!animation.empty()) {
cover->animateShow(WAnimation(WAnimation::Fade, WAnimation::Linear,
animation.duration() * 4));
} else
cover->show();
}
cover->setZIndex(impl_->zIndex() - 1);
app->pushExposedConstraint(this);
// FIXME: this should only blur if the active element is outside
// of the dialog
doJavaScript
("try {"
"""if (document.activeElement && document.activeElement.blur)"
"" "document.activeElement.blur();"
"} catch (e) { }");
} else
restoreCoverState(app, cover);
}
}
WCompositeWidget::setHidden(hidden, animation);
}