本文整理汇总了C++中WPushButton::setStyleClass方法的典型用法代码示例。如果您正苦于以下问题:C++ WPushButton::setStyleClass方法的具体用法?C++ WPushButton::setStyleClass怎么用?C++ WPushButton::setStyleClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPushButton
的用法示例。
在下文中一共展示了WPushButton::setStyleClass方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ForgotForm
void RootLogin::ForgotForm()
{
if (!m_forgotFormFlag) {
Div *dvForgotForm = new Div(m_dvForgot, "dvForgotForm", "form");
WGridLayout *dvForgotFormLayout = new WGridLayout();
m_forgotEmailEdit = new WLineEdit();
m_forgotCaptchaEdit = new WLineEdit();
dvForgotFormLayout->addWidget(new WText(m_lang->GetString("ROOT_LOGIN_FORM_EMAIL_TEXT")),
0, 0, AlignLeft | AlignMiddle);
dvForgotFormLayout->addWidget(m_forgotEmailEdit, 0, 1);
dvForgotFormLayout->addWidget(new WText(m_lang->GetString("ROOT_LOGIN_FORM_CAPTCHA_TEXT")),
1, 0, AlignLeft | AlignMiddle);
dvForgotFormLayout->addWidget(m_forgotCaptchaEdit, 1, 1);
dvForgotFormLayout->setVerticalSpacing(11);
dvForgotFormLayout->setColumnStretch(0, 100);
dvForgotFormLayout->setColumnStretch(1, 200);
dvForgotForm->resize(300, WLength::Auto);
dvForgotForm->setLayout(dvForgotFormLayout);
m_errForgotText = new WText(m_dvForgot);
WPushButton *btnForgot = new WPushButton(m_lang->GetString("ROOT_LOGIN_FORM_RECOVER_TEXT"),
m_dvForgot);
btnForgot->setStyleClass("formButton");
WRegExpValidator *forgotEmailValidator = new WRegExpValidator(Base::REGEX_EMAIL);
forgotEmailValidator->setFlags(MatchCaseInsensitive);
forgotEmailValidator->setMandatory(true);
m_forgotCaptchaValidator = new WIntValidator(m_captcha->Result, m_captcha->Result);
m_forgotCaptchaValidator->setMandatory(true);
m_forgotEmailEdit->setValidator(forgotEmailValidator);
m_forgotCaptchaEdit->setValidator(m_forgotCaptchaValidator);
m_forgotEmailEdit->enterPressed().connect(this, &RootLogin::ForgotOK);
m_forgotCaptchaEdit->enterPressed().connect(this, &RootLogin::ForgotOK);
btnForgot->clicked().connect(this, &RootLogin::ForgotOK);
m_forgotFormFlag = true;
} else {
m_dvForgot->clear();
m_forgotFormFlag = false;
}
}
示例2: WText
LoginWidget::LoginWidget(WContainerWidget *parent):
WCompositeWidget(parent)
{
setImplementation(_impl = new WContainerWidget());
_impl->setStyleClass("center-block");
WContainerWidget *container = new WContainerWidget(_impl);
container->setStyleClass("center");
new WText("Name",container);
WPushButton *login = new WPushButton("GO!!!",container);
login->setStyleClass("button white");
login->clicked().connect(this, &LoginWidget::emitt);
//login->clicked().emit();
}
示例3: BaseWidget
IdeaSubmit::IdeaSubmit(CgiRoot *cgi, Wt::WDialog *parentDialog, bool editMode, size_t editRowId) : BaseWidget(cgi),
m_dlgParent(parentDialog),
m_editMode(editMode),
m_editRowId(editRowId),
m_editCompletedHandler(this)
{
this->clear();
this->addWidget(Layout());
this->setOverflow(WContainerWidget::OverflowAuto);
Div *dvButtonWrappers = new Div();
Div *dvButtons = new Div(dvButtonWrappers, "dvDialogButtons");
WPushButton *submitButton;
if (!m_editMode)
submitButton = new WPushButton(m_lang->GetString("HOME_SUBMIT_IDEA_DLG_OK_BUTTON"), dvButtons);
else
submitButton = new WPushButton(m_lang->GetString("HOME_SUBMIT_IDEA_DLG_OK_EDIT_BUTTON"), dvButtons);
WPushButton *returnButton = new WPushButton(m_lang->GetString("HOME_SUBMIT_IDEA_DLG_RETURN_BUTTON"), dvButtons);
submitButton->setStyleClass("dialogButton");
returnButton->setStyleClass("dialogButton");
WVBoxLayout *layout = new WVBoxLayout();
layout->addWidget(this);
layout->setStretchFactor(this, 1);
layout->addWidget(dvButtonWrappers );
layout->setStretchFactor(dvButtonWrappers , 0);
m_dlgParent->contents()->setLayout(layout);
if (m_editMode) {
string title;
int typegamesentertainment;
int typehygienehealth;
int typenewsinfo;
int typelearning;
int typenonepresenceservices;
int typeonlineshopping;
int typeothers;
string typeotherstext;
string description;
int audienceteens;
int audienceparents;
int audienceboys;
int audiencegirls;
int audiencewomen;
int audiencemen;
int audiencechilds;
int audienceallfamilymembers;
string usage;
string similar;
string difference;
result r = m_db->Sql() << "SELECT title, "
"typegamesentertainment, typehygienehealth, typenewsinfo, typelearning, "
"typenonepresenceservices, typeonlineshopping, typeothers, typeotherstext, "
"description, "
"audienceteens, audienceparents, audienceboys, audiencegirls, audiencewomen, "
"audiencemen, audiencechilds, audienceallfamilymembers, "
"usage, similar, difference "
"FROM [" + m_dbTables->Table("IDEAS")
+ "] WHERE rowid=?;" << m_editRowId << row;
if (!r.empty()) {
r >> title >> typegamesentertainment >> typehygienehealth
>> typenewsinfo >> typelearning >> typenonepresenceservices >> typeonlineshopping
>> typeothers >> typeotherstext >> description >> audienceteens >> audienceparents >> audienceboys
>> audiencegirls >> audiencewomen >> audiencemen >> audiencechilds >> audienceallfamilymembers
>> usage >> similar >> difference;
title = Crypto::Decrypt(title);
typeotherstext = Crypto::Decrypt(typeotherstext);
description = Crypto::Decrypt(description);
usage = Crypto::Decrypt(usage);
similar = Crypto::Decrypt(similar);
difference = Crypto::Decrypt(difference);
m_typeGamesEntertainmentCheckBox->setChecked(typegamesentertainment);
m_typeHygieneHealthCheckBox->setChecked(typehygienehealth);
m_typeNewsInfoCheckBox->setChecked(typenewsinfo);
m_typeLearningCheckBox->setChecked(typelearning);
m_typeNonePresenceServicesCheckBox->setChecked(typenonepresenceservices);
m_typeOnlineShoppingCheckBox->setChecked(typeonlineshopping);
m_typeOthersCheckBox->setChecked(typeothers);
if (typeothers)
m_typeOthersTextLineEdit->setText(WString::fromUTF8(typeotherstext));
m_titleLineEdit->setText(WString::fromUTF8(title));
m_descriptionTextArea->setText(WString::fromUTF8(description));
m_audienceTeensCheckBox->setChecked(audienceteens);
m_audienceParentsCheckBox->setChecked(audienceparents);
m_audienceBoysCheckBox->setChecked(audienceboys);
m_audienceGirlsCheckBox->setChecked(audiencegirls);
m_audienceWomenCheckBox->setChecked(audiencewomen);
m_audienceMenCheckBox->setChecked(audiencemen);
m_audienceChildsCheckBox->setChecked(audiencechilds);
m_audienceAllFamilyMembersCheckBox->setChecked(audienceallfamilymembers);
m_usageTextArea->setText(WString::fromUTF8(usage));
//.........这里部分代码省略.........
示例4: WText
FtpUserController::FtpUserController( WContainerWidget *parent)
: WContainerWidget(parent)
{
//this->setStyleClass("");
//this->addStyleClass("test1");
//Define notification area
//notificationArea = new Wt::WText(" ",this);
//notificationArea->setStyleClass("notificationArea");
//Define button to add ftp users
WContainerWidget *addFtpUSerButtonContainer = new WContainerWidget(this);
WPushButton *addFtpUserButton = new WPushButton("Add FTP user", addFtpUSerButtonContainer);
addFtpUSerButtonContainer->setStyleClass("add_ftpuser_button");
addFtpUserButton->setStyleClass("button orange bigrounded");
//Define dialog to add ftp users
this->wDialogAddFtpUser();
addFtpUserButton->clicked().connect(this,&FtpUserController::showDialog);
/**
Add user form
*/
/*
WContainerWidget *addFtpUser = new WContainerWidget(this);
WContainerWidget *dropDown = new WContainerWidget(addFtpUser);
WContainerWidget *dropDownHead = new WContainerWidget(dropDown);
WContainerWidget *dropDownBody = new WContainerWidget(dropDown);
addFtpUser->setStyleClass("add_ftp_user");
dropDown->setStyleClass("right");
dropDownHead->setStyleClass("drop_down_head");
dropDownBody->setStyleClass("drop_down_body");
new WText("Add user", dropDownHead);
dropDownBody->hide();
WContainerWidget *arrow = new WContainerWidget(dropDownHead);
arrow->setStyleClass("arrow-down");
*/
/* --------------------- */
//this->setStyleClass("ftp_controller");
logindb = new LoginDB();
std::vector <std::string> names = logindb->getKeys();
FtpUser::init();
std::vector<std::string>::iterator it;
for(it = names.begin(); it < names.end(); it++)
{
//if( ! it->empty()) //TO-DO delete this line
new FtpUser(*it,this);
//users.push_back(new FtpUser(*it,this));
/*
new WText(*it, userList);
new WLineEdit(userList);
WPushButton *btn = new WPushButton("Modify name",userList);
btn->clicked().connect(this,&MainPage::modifyEntry);
new WBreak(userList);*/
}
_autofsc = new AutofsController();
//new WBreak(this);
}
示例5: wDialogAddFtpUser
void FtpUserController::wDialogAddFtpUser()
{
addFtpUSerDialog = new WDialog("Add FTP User");
addFtpUSerDialog->setStyleClass("add_ftpuser_dialog");
addFtpUSerDialog->titleBar()->addStyleClass("add_ftpuser_dialog_titlebar");
addFtpUSerDialog->contents()->addStyleClass("add_ftpuser_dialog_contents");
error = new WText(" ",addFtpUSerDialog->contents());
error->setStyleClass("errorText");
//
WContainerWidget *w1 = new WContainerWidget(addFtpUSerDialog->contents());
WLabel *l1 = new WLabel("FTP user name",w1);
this->newFtpUser = new WLineEdit(w1);
l1->setBuddy(this->newFtpUser);
l1->setStyleClass("label");
this->newFtpUser->setStyleClass("form");
WContainerWidget *w2 = new WContainerWidget(addFtpUSerDialog->contents());
WLabel *l2 = new WLabel("Password",w2);
this->newFtpPass = new WLineEdit(w2);
this->newFtpPass->setEchoMode(WLineEdit::Password);
l2->setBuddy(this->newFtpPass);
l2->setStyleClass("label");
this->newFtpPass->setStyleClass("form");
WContainerWidget *w3 = new WContainerWidget(addFtpUSerDialog->contents());
WLabel *l3 = new WLabel("Re-type password",w3);
this->newFtpRepass = new WLineEdit(w3);
this->newFtpRepass->setEchoMode(WLineEdit::Password);
l3->setBuddy(this->newFtpRepass);
l3->setStyleClass("label");
this->newFtpRepass->setStyleClass("form");
//
/*
new Wt::WText("Enter your name: ", addFtpUSerDialog->contents());
newFtpUser = new Wt::WLineEdit(addFtpUSerDialog->contents());
new Wt::WBreak(addFtpUSerDialog->contents());
newFtpPass = new Wt::WLineEdit(addFtpUSerDialog->contents());
new Wt::WBreak(addFtpUSerDialog->contents());
newFtpRepass = new Wt::WLineEdit(addFtpUSerDialog->contents());
new Wt::WBreak(addFtpUSerDialog->contents());*/
WPushButton *ok = new Wt::WPushButton("Ok", addFtpUSerDialog->contents());
ok->setStyleClass("button white");
WPushButton *cancel = new Wt::WPushButton("Cancel", addFtpUSerDialog->contents());
cancel->setStyleClass("button white");
//ok->clicked().connect(addFtpUSerDialog, &Wt::WDialog::accept);
//cancel->clicked().connect(addFtpUSerDialog, &Wt::WDialog::reject);
ok->clicked().connect(this, &FtpUserController::addFtpUser);
cancel->clicked().connect(this, &FtpUserController::hideDialog);
//ok->clicked().connect(addFtpUSerDialog, boost::bind(&FtpUserController::showNotification, messageType::ERROR ,"Hello"));
}
示例6: Div
WWidget *CmsDashboard::Layout()
{
Div *container = new Div("CmsDashboard", "container-fluid");
try {
CgiRoot *cgiRoot = static_cast<CgiRoot *>(WApplication::instance());
CgiEnv *cgiEnv = cgiRoot->GetCgiEnvInstance();
string htmlData;
string file;
if (cgiEnv->GetCurrentLanguage() == CgiEnv::Language::Fa) {
file = "../templates/cms-dashboard-fa.wtml";
} else {
file = "../templates/cms-dashboard.wtml";
}
if (CoreLib::FileSystem::Read(file, htmlData)) {
/// Fill the template
WTemplate *tmpl = new WTemplate(container);
tmpl->setTemplateText(WString::fromUTF8(htmlData), TextFormat::XHTMLUnsafeText);
WPushButton *forceTerminateAllSessionsPushButton = new WPushButton(tr("cms-dashboard-force-terminate-all-sessions"));
forceTerminateAllSessionsPushButton->setStyleClass("btn btn-default");
tmpl->bindWidget("welcome-message", new WText(tr("cms-dashboard-welcome-message")));
tmpl->bindWidget("last-login-title", new WText(tr("cms-dashboard-last-login-info-title")));
tmpl->bindWidget("last-login-ip-label", new WText(tr("cms-dashboard-last-login-info-ip")));
tmpl->bindWidget("last-login-location-label", new WText(tr("cms-dashboard-last-login-info-location")));
tmpl->bindWidget("last-login-user-agent-label", new WText(tr("cms-dashboard-last-login-info-user-agent")));
tmpl->bindWidget("last-login-referer-label", new WText(tr("cms-dashboard-last-login-info-referer")));
tmpl->bindWidget("last-login-time-label", new WText(tr("cms-dashboard-last-login-info-time")));
tmpl->bindWidget("last-login-ip", new WText(WString::fromUTF8(cgiEnv->SignedInUser.LastLogin.IP)));
tmpl->bindWidget("last-login-location", new WText(WString::fromUTF8(cgiEnv->SignedInUser.LastLogin.Location)));
tmpl->bindWidget("last-login-user-agent", new WText(WString::fromUTF8(cgiEnv->SignedInUser.LastLogin.UserAgent)));
tmpl->bindWidget("last-login-referer", new WText(WString::fromUTF8(cgiEnv->SignedInUser.LastLogin.Referer)));
tmpl->bindWidget("last-login-time-gdate", new WText(WString::fromUTF8(cgiEnv->SignedInUser.LastLogin.LoginGDate)));
tmpl->bindWidget("last-login-time-jdate", new WText(WString::fromUTF8(cgiEnv->SignedInUser.LastLogin.LoginJDate)));
tmpl->bindWidget("last-login-time", new WText(WString::fromUTF8(cgiEnv->SignedInUser.LastLogin.LoginTime)));
tmpl->bindWidget("force-terminate-all-sessions", forceTerminateAllSessionsPushButton);
forceTerminateAllSessionsPushButton->clicked().connect(m_pimpl.get(), &CmsDashboard::Impl::OnForceTerminateAllSessionsPushButtonPressed);
}
}
catch (boost::exception &ex) {
LOG_ERROR(boost::diagnostic_information(ex));
}
catch (std::exception &ex) {
LOG_ERROR(ex.what());
}
catch (...) {
LOG_ERROR(UNKNOWN_ERROR);
}
return container;
}
示例7: WText
WWidget *RootLogin::Layout()
{
m_cgiRoot->setTitle(m_lang->GetString("ROOT_LOGIN_TITLE"));
Div *root = new Div("RootLogin");
Div *dvNoScript = new Div(root, "dvNoScript");
new WText(m_lang->GetString("WARN_NO_SCRIPT"), dvNoScript);
Div *dvLogin = new Div(root, "dvLogin");
new WText(m_lang->GetString("ROOT_LOGIN_FORM_TITLE"), dvLogin);
Div *dvLangBar = new Div(dvLogin, "dvLangBar");
new WText(L"<span style=\"color: #333; font-family: Tahoma !important; letter-spacing: 1px;\">"
"<a href=\"?enroot\" style=\"color: #666; text-decoration: none;\">EN</a>"
" | "
"<a href=\"?faroot\" style=\"color: #666; text-decoration: none;\">فا</a>"
"</span>", dvLangBar);
Div *dvLoginForm = new Div(dvLogin, "dvLoginForm", "form");
WGridLayout *dvLoginFormLayout = new WGridLayout();
m_loginUserEdit = new WLineEdit();
m_loginPwdEdit = new WLineEdit();
m_loginPwdEdit->setEchoMode(WLineEdit::Password);
m_loginCaptchaEdit = new WLineEdit();
dvLoginFormLayout->addWidget(new WText(m_lang->GetString("ROOT_LOGIN_FORM_USER_TEXT")),
0, 0, AlignLeft | AlignMiddle);
dvLoginFormLayout->addWidget(m_loginUserEdit, 0, 1);
dvLoginFormLayout->addWidget(new WText(m_lang->GetString("ROOT_LOGIN_FORM_PWD_TEXT")),
1, 0, AlignLeft | AlignMiddle);
dvLoginFormLayout->addWidget(m_loginPwdEdit, 1, 1);
dvLoginFormLayout->addWidget(new WText(m_lang->GetString("ROOT_LOGIN_FORM_CAPTCHA_TEXT")),
2, 0, AlignLeft | AlignMiddle);
dvLoginFormLayout->addWidget(m_loginCaptchaEdit, 2, 1);
dvLoginFormLayout->setVerticalSpacing(11);
dvLoginFormLayout->setColumnStretch(0, 100);
dvLoginFormLayout->setColumnStretch(1, 200);
dvLoginForm->resize(300, WLength::Auto);
dvLoginForm->setLayout(dvLoginFormLayout);
m_loginCaptchaImage = m_captcha->GenCap();
dvLogin->addWidget(m_loginCaptchaImage);
m_errLoginText = new WText(dvLogin);
WPushButton *loginBtn = new WPushButton(m_lang->GetString("ROOT_LOGIN_FORM_LOGIN_TEXT"),
dvLogin);
loginBtn->setStyleClass("formButton");
WText *forgotLink = new WText(
L"<p style=\"text-align: right !important; margin-top: 25px;\">"
+ m_lang->GetString("ROOT_LOGIN_FORM_FORGOT_TEXT") + L"</p>",
dvLogin);
forgotLink->setStyleClass("link");
m_dvForgot = new Div(dvLogin, "dvForgot");
m_forgotFormFlag = false;
Div *dvCopyright = new Div(root, "dvCopyright");
new WText(Base::Copyright(m_cgiEnv->CurrentLang), dvCopyright);
WSignalMapper<WText *> *forgotMap = new WSignalMapper<WText *>(this);
forgotMap->mapped().connect(this, &RootLogin::ForgotForm);
forgotMap->mapConnect(forgotLink->clicked(), forgotLink);
WLengthValidator *loginUserValidator = new WLengthValidator(Base::MIN_USERNAME_LENGTH,
Base::MAX_USERNAME_LENGTH);
loginUserValidator->setMandatory(true);
m_loginUserEdit->setValidator(loginUserValidator);
WLengthValidator *loginPwdValidator = new WLengthValidator(Base::MIN_PASSWORD_LENGTH,
Base::MAX_PASSWORD_LENGTH);
loginPwdValidator->setMandatory(true);
m_loginPwdEdit->setValidator(loginPwdValidator);
m_loginCaptchaValidator = new WIntValidator(m_captcha->Result, m_captcha->Result);
m_loginCaptchaValidator->setMandatory(true);
m_loginCaptchaEdit->setValidator(m_loginCaptchaValidator);
m_loginUserEdit->enterPressed().connect(this, &RootLogin::LoginOK);
m_loginPwdEdit->enterPressed().connect(this, &RootLogin::LoginOK);
m_loginCaptchaEdit->enterPressed().connect(this, &RootLogin::LoginOK);
loginBtn->clicked().connect(this, &RootLogin::LoginOK);
return root;
}
示例8: Div
WWidget *CmsSubscribers::Layout()
{
Div *container = new Div("CmsSubscribers", "container-fluid");
try {
CgiRoot *cgiRoot = static_cast<CgiRoot *>(WApplication::instance());
CgiEnv *cgiEnv = cgiRoot->GetCgiEnvInstance();
string htmlData;
string file;
if (cgiEnv->GetCurrentLanguage() == CgiEnv::Language::Fa) {
file = "../templates/cms-subscribers-fa.wtml";
} else {
file = "../templates/cms-subscribers.wtml";
}
if (CoreLib::FileSystem::Read(file, htmlData)) {
/// Fill the template
WTemplate *tmpl = new WTemplate(container);
tmpl->setTemplateText(WString::fromUTF8(htmlData), TextFormat::XHTMLUnsafeText);
WPushButton *allSubscribersPushButton = new WPushButton(tr("cms-subscribers-all"));
allSubscribersPushButton->setStyleClass("btn btn-default");
WPushButton *englishFarsiSubscribersPushButton = new WPushButton(tr("cms-subscribers-english-farsi"));
englishFarsiSubscribersPushButton->setStyleClass("btn btn-default");
WPushButton *englishSubscribersPushButton = new WPushButton(tr("cms-subscribers-english"));
englishSubscribersPushButton->setStyleClass("btn btn-default");
WPushButton *farsiSubscribersPushButton = new WPushButton(tr("cms-subscribers-farsi"));
farsiSubscribersPushButton->setStyleClass("btn btn-default");
WPushButton *inactiveSubscribersPushButton = new WPushButton(tr("cms-subscribers-inactive"));
inactiveSubscribersPushButton->setStyleClass("btn btn-default");
m_pimpl->SubscribersTableContainer = new Div("SubscribersTableContainer", "subscribers-table-container");
tmpl->bindWidget("subscribers-title", new WText(tr("cms-subscribers-page-title")));
tmpl->bindWidget("subscribers-table", m_pimpl->SubscribersTableContainer);
tmpl->bindWidget("all-subscribers-button", allSubscribersPushButton);
tmpl->bindWidget("english-farsi-subscribers-button", englishFarsiSubscribersPushButton);
tmpl->bindWidget("english-subscribers-button", englishSubscribersPushButton);
tmpl->bindWidget("farsi-subscribers-button", farsiSubscribersPushButton);
tmpl->bindWidget("inactive-subscribers-button", inactiveSubscribersPushButton);
allSubscribersPushButton->clicked().connect(m_pimpl.get(), &CmsSubscribers::Impl::OnAllButtonPressed);
englishFarsiSubscribersPushButton->clicked().connect(m_pimpl.get(), &CmsSubscribers::Impl::OnEnFaButtonPressed);
englishSubscribersPushButton->clicked().connect(m_pimpl.get(), &CmsSubscribers::Impl::OnEnButtonPressed);
farsiSubscribersPushButton->clicked().connect(m_pimpl.get(), &CmsSubscribers::Impl::OnFaButtonPressed);
inactiveSubscribersPushButton->clicked().connect(m_pimpl.get(), &CmsSubscribers::Impl::OnInactiveButtonPressed);
allSubscribersPushButton->setFocus();
}
}
catch (boost::exception &ex) {
LOG_ERROR(boost::diagnostic_information(ex));
}
catch (std::exception &ex) {
LOG_ERROR(ex.what());
}
catch (...) {
LOG_ERROR(UNKNOWN_ERROR);
}
return container;
}