本文整理汇总了C++中wt::WVBoxLayout::addLayout方法的典型用法代码示例。如果您正苦于以下问题:C++ WVBoxLayout::addLayout方法的具体用法?C++ WVBoxLayout::addLayout怎么用?C++ WVBoxLayout::addLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wt::WVBoxLayout
的用法示例。
在下文中一共展示了WVBoxLayout::addLayout方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resize
HeightLines::HeightLines()
{
museums.set("mapbox://mapbox.2opop9hr");
contours.set("mapbox://mapbox.mapbox-terrain-v2");
museumLayer.set(&museums);
museumLayer.sourceLayer("museum-cusco");
museumLayer.radius(8);
museumLayer.color(Wt::WColor(55, 148, 179));
contourLayer.set(&contours);
contourLayer.sourceLayer("contour");
contourLayer.join(MapBox::JOIN::Round);
contourLayer.cap(MapBox::CAP::Round);
contourLayer.color(Wt::WColor("#877b59"));
contourLayer.width(1);
resize(250, 100);
Wt::WVBoxLayout * vbox = new Wt::WVBoxLayout();
setLayout(vbox);
Wt::WHBoxLayout * hbox = new Wt::WHBoxLayout();
vbox->addLayout(hbox);
Wt::WText * t = new Wt::WText("Width: ", this);
t->setMargin(10);
hbox->addWidget(t);
Wt::WSlider * slider = new Wt::WSlider(this);
slider->resize(200, 12);
slider->setMinimum(1);
slider->setMaximum(10);
slider->setValue(1);
hbox->addWidget(slider);
slider->valueChanged().connect(std::bind([=]() {
contourLayer.width(slider->value());
}));
hbox = new Wt::WHBoxLayout();
vbox->addLayout(hbox);
t = new Wt::WText("Blur: ", this);
t->setMargin(10);
hbox->addWidget(t);
slider = new Wt::WSlider(this);
slider->resize(200, 12);
slider->setMinimum(0);
slider->setMaximum(10);
slider->setValue(0);
hbox->addWidget(slider);
slider->valueChanged().connect(std::bind([=]() {
contourLayer.blur(slider->value());
}));
}
示例2: 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);
}
示例3: RegionsCreator
/*!
* \brief Конструктор класса сайта.
* \param[in] Класс хранения окружения сайта
*/
CompanyesApplication(const Wt::WEnvironment& env)
: Wt::WApplication(env)
{
this->messageResourceBundle().use(this->appRoot() + "rus_locale");
this->useStyleSheet(this->appRoot() + "main.css");
this->setTitle(Wt::WString::tr("Title"));
Wt::WApplication *app = Wt::WApplication::instance();
app->setLoadingIndicator(new Wt::WOverlayLoadingIndicator());
app->styleSheet().addRule("body", "margin: 0px");
Wt::WStackedWidget* contents = new Wt::WStackedWidget();
contents->setOverflow(Wt::WContainerWidget::OverflowAuto);
contents->setPositionScheme(Wt::Relative);
Wt::WMenu* menu = new Wt::WMenu(contents, Wt::Vertical, 0);
menu->setRenderAsList(true);
menu->setStyleClass("menu");
std::string absolute_path = boost::filesystem::system_complete(boost::filesystem::path(".")).string();
new RegionsCreator(absolute_path, contents, menu);
Wt::WHBoxLayout* hlayout = new Wt::WHBoxLayout();
hlayout->addWidget(menu, 0);
hlayout->addWidget(contents, 1);
Wt::WVBoxLayout* vlayout = new Wt::WVBoxLayout(this->root());
vlayout->addWidget(new Wt::WText(Wt::WString::tr("Header")), 0);
vlayout->addLayout(hlayout, 1);
}
示例4: mPeers
AddFriendDialog(RsPeers *mp) : mPeers(mp)
{
Wt::WVBoxLayout *layout = new Wt::WVBoxLayout ;
contents()->setLayout(layout) ;
// add a text box to paste the certificate into
_cert_area = new Wt::WTextArea(contents()) ;
_cert_area->setEmptyText("Paste a Retroshare certificate here to make friend with someone.") ;
_cert_area->setMinimumSize(560,300) ;
layout->addWidget(_cert_area,1) ;
_cert_area->changed().connect(this,&AddFriendDialog::updateCertInfo) ;
// add a text label to display the info
Wt::WString str ;
str += "Not a valid certificate<br/>" ;
str += "<b>Name</b> \t\t: <br/>" ;
str += "<b>PGP id</b> \t\t: <br/>" ;
str += "<b>PGP fingerprint</b> \t: <br/>" ;
str += "<b>Location name </b> \t: <br/>" ;
str += "<b>Location ID </b> \t: <br/>" ;
_info_label = new Wt::WLabel(str,contents()) ;
_info_label->setMinimumSize(128,0) ;
layout->addWidget(_info_label) ;
// add buttons 'make friend', 'only add to keyring', 'cancel'
Wt::WHBoxLayout *lay2 = new Wt::WHBoxLayout;
_ok_bnt = new Wt::WPushButton("Make friend", contents());
lay2->addWidget(_ok_bnt) ;
_ok_bnt->clicked().connect(this, &AddFriendDialog::makeFriend);
_ok_bnt->setEnabled(false) ;
Wt::WPushButton *cn_bnt = new Wt::WPushButton("Cancel", contents());
lay2->addWidget(cn_bnt) ;
cn_bnt->clicked().connect(this, &Wt::WDialog::reject);
lay2->addStretch() ;
layout->addLayout(lay2) ;
layout->addSpacing(0);
_timer = new Wt::WTimer(this) ;
_timer->setInterval(1000) ;
_timer->timeout().connect(this,&AddFriendDialog::updateCertInfo) ;
_timer->start() ;
setMinimumSize(620,300) ;
//resize() ;
}
示例5: showFriendDetails
void RSWappFriendsPage::showFriendDetails(const std::string& friend_id)
{
RsPeerDetails info ;
if(!mPeers->getPeerDetails(friend_id,info))
{
std::cerr << "Can't get file details for friend " << friend_id << std::endl;
return ;
}
#ifdef DEBUG_FRIENDSPAGE
std::cerr << "Showing peer details: " << std::endl;
std::cerr << info << std::endl;
#endif
Wt::WDialog dialog ;
dialog.setModal(false) ;
Wt::WVBoxLayout *layout = new Wt::WVBoxLayout ;
dialog.contents()->setLayout(layout) ;
Wt::WHBoxLayout *layout2 = new Wt::WHBoxLayout ;
Wt::WImage *img = new Wt::WImage(_model->getAvatarUrl(friend_id),dialog.contents());
img->setMinimumSize(128,128) ;
img->setMaximumSize(128,128) ;
layout2->addWidget(img) ;
layout2->addStretch() ;
layout->addLayout(layout2,1) ;
Wt::WString str ;
str += "<br/>" ;
str += "<b>Name</b> \t\t: " + info.name + "<br/>" ;
str += "<b>PGP id</b> \t\t: " + info.gpg_id + "<br/>" ;
str += "<b>PGP fingerprint</b> \t: " + info.fpr + "<br/>" ;
str += "<b>Location name </b> \t: " + info.location + "<br/>" ;
str += "<b>Location ID </b> \t: " + info.id + "<br/>" ;
layout->addWidget(new Wt::WLabel(str,dialog.contents())) ;
Wt::WPushButton ok("Ok", dialog.contents());
layout->addWidget(&ok) ;
ok.clicked().connect(&dialog, &Wt::WDialog::accept);
dialog.exec() ;
}