本文整理汇总了C++中WAnchor::hide方法的典型用法代码示例。如果您正苦于以下问题:C++ WAnchor::hide方法的具体用法?C++ WAnchor::hide怎么用?C++ WAnchor::hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WAnchor
的用法示例。
在下文中一共展示了WAnchor::hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void RegistrationWidget::update()
{
if (model_->passwordAuth())
bindString("password-description",
tr("Wt.Auth.password-registration"));
else
bindEmpty("password-description");
updateView(model_);
if (!created_) {
WLineEdit *password = resolve<WLineEdit *>
(RegistrationModel::ChoosePasswordField);
WLineEdit *password2 = resolve<WLineEdit *>
(RegistrationModel::RepeatPasswordField);
WText *password2Info = resolve<WText *>
(RegistrationModel::RepeatPasswordField + std::string("-info"));
if (password && password2 && password2Info)
model_->validatePasswordsMatchJS(password, password2, password2Info);
}
WAnchor *isYou = resolve<WAnchor *>("confirm-is-you");
if (!isYou) {
isYou = new WAnchor(std::string("#"), tr("Wt.Auth.confirm-is-you"));
isYou->hide();
bindWidget("confirm-is-you", isYou);
}
if (model_->isConfirmUserButtonVisible()) {
if (!isYou->clicked().isConnected())
isYou->clicked().connect(this, &RegistrationWidget::confirmIsYou);
isYou->show();
} else
isYou->hide();
if (model_->isFederatedLoginVisible()) {
if (!conditionValue("if:oauth")) {
setCondition("if:oauth", true);
if (model_->passwordAuth())
bindString("oauth-description", tr("Wt.Auth.or-oauth-registration"));
else
bindString("oauth-description", tr("Wt.Auth.oauth-registration"));
WContainerWidget *icons = new WContainerWidget();
icons->addStyleClass("Wt-field");
for (unsigned i = 0; i < model_->oAuth().size(); ++i) {
const OAuthService *service = model_->oAuth()[i];
WImage *w = new WImage("css/oauth-" + service->name() + ".png", icons);
w->setToolTip(service->description());
w->setStyleClass("Wt-auth-icon");
w->setVerticalAlignment(AlignMiddle);
OAuthProcess *const process
= service->createProcess(service->authenticationScope());
w->clicked().connect(process, &OAuthProcess::startAuthenticate);
process->authenticated().connect
(boost::bind(&RegistrationWidget::oAuthDone, this, process, _1));
WObject::addChild(process);
}
bindWidget("icons", icons);
}
} else {
setCondition("if:oauth", false);
bindEmpty("icons");
}
if (!created_) {
WPushButton *okButton = new WPushButton(tr("Wt.Auth.register"));
WPushButton *cancelButton = new WPushButton(tr("Wt.WMessageBox.Cancel"));
bindWidget("ok-button", okButton);
bindWidget("cancel-button", cancelButton);
okButton->clicked().connect(this, &RegistrationWidget::doRegister);
cancelButton->clicked().connect(this, &RegistrationWidget::close);
created_ = true;
}
}