本文整理汇总了C++中wt::WPushButton::setStyleClass方法的典型用法代码示例。如果您正苦于以下问题:C++ WPushButton::setStyleClass方法的具体用法?C++ WPushButton::setStyleClass怎么用?C++ WPushButton::setStyleClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wt::WPushButton
的用法示例。
在下文中一共展示了WPushButton::setStyleClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: novoAnuncio
void AdsEditor::novoAnuncio() {
AdsApplication *app = AdsApplication::adsApplication();
cppdb::session &db = app->db_;
Wt::WDialog dialog("novo Anuncio");
Wt::WPushButton *ok = new WPushButton("Ok");
ok->setStyleClass("btn btn-primary");
ok->clicked().connect(&dialog, &Wt::WDialog::accept);
Wt::WPushButton *cancel = new WPushButton("Cancela");
cancel->setStyleClass("btn");
cancel->clicked().connect(&dialog, &Wt::WDialog::reject);
WLineEdit *lTitulo = new WLineEdit();
WLineEdit *lURL = new WLineEdit();
WLineEdit *lTexto = new WLineEdit();
WTemplate *t = new WTemplate(dialog.contents());
t->setTemplateText("<form>"
" <fieldset>"
" <legend>Dados do anuncio</legend>"
" <table border=0>"
" <tr><td>Titulo</td> <td>${titulo}</td></tr>"
" <tr><td>URL</td> <td>${url}</td></tr>"
" <tr><td>Texto</td> <td>${texto}</td></tr>"
" </table>"
" </fieldset>"
" ${ok}${cancel}"
"</form>"
, XHTMLUnsafeText);
t->bindWidget("titulo", lTitulo);
t->bindWidget("url", lURL);
t->bindWidget("texto", lTexto);
t->bindWidget("ok", ok);
t->bindWidget("cancel", cancel);
if (dialog.exec() == Wt::WDialog::Accepted) {
db << "insert into anuncio (id, titulo, url, texto, imagem) values "
"(NULL, ?,?,?, '/img/cabure.png')"
<< lTitulo->text().narrow() << lURL->text().narrow()
<< lTexto->text().narrow() << cppdb::exec;
}
renderUI();
}
示例2:
AlunoList::AlunoList(Wt::Dbo::Session& dbSession, Wt::Dbo::ptr<SiconfModel::Disciplina> disciplina):
_dbSession(dbSession), _disciplina(disciplina){
_table = new Wt::WTable(this);
setTable();
Wt::WPushButton* close = new Wt::WPushButton("Voltar", this);
close->setStyleClass("btn btn-primary");
close->clicked().connect(std::bind([this](){
delete this;
}));
}
示例3: _initialize
void ChamadaForm::_initialize(){
Wt::Dbo::Transaction transaction(_dbSession);
Wt::WText* title = new Wt::WText("<h3>Diario de Classe: " + Wt::WDate::currentDate().toString("dd/MM/yyyy").toUTF8() + "</h3> <br></br><br></br>");
addWidget(title);
Wt::WPushButton* fazerChamada = new Wt::WPushButton("Percorrer turma", this);
fazerChamada->setStyleClass("btn btn-primary");
fazerChamada->clicked().connect(std::bind([=](){
new AutoChamada(_dbSession, sortList);
}));
fazerChamada->setMargin(20, Wt::Bottom);
_list = new Wt::WTable(this);
Wt::WPushButton* save = new Wt::WPushButton("Salvar", this);
save->setStyleClass("btn btn-success");
save->setMargin(10, Wt::Right);
save->clicked().connect(std::bind([=](){
_save();
delete this;
}));
Wt::WPushButton* cancel = new Wt::WPushButton("Cancelar", this);
cancel->setStyleClass("btn btn-primary");
cancel->clicked().connect(std::bind([=](){
delete this;
}));
_list->setWidth(Wt::WLength("100%"));
_list->addStyleClass("table-striped table-hover");
_list->setMargin(50, Wt::Bottom);
new Wt::WText("Aluno", _list->elementAt(0,0));
new Wt::WText("Presente", _list->elementAt(0,1));
_list->setHeaderCount(1);
for(auto i : _disciplina->turma()->alunos()){
Wt::WCheckBox* checkbox = new Wt::WCheckBox();
sortList.push_back(std::make_pair(checkbox, i));
}
auto sortAlg = [](std::pair<Wt::WCheckBox*, Wt::Dbo::ptr<SiconfModel::Aluno>> par1, std::pair<Wt::WCheckBox*, Wt::Dbo::ptr<SiconfModel::Aluno>>par2){
return par1.second->usuario()->nome() < par2.second->usuario()->nome();
};
std::sort(std::begin(sortList), std::end(sortList), sortAlg);
for(auto i : sortList){
int row = _list->rowCount();
Wt::WText* name = new Wt::WText(i.second->usuario()->nome() + " " + i.second->usuario()->sobrenome(), _list->elementAt(row, 0));
name->setMargin(10, Wt::Right);
_list->elementAt(row, 1)->addWidget(i.first);
_list->elementAt(row, 1)->setHeight(40);
_list->elementAt(row, 1)->setWidth(100);
}
}