本文整理汇总了C++中wt::WPushButton类的典型用法代码示例。如果您正苦于以下问题:C++ WPushButton类的具体用法?C++ WPushButton怎么用?C++ WPushButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WPushButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Input
Wt::WWidget* Tester::Input()
{
Wt::WContainerWidget* container = new Wt::WContainerWidget();
container->setStyleClass("input_container");
Wt::WText* t = new Wt::WText("Input", container);
t->setStyleClass("area_title");
new Wt::WBreak(container);
mInput = new Wt::WTextArea(container);
mInput->setText("20131220T094700");
new Wt::WBreak(container);
t = new Wt::WText("Grammar", container);
t->setStyleClass("area_title");
new Wt::WBreak(container);
mGrammar = new Wt::WTextArea(container);
mGrammar->setRows(15);
mGrammar->setText("local l = require 'lpeg'\nl.locale(l)\ngrammar = l.C(l.digit^-4)");
Wt::WPushButton* button = new Wt::WPushButton("Test Grammar", container);
button->clicked().connect(this, &Tester::GrammarButton);
button = new Wt::WPushButton("Benchmark Grammar", container);
button->clicked().connect(this, &Tester::BenchmarkButton);
button = new Wt::WPushButton("Share Grammar", container);
button->clicked().connect(this, &Tester::ShareGrammar);
return container;
}
示例2: db
yearbookDownload::yearbookDownload(yearbookDB * ptr) : db(ptr), downloadFile(nullptr) {
addStyleClass("well");
setContentAlignment(Wt::AlignCenter | Wt::AlignMiddle);
addWidget(new Wt::WText("<p>Genereer een nieuwe versie van de PDF.</p> <p><b>Let op: </b>Bij ongeldige invoer kan de PDF onvolledig zijn.</p>"));
Wt::WPushButton * button = new Wt::WPushButton("Maak PDF");
addWidget(button);
button->clicked().connect(this, &yearbookDownload::generatePDF);
downloadTitle = new Wt::WText("<h1>Download beschikbaar</h1>");
downloadTitle->addStyleClass("page-header");
addWidget(downloadTitle);
downloadContainer = new Wt::WContainerWidget();
downloadContainer->addStyleClass("well");
downloadContainer->setContentAlignment(Wt::AlignCenter | Wt::AlignMiddle);
addWidget(downloadContainer);
downloadTitle->hide();
downloadContainer->hide();
downloadFile = new Wt::WFileResource(this);
downloadFile->setFileName("yearbook_latex/main.pdf");
downloadFile->setMimeType("application/pdf");
downloadAnchor = new Wt::WAnchor(Wt::WLink(downloadFile), "Download");
downloadAnchor->setTarget(Wt::TargetNewWindow);
downloadContainer->addWidget(downloadAnchor);
}
示例3:
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8/////////9/////////A
Wt::WWidget * WelcomeScreen::makeRegistrationTab()
{
Wt::WContainerWidget *cont = new Wt::WContainerWidget();
rg_txt_ = new Wt::WText("Hier koennen Sie ihr neues Flugbuch eroeffnen.", cont);
cont->addWidget(new Wt::WBreak());
cont->addWidget(new Wt::WBreak());
Wt::WTable *layout = new Wt::WTable(cont);
Wt::WLabel *usernameLabel = new Wt::WLabel("Benutzername: ", layout->elementAt(0, 0));
layout->elementAt(0, 0)->resize(Wt::WLength(14, Wt::WLength::FontEx), Wt::WLength());
rg_username_ = new Wt::WLineEdit(layout->elementAt(0, 1));
usernameLabel->setBuddy(rg_username_);
Wt::WLabel *passwordLabel = new Wt::WLabel("Passwort: ", layout->elementAt(1, 0));
rg_password_ = new Wt::WLineEdit(layout->elementAt(1, 1));
rg_password_->setEchoMode(Wt::WLineEdit::Password);
passwordLabel->setBuddy(rg_password_);
Wt::WLabel *passwordLabel2 = new Wt::WLabel("wiederholen: ", layout->elementAt(2, 0));
rg_password2_ = new Wt::WLineEdit(layout->elementAt(2, 1));
rg_password2_->setEchoMode(Wt::WLineEdit::Password);
rg_password2_->enterPressed().connect(SLOT(this, WelcomeScreen::doRegister));
passwordLabel2->setBuddy(rg_password2_);
Wt::WLabel *stdflareas = new Wt::WLabel("Standardfluggebiete importieren: ", layout->elementAt(3, 0));
rg_useStdLoc_ = new Wt::WCheckBox(layout->elementAt(3, 1));
stdflareas->setBuddy(rg_useStdLoc_);
Wt::WPushButton *LoginButton = new Wt::WPushButton("Registrieren", layout->elementAt(4, 1));
LoginButton->clicked().connect(SLOT( this, WelcomeScreen::doRegister));
return cont;
}
示例4: WContainerWidget
UserListWidget::UserListWidget(Wt::WContainerWidget* parent) :
WContainerWidget(parent), nr_(0), b_(0) {
m_ = new UserListModel(this);
oo_ = new Wt::WCheckBox(tr("tc.user.Only_online"), this);
oo_->setChecked(m_->only_online());
oo_->changed().connect(this, &UserListWidget::apply);
if (tApp->user() && tApp->user()->has_permission(USER_REMOVER)) {
nr_ = new Wt::WCheckBox(tr("tc.user.Not_removed"), this);
nr_->setChecked(m_->not_removed());
nr_->changed().connect(this, &UserListWidget::apply);
}
if (tApp->user()) {
b_ = new Wt::WCheckBox(tr("tc.user.My_blocklist"), this);
b_->setChecked(m_->only_blocked());
b_->changed().connect(this, &UserListWidget::apply);
}
name_ = new Wt::WLineEdit(this);
name_->setEmptyText(tr("tc.common.Name"));
name_->enterPressed().connect(this, &UserListWidget::apply);
if (!wApp->environment().ajax()) {
Wt::WPushButton* b = new Wt::WPushButton(tr("tc.common.Apply"), this);
b->clicked().connect(this, &UserListWidget::apply);
}
view_ = new UserListView(m_, this);
}
示例5: WContainerWidget
Crianca::Crianca(Wt::WContainerWidget *parent):
WContainerWidget(parent)
{
WTemplate *view = new WTemplate(WString::tr("App.nova-crianca"));
WText *title = new WText("Cadastrar nova crianca:");
view->bindWidget("action", title);
name = new WLineEdit("Nome: ");
view->bindWidget("name", name);
WText *text = new WText("Sexo: ");
view->bindWidget("sex", text);
selectSexo = new WButtonGroup();
WRadioButton *optionSexo = new WRadioButton("masculino");
selectSexo->addButton(optionSexo, 1);
optionSexo = new WRadioButton("feminino");
selectSexo->addButton(optionSexo, 2);
view->bindWidget("group", selectSexo);
Wt::WPushButton *cadastrar = new Wt::WPushButton("Cadastrar");
cadastrar->clicked().connect(this, &Crianca::salvarDadosCrianca);
view->bindWidget("button", cadastrar);
WContainerWidget *container = new WContainerWidget();
WStackedWidget *stacked = new WStackedWidget(container);
stacked->addWidget(view);
}
示例6:
Wt::WPushButton *createColorButton(const char *className, const Wt::WString& text)
{
Wt::WPushButton *button = new Wt::WPushButton();
button->setTextFormat(Wt::XHTMLText);
button->setText(text);
button->addStyleClass(className);
return button;
}
示例7: t
TeamEdit::TeamEdit(const TeamPtr& team):
team_(team) {
dbo::Transaction t(tApp->session());
if (!can_edit_team(tApp->user(), team_)) {
return;
}
add_record_inputs(team_.get(), this);
Wt::WPushButton* save = new Wt::WPushButton(tr("tc.common.Save"));
item("", "", save, save);
save->clicked().connect(this, &TeamEdit::save);
}
示例8: LOGDEBUG
ProfileList::ProfileList(Ptr<org::esb::core::PluginContext> ctx,WContainerWidget *parent):Wt::WContainerWidget(parent),_ctx(ctx)
{
//Wt::WHBoxLayout *hbox = new Wt::WHBoxLayout();
//setLayout(hbox);
LOGDEBUG("Height:"<<this->height().value());
Wt::WToolBar *toolBar = new Wt::WToolBar(this);
Wt::WPushButton * createButton;
toolBar->addButton(createButton=new Wt::WPushButton("Create"));
createButton->clicked().connect(this, &ProfileList::createNewProfile);
/*
toolBar->addButton(new Wt::WPushButton("Stop"));
toolBar->addButton(new Wt::WPushButton("Pause"));
*/
tableView = new Wt::WTableView(this);
tableView->setModel(new ProfileTableModel(ctx->database, tableView));
//tableView->setModel(new VirtualModel(10000, 50, tableView));
tableView->setColumnResizeEnabled(true);
tableView->setColumnAlignment(0, Wt::AlignCenter);
tableView->setSortingEnabled(false);
tableView->setHeaderAlignment(0, Wt::AlignCenter);
tableView->setAlternatingRowColors(true);
tableView->setRowHeight(28);
tableView->setHeaderHeight(28);
tableView->setSelectionMode(Wt::SingleSelection);
tableView->setEditTriggers(Wt::WAbstractItemView::NoEditTrigger);
//hbox->addWidget(tableView,0);
//hbox->addWidget(new Wt::WText("Item 2"),1);
/*
* Configure column widths and matching table width
*/
const int WIDTH = 120;
for (int i = 0; i < tableView->model()->columnCount(); ++i)
tableView->setColumnWidth(i, 420);
setLayoutSizeAware(true);
//this->setHeight(300);
//tableView->setHeight(300);
tableView->resize(Wt::WLength::Auto,400);
//this->addWidget(tableView);
/*
* 7 pixels are padding/border per column
* 2 pixels are border of the entire table
*/
//tableView->setWidth((WIDTH + 7) * tableView->model()->columnCount() + 2);
tableView->doubleClicked().connect(this,&ProfileList::doubleClicked);
}
示例9: initialize
void IpList::initialize() {
addWidget(new Header(tr("tc.user.IpList")));
last_used_ = new Wt::Wc::TimeDurationWidget(
config::min::IP_LAST_USED,
config::defaults::IP_LAST_USED,
config::max::IP_LAST_USED,
this);
Wt::WPushButton* b = new Wt::WPushButton(tr("tc.common.Apply"), this);
b->clicked().connect(this, &IpList::apply);
IpListView* view = new IpListView(model_, this);
}
示例10: setStyleClass
/* ****************************************************************************
* Edit Users
*/
EditUsers::EditUsers(Wt::Dbo::Session& aSession, const std::string& basePath) : session_(aSession), basePath_(basePath)
{
setStyleClass("user-editor");
setTemplateText(tr("edit-users-list"));
limitEdit_ = new Wt::WLineEdit;
Wt::WPushButton* goLimit = new Wt::WPushButton(tr("go-limit"));
goLimit->clicked().connect(SLOT(this, EditUsers::LimitList));
bindWidget("limit-edit",limitEdit_);
bindWidget("limit-button",goLimit);
LimitList();
} // end EditUsers::EditUsers
示例11: t
AdminWidget::AdminWidget(Wt::WContainerWidget* p):
Wt::WContainerWidget(p) {
dbo::Transaction t(fApp->session());
Wt::WPushButton* save = new Wt::WPushButton(tr("facts.admin.Save"), this);
save->clicked().connect(this, &AdminWidget::save_handler_);
Wt::WPushButton* add = new Wt::WPushButton(tr("facts.admin.Add"), this);
add->clicked().connect(this, &AdminWidget::add_handler_);
Q query = fApp->session().find<Fact>();
FactListModel* model = new FactListModel(query, this);
view_ = new FactListView(model, this);
new BanWidget(this);
t.commit();
}
示例12:
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;
}));
}
示例13: openEditDialog
void ProfileList::openEditDialog(db::Preset preset)
{
_dialog = new Wt::WDialog("Edit Preset", this);
_dialog->setClosable(true);
ProfileEditor * editor = new ProfileEditor(preset,_dialog->contents());
Wt::WPushButton *ok = new Wt::WPushButton("Analyze & Save", _dialog->footer());
ok->setDefault(true);
ok->clicked().connect(editor, &ProfileEditor::saveProfile);
Wt::WPushButton *cancel = new Wt::WPushButton("Cancel", _dialog->footer());
cancel->clicked().connect(_dialog, &Wt::WDialog::reject);
editor->_presetSaved.connect(this, &ProfileList::dialogSave);
_dialog->show();
}
示例14: s
Upload::Upload( Wt::WContainerWidget* pcw ) {
//Wt::WContainerWidget *container = new Wt::WContainerWidget();
Wt::WFileUpload *fu = new Wt::WFileUpload( pcw );
fu->setFileTextSize( 10000 ); // Set the maximum file size (in KB )
fu->setProgressBar(new Wt::WProgressBar());
fu->setMargin(10, Wt::Right);
// Provide a button to start uploading.
Wt::WPushButton *uploadButton = new Wt::WPushButton("Send", pcw );
uploadButton->setMargin(10, Wt::Left | Wt::Right);
Wt::WText *out = new Wt::WText( pcw );
// Upload when the button is clicked.
uploadButton->clicked().connect(std::bind([=] () {
fu->upload();
uploadButton->disable();
}));
// Upload automatically when the user entered a file.
fu->changed().connect(std::bind([=] () {
fu->upload();
uploadButton->disable();
std::string s( "File upload is changed." );
out->setText( s );
}));
// React to a succesfull upload.
fu->uploaded().connect(std::bind([=] () {
std::string s( "File upload is finished: " );
s += fu->clientFileName().toUTF8();
s += ",";
//s += fu->fileTextSize()
s += fu->spoolFileName();
//fu->stealSpooledFile()
out->setText( s );
}));
// React to a file upload problem.
fu->fileTooLarge().connect(std::bind([=] () {
out->setText("File is too large.");
}));
}
示例15: LightDiode
WeldingTypesPannel::WeldingTypesPannel() {
this->setStyleClass("welding-type");
Wt::WVBoxLayout *vlayout = new Wt::WVBoxLayout(this);
vlayout->setContentsMargins(5, 5, 5, 5);
vlayout->addWidget(new Wt::WText(Wt::WString::tr("WeldingTypesPannel")));
Wt::WPushButton *button = new Wt::WPushButton(Wt::WString::tr("gas_check_button"));
button->clicked().connect(std::bind([=] () {
//canvas->clear();
}));
vlayout->addWidget(button);
vlayout->addWidget(new LightDiode("indication_standart_welding"));
vlayout->addWidget(new LightDiode("indication_pulse_welding"));
button = new Wt::WPushButton(Wt::WString::tr("welding_type_button"));
button->clicked().connect(std::bind([=] () {
//canvas->clear();
}));
vlayout->addWidget(button);
}