本文整理汇总了C++中wt::WContainerWidget类的典型用法代码示例。如果您正苦于以下问题:C++ WContainerWidget类的具体用法?C++ WContainerWidget怎么用?C++ WContainerWidget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WContainerWidget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onTokenReady
void CommentContainerWidget::onTokenReady(uint32_t token, bool ok)
{
if(ok)
{
clear();
std::vector<RsGxsComment> comments;
//_CommentService->getRelatedComments(token, comments);
_CommentService->getCommentData(token, comments);
for(std::vector<RsGxsComment>::iterator vit = comments.begin(); vit != comments.end(); vit++)
{
RsGxsComment& comment = *vit;
Wt::WContainerWidget* outerContainer = new Wt::WContainerWidget(this);
Wt::WBorderLayout *layout = new Wt::WBorderLayout();
outerContainer->setLayout(layout);
AvatarWidgetWt* avatar = new AvatarWidgetWt(true);
avatar->setIdentity(comment.mMeta.mAuthorId);
layout->addWidget(avatar, Wt::WBorderLayout::West);
Wt::WLabel* text = new Wt::WLabel(Wt::WString::fromUTF8(comment.mComment));
layout->addWidget(text, Wt::WBorderLayout::Center);
}
// note: the widgets the pointers where pointing to where deleted by clear()
_TextArea = new Wt::WTextArea(this);
_TextArea->setEmptyText("your comment");
//_IdChooser = new GxsIdChooserWt(this);
_SubmitButton = new Wt::WPushButton("submit", this);
_SubmitButton->clicked().connect(this, &CommentContainerWidget::onSubmitComment);
}
else
{
clear();
new Wt::WLabel("FAIL", this);
}
}
示例2:
/////////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;
}
示例3: setTheme
Tester::Tester(const Wt::WEnvironment& env)
: Wt::WApplication(env)
{
setTheme(new Wt::WBootstrapTheme());
useStyleSheet("resources/lpeg_tester.css");
Wt::WContainerWidget* container = new Wt::WContainerWidget();
container->setStyleClass("page");
Wt::WVBoxLayout* vbox = new Wt::WVBoxLayout();
container->setLayout(vbox);
vbox->addWidget(Title(), 1);
Wt::WHBoxLayout* hbox = new Wt::WHBoxLayout();
vbox->addLayout(hbox);
hbox->addWidget(Input(), 1);
hbox->addWidget(Result(), 1);
root()->addWidget(container);
HandleInternalPath(internalPath());
internalPathChanged().connect(this, &Tester::HandleInternalPath);
}
示例4: WBreak
About::About() {
WContainerWidget *cw = new WContainerWidget();
cw->addWidget(new WBreak());
cw->addWidget(new WBreak());
this->addWidget(cw);
Wt::WContainerWidget *j = new Wt::WContainerWidget(this);
j->resize(WLength::Auto, 200);
Wt::WGridLayout *lay = new Wt::WGridLayout();
store="<p>jonny jonny yes papa,"
" Eating sugar no papa "
"Telling lie, no papa "
"Open your mouth .</p>haha. ";
//lay->addWidget(new Wt::WText("this site is made by parvinder rajput. \n who are pursuing is b.tech from gndec ludhiana."),0,0);
// lay->addWidget(new Wt::WText("this is dean of consultancy cell"), 0, 2);
//lay->addWidget(new Wt::WText("Hello"), 0, 0);
//lay->addWidget(new Wt::WImage("/images/Footer.jpg"), 0,0);
lay->addWidget(new Wt::WText(store ), 0,3);
lay->addWidget(new Wt::WImage("/images/jj.jpg"), 0,0);
lay->addWidget(new Wt::WImage("/images/uu.gif"), 0,2);
j->setLayout(lay);
}
示例5: setMenu
void WMenuItem::setMenu(WMenu *menu)
{
subMenu_ = menu;
subMenu_->parentItem_ = this;
Wt::WContainerWidget *sparent
= dynamic_cast<Wt::WContainerWidget *>(subMenu_->parent());
if (sparent)
sparent->removeWidget(subMenu_);
addWidget(subMenu_);
if (subMenu_->isPopup() &&
parentMenu() && parentMenu()->isPopup()) {
subMenu_->webWidget()->setZIndex(std::max(parentMenu()->zIndex() + 100, subMenu_->zIndex()));
}
WPopupMenu *popup = dynamic_cast<WPopupMenu *>(subMenu_);
if (popup) {
popup->setJavaScriptMember("wtNoReparent", "true");
setSelectable(false);
popup->setButton(anchor());
updateInternalPath();
// WPopupMenus are hidden by default, 'show' this WPopupMenu
// but not really, since the parent is still hidden. This fixes
// an issue where child widgets would remain unexposed, even
// though this submenu was open (e.g. in a submenu where items
// are checkable)
if (dynamic_cast<WPopupMenu*>(menu_))
popup->show();
}
}
示例6: 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;
}
示例7:
Wt::WWidget * ribi::con3::WtMenuDialog::CreateNewSelectPlayersDialog()
{
Wt::WContainerWidget * dialog = new Wt::WContainerWidget;
dialog->setContentAlignment(Wt::AlignCenter);
dialog->addWidget(new Wt::WBreak);
dialog->addWidget(m_select);
return dialog;
}
示例8: setTitle
/**
Constructor for View
/usr/lib/Wt/examples/widgetgallery/examples/ComboBoxModel.cpp
https://www.webtoolkit.eu/widgets/forms/combo-box
https://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WComboBox.html
*/
View::View(const Wt::WEnvironment& env)
: Wt::WApplication(env)
{
setTitle("DropDown Demo");
log("info") << "Test";
// This is the container for the full screen.
Wt::WContainerWidget *pScreenContainer = new Wt::WContainerWidget();
pScreenContainer->resize(Wt::WLength::Auto, Wt::WLength::Auto);
// Add the primary container to the root widget?
root()->addWidget(pScreenContainer);
// Choose the grid layout.
Wt::WGridLayout *pScreenLayout = new Wt::WGridLayout();
pScreenContainer->setLayout(pScreenLayout);
int nRow = 0;
int nColoumn = 0;
// Create the label
Wt::WText *lblSeriesChoice = new Wt::WText("Series:");
// set right align the label
lblSeriesChoice->setTextAlignment(Wt::AlignRight);
pScreenLayout->addWidget(lblSeriesChoice, nRow, nColoumn+0);
// Create the dropdown
Wt::WComboBox *cbSeries = new Wt::WComboBox();
cbSeries->addItem("");
cbSeries->addItem("New");
cbSeries->addItem("Krakken awoke");
cbSeries->addItem("Appocalypse survival");
cbSeries->setCurrentIndex(0); // Empty string
pScreenLayout->addWidget(cbSeries, nRow, nColoumn+1);
// Create the connection
cbSeries->activated().connect(this, &View::DropDownSelectionChangeOtherDropDown);
cbSeries->activated().connect(this, &View::DropDownSelectionChangeTab);
/* Signals connect to Slots.
* You may specify up to 6 arguments which may be of arbitrary types that are Copyable, that may be passed through the signal to connected slots.
* https://www.webtoolkit.eu/wt/doc/reference/html/group__signalslot.html
* I think the
* first parm - is a pointer to the target class.
* second parm - is the name of the method?
*
* See: Wt::Signal.
*/
/*
* Let row 1 and column 1 take the excess space.?
*/
pScreenLayout->setRowStretch(0, 0);
pScreenLayout->setColumnStretch(0, 0);
} // end
示例9: authenticated
void WebApp::authenticated() {
_isAuthenticated = true;
_user_id = login->getUserId();
west->layout()->addWidget(menu = createMenuTree());
west->expand();
Wt::WContainerWidget *container = new Wt::WContainerWidget(exampleContainer_);
container->addWidget(new Wt::WText(Wt::WString::tr("about")));
login->setHidden(true);
currentExample_ = container;
}
示例10: logout
void WebApp::logout() {
_isAuthenticated = false;
_user_id = 0;
west->layout()->removeWidget(menu);
delete menu;
west->collapse();
Wt::WContainerWidget *container = new Wt::WContainerWidget(exampleContainer_);
container->addWidget(new Wt::WText(Wt::WString::tr("logged_out")));
setContent(container);
}
示例11: renderUI
void AdsEditor::renderUI() {
AdsApplication *app = AdsApplication::adsApplication();
cppdb::session &db = app->db_;
clear();
WPushButton *btn = new WPushButton("Criar Anuncio", this);
btn->clicked().connect(this, &AdsEditor::novoAnuncio);
WPushButton *update = new WPushButton("Atualiza", this);
update->clicked().connect(this, &AdsEditor::renderUI);
new WBreak(this);
new WBreak(this);
new WText("<h3>Lista de Anuncios</h3>",this);
Wt::WContainerWidget *w = new Wt::WContainerWidget(this);
w->resize(600, WLength::Auto);
WVBoxLayout *layout = new Wt::WVBoxLayout();
cppdb::result res = db <<
"select id, titulo, url, imagem, texto, ativo "
" from anuncio";
while(res.next()) {
WContainerWidget *cont = new WContainerWidget();
AdsAnuncio *anuncio = new AdsAnuncio(cont);
res >> anuncio->id >> anuncio->titulo_ >> anuncio->link_ >>
anuncio->imagem_ >> anuncio->texto_ >> anuncio->ativo_;
WPushButton *tituloBtn = new WPushButton("Titulo",cont);
tituloBtn->clicked().connect(anuncio, &AdsAnuncio::editarTitulo);
WPushButton *urlBtn = new WPushButton("URL",cont);
urlBtn->clicked().connect(anuncio, &AdsAnuncio::editarURL);
WPushButton *imagemBtn = new WPushButton("Imagem",cont);
imagemBtn->clicked().connect(anuncio, &AdsAnuncio::editarImagem);
WPushButton *textoBtn = new WPushButton("Texto",cont);
textoBtn->clicked().connect(anuncio, &AdsAnuncio::editarTexto);
WCheckBox *ativoCheck = new Wt::WCheckBox("Ativo",cont);
if(anuncio->ativo_ == 1)
ativoCheck->setChecked(true);
else
ativoCheck->setChecked(false);
ativoCheck->changed().connect(anuncio, &AdsAnuncio::changeAtiva);
WPushButton *deletaBtn = new WPushButton("Deleta",cont);
deletaBtn->clicked().connect(anuncio, &AdsAnuncio::deletaAnuncio);
anuncio->renderUI();
layout->addWidget(cont);
}
w->setLayout(layout);
}
示例12: Result
Wt::WWidget* Tester::Result()
{
Wt::WContainerWidget* c = new Wt::WContainerWidget();
c->setStyleClass("result_container");
Wt::WText* t = new Wt::WText("Results", c);
t->setStyleClass("area_title");
mResult = new Wt::WContainerWidget(c);
mResult->setStyleClass("result_output");
return c;
}
示例13: WText
void
WHexDump::init() {
Wt::WVBoxLayout *vbox = new Wt::WVBoxLayout;
setLayout(vbox);
Wt::WContainerWidget *actionsBox = new Wt::WContainerWidget;
vbox->addWidget(actionsBox);
{
new Wt::WText("Goto: ", actionsBox);
wAddressEdit_ = new Wt::WLineEdit(actionsBox);
wAddressEdit_->enterPressed().connect(this, &WHexDump::handleGoto);
new Wt::WBreak(actionsBox);
new Wt::WText("Search: ", actionsBox);
wSearchEdit_ = new Wt::WLineEdit(actionsBox);
wSearchEdit_->keyPressed().connect(this, &WHexDump::resetSearch);
wSearchNext_ = new Wt::WPushButton("Find", actionsBox);
wSearchNext_->clicked().connect(this, &WHexDump::handleSearch);
wSearchResults_ = new Wt::WText("Enter a big-endian hexadecimal value", actionsBox);
}
Wt::WContainerWidget *tableContainer = new Wt::WContainerWidget;
vbox->addWidget(tableContainer, 1 /*stretch*/);
Wt::WHBoxLayout *hbox = new Wt::WHBoxLayout; // so the table scrolls horizontally
tableContainer->setLayout(hbox);
model_ = new HexDumpModel;
tableView_ = new Wt::WTableView;
tableView_->setModel(model_);
tableView_->setRowHeaderCount(1); // this must be first property set
tableView_->setHeaderHeight(28);
tableView_->setSortingEnabled(false);
tableView_->setAlternatingRowColors(false); // true interferes with our blacking out unmapped addresses
tableView_->setColumnResizeEnabled(true);
tableView_->setSelectionMode(Wt::SingleSelection);
tableView_->setEditTriggers(Wt::WAbstractItemView::NoEditTrigger);
tableView_->setColumnWidth(addressColumn, Wt::WLength(6, Wt::WLength::FontEm));
tableView_->setColumnWidth(sep1Column, Wt::WLength(1, Wt::WLength::FontEm));
tableView_->setColumnWidth(sep2Column, Wt::WLength(1, Wt::WLength::FontEm));
for (size_t i=0; i<bytesPerRow; ++i) {
int extra = 7==i%8 && i+1<bytesPerRow ? 1 : 0;
tableView_->setColumnWidth(bytesColumn + i, Wt::WLength(2+extra, Wt::WLength::FontEm));
tableView_->setColumnWidth(asciiColumn + i, Wt::WLength(2+extra, Wt::WLength::FontEm));
}
tableView_->clicked().connect(boost::bind(&WHexDump::handleClick, this, _1));
hbox->addWidget(tableView_);
}
示例14: setLayout
PresetFilterPanel::PresetFilterPanel(org::esb::hive::PresetReader::FilterList &filter) :_filterlist(filter), Wt::Ext::Panel() {
setLayout(new Wt::WFitLayout());
Wt::WContainerWidget * main = new Wt::WContainerWidget();
grid = new Wt::WGridLayout();
main->setLayout(grid);
layout()->addWidget(main);
grid->addWidget(filter_table = new PresetFilterTable(filter), 0, 0);
_cont=new Wt::WContainerWidget();
_cont->setLayout(new Wt::WBorderLayout());
_cont->resize(600,300);
grid->addWidget(_cont, 1, 0);
filter_table->itemSelectionChanged().connect(SLOT(this,PresetFilterPanel::filterSelected));
}
示例15: WLabel
Wt::WWidget * ribi::WtAsciiArterMainDialog::CreateNewWelcomeDialog() const
{
Wt::WContainerWidget * dialog = new Wt::WContainerWidget;
dialog->setContentAlignment(Wt::AlignCenter);
dialog->addWidget(new Wt::WBreak);
new Wt::WLabel("Welcome to AsciiArter",dialog);
new Wt::WBreak(dialog);
new Wt::WBreak(dialog);
new Wt::WLabel("AsciiArter is a tool to convert images to ascii art.",dialog);
new Wt::WBreak(dialog);
new Wt::WBreak(dialog);
Wt::WGroupBox * const box = new Wt::WGroupBox("Explanation",dialog);
box->addWidget(new Wt::WImage("ToolAsciiArterWelcome.png"));
return dialog;
}