本文整理汇总了C++中wt::WVBoxLayout类的典型用法代码示例。如果您正苦于以下问题:C++ WVBoxLayout类的具体用法?C++ WVBoxLayout怎么用?C++ WVBoxLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WVBoxLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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());
}));
}
示例4: analyzers
void
WFunctionSummary::init() {
Wt::WVBoxLayout *vbox = new Wt::WVBoxLayout;
this->setLayout(vbox);
analyzers().push_back(FunctionEntryAddress::instance());
analyzers().push_back(FunctionName::instance());
analyzers().push_back(FunctionSizeBytes::instance());
analyzers().push_back(FunctionSizeInsns::instance());
analyzers().push_back(FunctionSizeBBlocks::instance());
analyzers().push_back(FunctionSizeDBlocks::instance());
analyzers().push_back(FunctionNDiscontiguousBlocks::instance());
analyzers().push_back(FunctionNIntervals::instance());
analyzers().push_back(FunctionImported::instance());
analyzers().push_back(FunctionExported::instance());
analyzers().push_back(FunctionNCallers::instance());
analyzers().push_back(FunctionNReturns::instance());
analyzers().push_back(FunctionMayReturn::instance());
analyzers().push_back(FunctionStackDelta::instance());
// Build a table to hold analysis results. The results will be organized into NCOLS each occupying two table columns (one
// for the name and one for the value).
const size_t NROWS = (analyzers_.size() + NCOLS - 1) / NCOLS;
wAnalysisResultTable_ = new Wt::WTable();
vbox->addWidget(wAnalysisResultTable_);
Wt::WCssDecorationStyle labelDecor;
labelDecor.setBackgroundColor(toWt(Color::HSV(0, 0, 0.95)));
for (size_t col=0, i=0; col<NCOLS && i<analyzers_.size(); ++col) {
for (size_t row=0; row<NROWS && i<analyzers_.size(); ++row) {
Wt::WText *wLabel = new Wt::WText("<b>" + analyzers_[i]->name() + "</b>");
wLabel->setToolTip(analyzers_[i]->toolTip());
wAnalysisResultTable_->elementAt(row, 2*col+0)->addWidget(wLabel);
wAnalysisResultTable_->elementAt(row, 2*col+0)->setContentAlignment(Wt::AlignRight);
wAnalysisResultTable_->elementAt(row, 2*col+0)->setDecorationStyle(labelDecor);
Wt::WText *wValue = new Wt::WText;
wValue->setTextFormat(Wt::PlainText);
analyzerResults_.push_back(wValue);
analyzerResults_.back()->setToolTip(analyzers_[i]->toolTip());
wAnalysisResultTable_->elementAt(row, 2*col+1)->addWidget(analyzerResults_.back());
wAnalysisResultTable_->elementAt(row, 2*col+1)->setPadding(Wt::WLength(1, Wt::WLength::FontEm), Wt::Left);
wAnalysisResultTable_->elementAt(row, 2*col+1)->setPadding(Wt::WLength(10, Wt::WLength::FontEm), Wt::Right);
++i;
}
}
// Text area to hold function comments
wFunctionComments_ = new Wt::WTextArea;
vbox->addWidget(wFunctionComments_, 1 /*stretch*/);
// FIXME[Robb P. Matzke 2015-05-06]: We don't provide a way to save results yet, so don't allow comment editing
wFunctionComments_->setEnabled(false);
}
示例5: 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() ;
}
示例6: 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_);
}
示例7: 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() ;
}
示例8: WCompositeWidget
RSWappFriendsPage::RSWappFriendsPage(Wt::WContainerWidget *parent,RsPeers *mpeers,RsMsgs *mmsgs)
: WCompositeWidget(parent),mPeers(mpeers)
{
setImplementation(_impl = new Wt::WContainerWidget()) ;
Wt::WVBoxLayout *layout = new Wt::WVBoxLayout() ;
_impl->setLayout(layout) ;
_tableView = new Wt::WTableView(_impl);
_tableView->setAlternatingRowColors(true);
//tableView->setModel(fileFilterModel_);
_tableView->setSelectionMode(Wt::ExtendedSelection);
_tableView->setDragEnabled(true);
_tableView->setColumnWidth(COLUMN_AVATAR, 20);
_tableView->setColumnWidth(COLUMN_NAME , 200);
_tableView->setColumnWidth(COLUMN_PGP_ID, 150);
_tableView->setColumnWidth(COLUMN_SSL_ID, 250);
_tableView->setColumnWidth(COLUMN_LAST_S, 150);
_tableView->setColumnWidth(COLUMN_IP , 150);
_tableView->setModel(_model = new FriendListModel(mpeers,mmsgs)) ;
_model->refresh() ;
_tableView->setItemDelegateForColumn(COLUMN_AVATAR,new FriendPageAvatarDelegate(_model)) ;
Wt::WPushButton *add_friend_button = new Wt::WPushButton("Add new friend") ;
layout->addWidget(add_friend_button,1) ;
layout->addWidget(_tableView) ;
_popupMenu = NULL ;
_tableView->mouseWentUp().connect(this,&RSWappFriendsPage::showCustomPopupMenu) ;
add_friend_button->clicked().connect(this,&RSWappFriendsPage::addFriend) ;
// add a button to add new friends.
//
_timer = new Wt::WTimer(this) ;
_timer->setInterval(5000) ;
_timer->timeout().connect(this,&RSWappFriendsPage::refresh) ;
_timer->start() ;
}
示例9: animation
WidgetGallery::WidgetGallery()
: WContainerWidget()
{
setOverflow(OverflowHidden);
navigation_ = new Wt::WNavigationBar();
navigation_->addStyleClass("main-nav");
navigation_->setTitle("Wt Widget Gallery",
"https://www.webtoolkit.eu/widgets");
navigation_->setResponsive(true);
contentsStack_ = new Wt::WStackedWidget();
Wt::WAnimation animation(Wt::WAnimation::Fade,
Wt::WAnimation::Linear,
200);
contentsStack_->setTransitionAnimation(animation, true);
/*
* Setup the top-level menu
*/
Wt::WMenu *menu = new Wt::WMenu(contentsStack_, 0);
menu->setInternalPathEnabled();
menu->setInternalBasePath("/");
addToMenu(menu, "Layout", new Layout());
addToMenu(menu, "Forms", new FormWidgets());
addToMenu(menu, "Navigation", new Navigation());
addToMenu(menu, "Trees & Tables", new TreesTables())
->setPathComponent("trees-tables");
addToMenu(menu, "Graphics & Charts", new GraphicsWidgets())
->setPathComponent("graphics-charts");
// addToMenu(menu, "Events", new EventsDemo());
addToMenu(menu, "Media", new Media());
navigation_->addMenu(menu);
/*
* Add it all inside a layout
*/
Wt::WVBoxLayout *layout = new Wt::WVBoxLayout(this);
layout->addWidget(navigation_);
layout->addWidget(contentsStack_, 1);
layout->setContentsMargins(0, 0, 0, 0);
}
示例10: createLayout
void PopupChatWidget::createLayout(Wt::WWidget *messages,
Wt::WWidget *userList,
Wt::WWidget *messageEdit,
Wt::WWidget *sendButton,
Wt::WWidget *logoutButton)
{
Wt::WVBoxLayout *layout = new Wt::WVBoxLayout();
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
Wt::WContainerWidget *bar = createBar();
layout->addWidget(bar);
layout->addWidget(messages, 1);
layout->addWidget(messageEdit);
setLayout(layout);
}
示例11: animation
Wt::WMenuItem *WidgetGallery::addToMenu(Wt::WMenu *menu,
const Wt::WString& name,
TopicWidget *topic)
{
Wt::WContainerWidget *result = new Wt::WContainerWidget();
Wt::WContainerWidget *pane = new Wt::WContainerWidget();
Wt::WVBoxLayout *vLayout = new Wt::WVBoxLayout(result);
vLayout->setContentsMargins(0, 0, 0, 0);
vLayout->addWidget(topic);
vLayout->addWidget(pane, 1);
Wt::WHBoxLayout *hLayout = new Wt::WHBoxLayout(pane);
Wt::WMenuItem *item = new Wt::WMenuItem(name, result);
menu->addItem(item);
Wt::WStackedWidget *subStack = new Wt::WStackedWidget();
subStack->addStyleClass("contents");
subStack->setOverflow(WContainerWidget::OverflowAuto);
/*
Wt::WAnimation animation(Wt::WAnimation::Fade,
Wt::WAnimation::Linear,
100);
subStack->setTransitionAnimation(animation, true);
*/
Wt::WMenu *subMenu = new Wt::WMenu(subStack);
subMenu->addStyleClass("nav-pills nav-stacked");
subMenu->setWidth(200);
hLayout->addWidget(subMenu);
hLayout->addWidget(subStack,1);
subMenu->setInternalPathEnabled();
subMenu->setInternalBasePath("/" + item->pathComponent());
topic->populateSubMenu(subMenu);
return item;
}
示例12: 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);
}
示例13: login
void SimpleWebWidget::login()
{
clear();
btnGroundPower_ = new Wt::WPushButton("Ground Power\nconnect/disconnect");
btnGroundAir_ = new Wt::WPushButton("Ground Air\n connect/disconnect");
btnDoor1_ = new Wt::WPushButton("Open/Close\n Door1");
btnDoor2_ = new Wt::WPushButton("Open/Close\n Door2");
btnDoor3_ = new Wt::WPushButton("Open/Close\n Door3");
btnPushBack1_ = new Wt::WPushButton("Start Pushback\nTail Left");
btnPushBack2_ = new Wt::WPushButton("Start Pushback\nStraight");
btnPushBack3_ = new Wt::WPushButton("Start Pushback\nTail Right");
btnPushBack4_ = new Wt::WPushButton("STOP\nPushBack");
btnVirtualKey1_ = new Wt::WPushButton("Send 1");
btnVirtualKey2_ = new Wt::WPushButton("Send 2");
btnVirtualKey3_ = new Wt::WPushButton("Send 3");
btnVirtualKey4_ = new Wt::WPushButton("Send 4");
btnVirtualKey5_ = new Wt::WPushButton("Send 5");
btnVirtualKey6_ = new Wt::WPushButton("Send 6");
btnVirtualKey7_ = new Wt::WPushButton("Send 7");
btnVirtualKey8_ = new Wt::WPushButton("Send 8");
btnVirtualKey9_ = new Wt::WPushButton("Send 9");
btnVirtualKey0_ = new Wt::WPushButton("Send 0");
btnVirtualKeyF12_ = new Wt::WPushButton("Send F12");
txtWxrDep = new Wt::WText("DEPARTURE AIRPORT IS NOT SET");
txtWxrTafDep = new Wt::WText("DEPARTURE AIRPORT IS NOT SET");
txtWxrArr = new Wt::WText("ARRIVAL AIRPORT IS NOT SET");
txtWxrTafArr = new Wt::WText("ARRIVAL AIRPORT IS NOT SET");
txtGSXText = new Wt::WText("");
btnGroundPower_->setStyleClass("btn-danger");
btnGroundAir_->setStyleClass("btn-danger");
btnDoor1_->setStyleClass("btn-danger");
btnDoor2_->setStyleClass("btn-danger");
btnDoor3_->setStyleClass("btn-danger");
btnPushBack1_->setStyleClass("btn-danger");
btnPushBack2_->setStyleClass("btn-danger");
btnPushBack3_->setStyleClass("btn-danger");
btnPushBack4_->setStyleClass("btn-danger");
dialog = new Wt::WDialog("No connection");
Wt::WLabel *label = new Wt::WLabel("Waiting for simulator connection with iFly 737NG",
dialog->contents());
Wt::WNavigationBar *navigation = new Wt::WNavigationBar();
Wt::WStackedWidget *contentsStack = new Wt::WStackedWidget();
Wt::WContainerWidget *groundContainer = new Wt::WContainerWidget();
Wt::WContainerWidget *weatherContainer = new Wt::WContainerWidget();
Wt::WContainerWidget *mapContainer = new Wt::WContainerWidget();
Wt::WContainerWidget *infoContainer = new Wt::WContainerWidget();
Wt::WContainerWidget *gsxContainer = new Wt::WContainerWidget();
Wt::WContainerWidget *statusContainer = new Wt::WContainerWidget();
Wt::WVBoxLayout *mainVLayout = new WVBoxLayout();
setLayout(mainVLayout);
// Create a navigation bar with a link to a web page.
navigation->setTitle("737ng.kapsi.fi",
"http://737ng.kapsi.fi");
navigation->setResponsive(true);
// Setup a Left-aligned menu.
contentsStack->addStyleClass("contents");
Wt::WMenu *leftMenu = new Wt::WMenu(contentsStack);
navigation->addMenu(leftMenu);
leftMenu->addItem("Ground", groundContainer);
leftMenu->addItem("Weather", weatherContainer);
leftMenu->addItem("Map", mapContainer);
leftMenu->addItem("Info", infoContainer);
leftMenu->addItem("GSX", gsxContainer);
mainVLayout->addWidget(navigation, 0);
mainVLayout->addWidget(contentsStack, 1);
mainVLayout->addWidget(statusContainer, 0);
Wt::WGroupBox *groundBox = new Wt::WGroupBox("Ground Equipment");
groundBox->addStyleClass("fieldset-header");
groundBox->addWidget(btnGroundPower_);
groundBox->addWidget(btnGroundAir_);
groundContainer->addWidget(groundBox);
Wt::WGroupBox *doorBox = new Wt::WGroupBox("Aircraft Doors");
doorBox->addStyleClass("fieldset-header");
doorBox->addWidget(btnDoor1_);
doorBox->addWidget(btnDoor2_);
doorBox->addWidget(btnDoor3_);
groundContainer->addWidget(doorBox);
Wt::WGroupBox *pushBox = new Wt::WGroupBox("Default Pushback");
pushBox->addStyleClass("fieldset-header");
//.........这里部分代码省略.........
示例14: switch
Wt::WContainerWidget*
Application::instantiateMainTabs() {
Wt::WContainerWidget *mainTabContainer = new Wt::WContainerWidget;
Wt::WVBoxLayout *vbox = new Wt::WVBoxLayout;
mainTabContainer->setLayout(vbox);
wMainTabs_ = new Wt::WTabWidget;
wMainTabs_->currentChanged().connect(boost::bind(&Application::changeTab2, this, _1));
vbox->addWidget(wMainTabs_, 1 /*stretch*/);
for (size_t i=0; i<NMainTabs; ++i) {
Wt::WString tabName;
Wt::WContainerWidget *tabContent = NULL;
switch ((MainTab)i) {
case PartitionerTab: {
tabName = "Partitioner";
tabContent = wPartitioner_ = new WPartitioner(ctx_);
wPartitioner_->specimenParsed().connect(boost::bind(&Application::handleSpecimenParsed, this, _1));
wPartitioner_->specimenLoaded().connect(boost::bind(&Application::handleSpecimenLoaded, this, _1));
wPartitioner_->specimenPartitioned().connect(boost::bind(&Application::handleSpecimenPartitioned, this, _1));
break;
}
case MemoryMapTab: {
tabName = "Memory Map";
tabContent = wMemoryMap_ = new WMemoryMap;
wMemoryMap_->mapChanged().connect(boost::bind(&Application::memoryMapChanged, this));
wMemoryMap_->allowDownloads(ctx_.settings.allowDownloads);
break;
}
case FunctionListTab: {
tabName = "Functions";
tabContent = wFunctionList_ = new WFunctionList(ctx_);
wFunctionList_->functionChanged().connect(boost::bind(&Application::changeFunction, this, _1));
wFunctionList_->functionRowDoubleClicked()
.connect(boost::bind(&Application::changeFunctionDoubleClick, this, _1));
break;
}
case FunctionSummaryTab: {
tabName = "Summary";
tabContent = wFunctionSummary_ = new WFunctionSummary(ctx_);
break;
}
case FunctionCfgTab: {
tabName = "CFG";
tabContent = wFunctionCfg_ = new WFunctionCfg(ctx_);
wFunctionCfg_->functionChanged().connect(boost::bind(&Application::changeFunction, this, _1));
wFunctionCfg_->functionClicked().connect(boost::bind(&Application::changeFunction, this, _1));
wFunctionCfg_->addressClicked().connect(boost::bind(&Application::showHexDumpAtAddress, this, _1));
wFunctionCfg_->basicBlockClicked().connect(boost::bind(&Application::changeBasicBlock, this, _1));
break;
}
case AssemblyTab: {
tabName = "Assembly";
tabContent = wAssembly_ = new WAssemblyListing(ctx_);
break;
}
case HexDumpTab: {
tabName = "Hexdump";
tabContent = wHexDump_ = new WHexDump;
wHexDump_->byteClicked().connect(boost::bind(&Application::updateAddressCrossReferences, this, _1));
break;
}
case MagicTab: {
tabName = "Magic";
tabContent = wMagic_ = new WMagic;
break;
}
case StringsTab: {
tabName = "Strings";
tabContent = wStrings_ = new WStrings;
wStrings_->stringClicked().connect(boost::bind(&Application::updateStringCrossReferences, this, _1));
break;
}
case StatusTab: {
tabName = "Status";
tabContent = wStatus_ = new WStatus(ctx_);
break;
}
default:
ASSERT_not_reachable("invalid main tab");
}
ASSERT_not_null(tabContent);
ASSERT_forbid(tabName.empty());
wMainTabs_->addTab(tabContent, tabName);
}
return mainTabContainer;
}
示例15: WCompositeWidget
RSWappSearchFilesPage::RSWappSearchFilesPage(Wt::WContainerWidget *parent,RsFiles *mfiles)
: WCompositeWidget(parent),mFiles(mfiles)
{
setImplementation(_impl = new Wt::WContainerWidget()) ;
//_treeView = new Wt::WTreeView(_impl);
_tableView = new Wt::WTableView(_impl);
Wt::WVBoxLayout *layout = new Wt::WVBoxLayout() ;
_impl->setLayout(layout) ;
search_box = new Wt::WLineEdit(_impl) ;
search_box->setText("mp3") ;
search_box->enterPressed().connect(this,&RSWappSearchFilesPage::searchClicked) ;
//search_box->setHeight(50) ;
localcb = new Wt::WCheckBox(Wt::WString("Search Local"),_impl) ;
remotecb = new Wt::WCheckBox(Wt::WString("Search Remote"),_impl) ;
distantcb = new Wt::WCheckBox(Wt::WString("Search Distant"),_impl) ;
localcb->setChecked(false);
remotecb->setChecked(true);
distantcb->setChecked(true);
Wt::WPushButton *btn = new Wt::WPushButton("Search!") ;
btn->clicked().connect(this,&RSWappSearchFilesPage::searchClicked) ;
Wt::WContainerWidget *hSearchBox = new Wt::WContainerWidget();
Wt::WHBoxLayout *hSearchLayout = new Wt::WHBoxLayout ;
hSearchBox->setLayout(hSearchLayout);
hSearchLayout->addWidget(search_box) ;
hSearchLayout->addWidget(localcb);
hSearchLayout->addWidget(distantcb);
hSearchLayout->addWidget(remotecb);
hSearchLayout->addWidget(btn) ;
layout->addWidget(hSearchBox) ;
search_box->setWidth(1000);
_tableView->setAlternatingRowColors(true);
_tableView->setSelectionMode(Wt::ExtendedSelection);
_tableView->setDragEnabled(true);
_tableView->setColumnWidth(0, 250);
_tableView->setColumnWidth(1, 150);
_tableView->setColumnWidth(2, 250);
_tableView->setColumnWidth(3, 150);
_tableView->setColumnWidth(4, 150);
_tableView->setColumnWidth(5, 100);
_shared_files_model = new LocalSearchFilesModel(mfiles) ;
_tableView->setModel(_shared_files_model) ;
_tableView->doubleClicked().connect(this,&RSWappSearchFilesPage::tableClicked) ;
layout->addWidget(_tableView,1) ;
_tableView->setHeight(300) ;
Wt::WPushButton *dlbtn = new Wt::WPushButton("Download selected") ;
dlbtn->clicked().connect(this,&RSWappSearchFilesPage::searchClicked) ;
layout->addWidget(dlbtn) ;
_timer = new Wt::WTimer(this) ;
_timer->setInterval(5000) ;
_timer->timeout().connect(this,&RSWappSearchFilesPage::refresh) ;
_timer->start() ;
}