本文整理汇总了C++中WVBoxLayout类的典型用法代码示例。如果您正苦于以下问题:C++ WVBoxLayout类的具体用法?C++ WVBoxLayout怎么用?C++ WVBoxLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WVBoxLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AbstractUi
WebUi::WebUi(WApplication *app) :
AbstractUi(),
m_app(app)
{
app->setTitle("Quassel web interface");
WVBoxLayout *layout = new WVBoxLayout;
app->root()->setLayout(layout);
/*m_loginButton = new WPushButton("Connect");
m_loginButton->clicked().connect(this, &WebUi::connect);
layout->addWidget(m_loginButton);*/
_chatView = new WTableView(app->root());
layout->addWidget(_chatView);
_inputWidget = new WLineEdit(app->root());
layout->addWidget(_inputWidget);
QObject::connect(Client::coreConnection(), SIGNAL(userAuthenticationRequired(CoreAccount*,bool*,QString)), SLOT(userAuthenticationRequired(CoreAccount*,bool*,QString)));
QObject::connect(Client::coreConnection(), SIGNAL(connectionMsg(QString)), SLOT(printMsg(QString)));
QObject::connect(Client::coreConnection(), SIGNAL(progressTextChanged(QString)), SLOT(printMsg(QString)));
QObject::connect(Client::coreConnection(), SIGNAL(connectionError(QString)), SLOT(printMsg(QString)));
QObject::connect(Client::coreConnection(), SIGNAL(connectionErrorPopup(QString)), SLOT(printMsg(QString)));
//QObject::connect(Client::coreConnection(), SIGNAL(userAuthenticationRequired(CoreAccount*,bool*,QString)), SLOT(userAuthenticationRequired(CoreAccount*,bool*,QString)));
//Client::coreAccountModel()->load();
//if (!Client::coreConnection()->connectToCore()) {
bool ok;
userAuthenticationRequired(0, &ok, "");
//}
}
示例2: createUI
/*! \brief Setup the user interface.
*/
void createUI() {
WContainerWidget *w = root();
w->setStyleClass("maindiv");
/*
* The main layout is a 3x2 grid layout.
*/
WGridLayout *layout = new WGridLayout();
layout->addWidget(createTitle("Folders"), 0, 0);
layout->addWidget(createTitle("Files"), 0, 1);
layout->addWidget(folderView(), 1, 0);
layout->setColumnResizable(0);
// select the first folder
folderView_->select(folderModel_->index(0, 0, folderModel_->index(0, 0)));
WVBoxLayout *vbox = new WVBoxLayout();
vbox->addWidget(fileView(), 1);
vbox->addWidget(pieChart(), 1);
vbox->setResizable(0);
layout->addLayout(vbox, 1, 1);
layout->addWidget(aboutDisplay(), 2, 0, 1, 2);
/*
* Let row 1 and column 1 take the excess space.
*/
layout->setRowStretch(1, 1);
layout->setColumnStretch(1, 1);
w->setLayout(layout);
}
示例3: WContainerWidget
///
// Constructor
//
ResultsTable::ResultsTable(WContainerWidget *parent) :
WContainerWidget(parent),
mSortFilterProxyModel(NULL)
{
setStyleClass("tabdiv");
mModel = new WStandardItemModel(this);
mModel->insertColumns(0, 11);
mModel->setHeaderData(0, boost::any(WString::fromUTF8("Date")));
mModel->setHeaderData(1, boost::any(WString::fromUTF8("User")));
mModel->setHeaderData(2, boost::any(WString::fromUTF8("MRID")));
mModel->setHeaderData(3, boost::any(WString::fromUTF8("Name")));
mModel->setHeaderData(4, boost::any(WString::fromUTF8("Scan Name")));
mModel->setHeaderData(5, boost::any(WString::fromUTF8("Birthday")));
mModel->setHeaderData(6, boost::any(WString::fromUTF8("Scan Date")));
mModel->setHeaderData(7, boost::any(WString::fromUTF8("Manufacturer")));
mModel->setHeaderData(8, boost::any(WString::fromUTF8("Model")));
mModel->setHeaderData(9, boost::any(WString::fromUTF8("Software Ver")));
mModel->setHeaderData(10, boost::any(WString::fromUTF8("Pipeline")));
mModel->invisibleRootItem()->setRowCount(0);
mTreeView = new WTreeView();
mTreeView->setRootIsDecorated(false);
mTreeView->setAlternatingRowColors(true);
mTreeView->setSelectionMode(SingleSelection);
mTreeView->doubleClicked().connect(SLOT(this, ResultsTable::jobSelected));
mTreeView->clicked().connect(SLOT(this, ResultsTable::jobClicked));
WVBoxLayout *layout = new WVBoxLayout();
layout->addWidget(mTreeView);
setLayout(layout);
resetAll();
}
示例4: sysPath
void WsContent::doEditPage(std::string path)
{
std::string newPath = path;
boost::algorithm::replace_first(newPath, "/Edit", "");
boost::algorithm::replace_first(newPath, "/SiteMap", "");
std::string sPathWithoutPrefix = WsApp->WsModules().pathWithoutPrefix(newPath); // ex. /SiteMap
std::string sysPath(m_sDocumentRoot + sPathWithoutPrefix);
WsUser* pUser = WsApp->wsUser();
NodePtr pNode = pUser->getAccessRoot()->eatPath(sPathWithoutPrefix);
if (!pNode.get() ) {
addWidget(new WsErrorPage(WsErrorPage::Error, path, pUser, "Returned node is null"));
return;
}
clear();
setOverflow(WContainerWidget::OverflowAuto);
WVBoxLayout* vbox = new WVBoxLayout();
setLayout(vbox);
WsFormConfig* m_formConfig = new WsFormConfig(pNode, WsApp->WsModules());
vbox->addWidget(m_formConfig, 0);
vbox->addWidget(WsApp->WsModules().module("WsModEditorUploader")->createContents());
std::string strExt(boost::filesystem::extension(sPathWithoutPrefix));
if ( strExt == ".fhtml" ) {
if ( !gdcore_isPathFile(sysPath) ) return;
gdFHtmlEditor* pEditor = new gdFHtmlEditor("", false);
pEditor->setCurrentPath(sysPath);
pEditor->readFile();
m_formConfig->setEditorFhtml(pEditor);
pEditor->resize(WLength(100, WLength::Percentage), WLength(400));
vbox->addWidget(pEditor, 1);
}
}
示例5: disconnect
void SimpleChatWidget::letLogin()
{
disconnect();
clear();
WVBoxLayout *vLayout = new WVBoxLayout();
setLayout(vLayout, AlignLeft | AlignTop);
WHBoxLayout *hLayout = new WHBoxLayout();
vLayout->addLayout(hLayout);
hLayout->addWidget(new WLabel("User name:"), 0, AlignMiddle);
hLayout->addWidget(userNameEdit_ = new WLineEdit(user_), 0, AlignMiddle);
userNameEdit_->setFocus();
WPushButton *b = new WPushButton("Login");
hLayout->addWidget(b, 0, AlignMiddle);
b->clicked().connect(this, &SimpleChatWidget::login);
userNameEdit_->enterPressed().connect(this, &SimpleChatWidget::login);
vLayout->addWidget(statusMsg_ = new WText());
statusMsg_->setTextFormat(PlainText);
}
示例6: WVBoxLayout
void SimpleChatWidget::createLayout(WWidget *messages, WWidget *userList,
WWidget *messageEdit,
WWidget *sendButton, WWidget *logoutButton)
{
/*
* Create a vertical layout, which will hold 3 rows,
* organized like this:
*
* WVBoxLayout
* --------------------------------------------
* | nested WHBoxLayout (vertical stretch=1) |
* | | |
* | messages | userList |
* | (horizontal stretch=1) | |
* | | |
* --------------------------------------------
* | message edit area |
* --------------------------------------------
* | WHBoxLayout |
* | send | logout |
* --------------------------------------------
*/
WVBoxLayout *vLayout = new WVBoxLayout();
// Create a horizontal layout for the messages | userslist.
WHBoxLayout *hLayout = new WHBoxLayout();
// Add widget to horizontal layout with stretch = 1
hLayout->addWidget(messages, 1);
messages->setStyleClass("chat-msgs");
// Add another widget to horizontal layout with stretch = 0
hLayout->addWidget(userList);
userList->setStyleClass("chat-users");
hLayout->setResizable(0, true);
// Add nested layout to vertical layout with stretch = 1
vLayout->addLayout(hLayout, 1);
// Add widget to vertical layout with stretch = 0
vLayout->addWidget(messageEdit);
messageEdit->setStyleClass("chat-noedit");
// Create a horizontal layout for the buttons.
hLayout = new WHBoxLayout();
// Add button to horizontal layout with stretch = 0
hLayout->addWidget(sendButton);
// Add button to horizontal layout with stretch = 0
hLayout->addWidget(logoutButton);
// Add nested layout to vertical layout with stretch = 0
vLayout->addLayout(hLayout, 0, AlignLeft);
setLayout(vLayout);
}
示例7: WContainerWidget
void Example::search_presenting(WContainerWidget* cw,
const MapViewer::GeoNodes& nodes) {
WContainerWidget* cw_n = new WContainerWidget();
WVBoxLayout* vl = new WVBoxLayout();
BOOST_FOREACH (MapViewer::GeoNode node, nodes) {
Coordinate& pos = node.first;
vl->addWidget(new WText(node.second + "<br />" +
str(boost::format("%.4f %.4f")
% pos.longitude() % pos.latitude())),
AlignTop);
}
示例8: clear
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);
}
示例9: makeToolbar
void gdContainerBar::init()
{
makeToolbar();
WVBoxLayout* vbox = new WVBoxLayout();
if ( !m_pPanel || !m_pPanel->titleBar() )
vbox->addWidget(m_pToolBar, 0);
// else
// m_pPanel->titleBarWidget()->addWidget(m_pToolBar);
vbox->addWidget(m_pView, 1);
resize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
setOverflow(WContainerWidget::OverflowHidden);
setLayout(vbox);
view()->model()->rowsInserted().connect(SLOT(this, gdContainerBar::doModelRowCountChanged));
view()->model()->rowsRemoved() .connect(SLOT(this, gdContainerBar::doModelRowCountChanged));
}
示例10: WContainerWidget
///
// Constructor
//
MonitorPage::MonitorPage(const MRIBrowser *mriBrowser,
WContainerWidget *parent) :
WContainerWidget(parent),
mMRIBrowser(mriBrowser)
{
setStyleClass("tabdiv");
WGridLayout *layout = new WGridLayout();
layout->addWidget(createTitle("Cluster Jobs"), 0, 0);
WTabWidget *tabWidget = new WTabWidget();
tabWidget->setStyleClass("toptabdiv");
mMonitorLogTab = new MonitorLogTab(mriBrowser);
mMonitorResultsTab = new MonitorResultsTab(mriBrowser);
tabWidget->addTab(mMonitorResultsTab, "Results");
tabWidget->addTab(mMonitorLogTab, "Logs");
layout->addWidget(tabWidget, 1, 1);
WVBoxLayout *clusterJobsLayout = new WVBoxLayout();
mClusterJobBrowser = new ClusterJobBrowser();
mPatientInfoBox = new PatientInfoBox();
mPatientInfoBox->setStyleClass("verysmallgroupdiv");
clusterJobsLayout->addWidget(mClusterJobBrowser);
clusterJobsLayout->addWidget(mPatientInfoBox);
layout->addLayout(clusterJobsLayout, 1, 0);
// Let row 1 and column 2 take the excess space.
layout->setRowStretch(1, 1);
layout->setColumnStretch(1, 1);
setLayout(layout);
// Make connections
mClusterJobBrowser->clusterJobSelected().connect(SLOT(this, MonitorPage::jobSelectedChanged));
// All items in the tabbed widget need to be resized to 100% to
// fill the contents. This trick came from the Wt WTabWidget
// documentation and took me a good half a day to figure out.
mMonitorLogTab->resize(WLength(100, WLength::Percentage),
WLength(100, WLength::Percentage));
mMonitorResultsTab->resize(WLength(100, WLength::Percentage),
WLength(100, WLength::Percentage));
}
示例11: internalPathNextPart
void Home::setup()
{
/*
* This function switches between the two major components of the homepage,
* depending on the internal path:
* /src -> source viewer
* /... -> homepage
*
* FIXME: we should take into account language /cn/src ...
*/
std::string base = internalPathNextPart("/");
if (base == SRC_INTERNAL_PATH) {
if (!sourceViewer_) {
delete homePage_;
homePage_ = 0;
root()->clear();
sourceViewer_ = sourceViewer("/" + SRC_INTERNAL_PATH + "/");
WVBoxLayout *layout = new WVBoxLayout();
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(sourceViewer_);
root()->setLayout(layout);
}
} else {
if (!homePage_) {
delete sourceViewer_;
sourceViewer_ = 0;
root()->clear();
createHome();
root()->addWidget(homePage_);
setLanguageFromPath();
}
}
}
示例12: WContainerWidget
HydrovoltsConnectChartView::HydrovoltsConnectChartView(
HydrovoltsConnectModel* pModel,
WContainerWidget* parent):
WContainerWidget(parent),
m_y1(HydrovoltsConnectModel::COL_POWER),
m_y2(HydrovoltsConnectModel::COL_POWER, LineSeries, Y2Axis)
{
m_pModel = pModel;
resize(WLength::Auto, 600);
//resize(WLength::Auto, WLength::Auto);
setStyleClass("layoutdiv");
CreateChart();
HydrovoltsConnectChartToolbar* pToolbar = new HydrovoltsConnectChartToolbar( m_pModel, this);
pToolbar->y1Changed().connect(this, &HydrovoltsConnectChartView::OnY1Changed);
pToolbar->y2Changed().connect(this, &HydrovoltsConnectChartView::OnY2Changed);
WVBoxLayout *pLayout = new WVBoxLayout();
if (pLayout != NULL && m_pChart != NULL && pToolbar != NULL)
{
setWidth(WLength::Auto);
// Toolbar
pLayout->addWidget(pToolbar);
pLayout->setStretchFactor(pToolbar, 0);
// Chart
pLayout->addWidget(m_pChart);
pLayout->setStretchFactor(m_pChart,100);
//pLayout->setRowStretch();
//pLayout->setColumnStretch();
setLayoutSizeAware(true);
setLayout(pLayout);
}
}
示例13: getAccessRoot
void WsContent::viewDirectory(const std::string& path)
{
WsUser* pUser = WsApp->wsUser();
NodePtr pRootNode = pUser->getAccessRoot();
if ( !pRootNode ) {
wApp->log("notice") << "WsContent::viewDirectory() : Path = " << path << ", getAccessRoot() is null";
return;
}
NodePtr pNode = pRootNode.get()->eatPath(path);
if ( !pNode.get() ) {
wApp->log("notice") << "WsContent::viewDirectory() : Path = " << path << ", getAccessRoot() eatPath is null";
return;
}
std::string sInitPage = pNode.get()->getProperties().get()->get("global", "initial_page", "");
if ( sInitPage.size() > 0 ) {
std::string newPage = pNode.get()->getPath().string() + "/" + sInitPage;
wApp->log("notice") << "WsContent::viewDirectory() : set initial page to " << newPage;
return wApp->setInternalPath(newPage, true);
}
clear();
if ( !(pUser->isAdministrator() || pUser->isEditor()) )
if ( WsLayoutProperties::instance()->get("global", "use_content_directory_view", "false") == "false" ) return;
WsApp->hideImages(false);
WWidget* w = WsApp->WsModules().module("WsModDirectoryView2")->createContents();
WsOptions* wOpt = dynamic_cast<WsOptions*>(w);
wOpt->setOption("rootPath", path);
if ( 0 ) {
WVBoxLayout* vBox = new WVBoxLayout();
vBox->addWidget(w, 1);
setLayout(vBox);
setOverflow(WContainerWidget::OverflowHidden);
} else {
addWidget(w);
setOverflow(WContainerWidget::OverflowAuto);
}
}
示例14: BaseWidget
IdeaSubmit::IdeaSubmit(CgiRoot *cgi, Wt::WDialog *parentDialog, bool editMode, size_t editRowId) : BaseWidget(cgi),
m_dlgParent(parentDialog),
m_editMode(editMode),
m_editRowId(editRowId),
m_editCompletedHandler(this)
{
this->clear();
this->addWidget(Layout());
this->setOverflow(WContainerWidget::OverflowAuto);
Div *dvButtonWrappers = new Div();
Div *dvButtons = new Div(dvButtonWrappers, "dvDialogButtons");
WPushButton *submitButton;
if (!m_editMode)
submitButton = new WPushButton(m_lang->GetString("HOME_SUBMIT_IDEA_DLG_OK_BUTTON"), dvButtons);
else
submitButton = new WPushButton(m_lang->GetString("HOME_SUBMIT_IDEA_DLG_OK_EDIT_BUTTON"), dvButtons);
WPushButton *returnButton = new WPushButton(m_lang->GetString("HOME_SUBMIT_IDEA_DLG_RETURN_BUTTON"), dvButtons);
submitButton->setStyleClass("dialogButton");
returnButton->setStyleClass("dialogButton");
WVBoxLayout *layout = new WVBoxLayout();
layout->addWidget(this);
layout->setStretchFactor(this, 1);
layout->addWidget(dvButtonWrappers );
layout->setStretchFactor(dvButtonWrappers , 0);
m_dlgParent->contents()->setLayout(layout);
if (m_editMode) {
string title;
int typegamesentertainment;
int typehygienehealth;
int typenewsinfo;
int typelearning;
int typenonepresenceservices;
int typeonlineshopping;
int typeothers;
string typeotherstext;
string description;
int audienceteens;
int audienceparents;
int audienceboys;
int audiencegirls;
int audiencewomen;
int audiencemen;
int audiencechilds;
int audienceallfamilymembers;
string usage;
string similar;
string difference;
result r = m_db->Sql() << "SELECT title, "
"typegamesentertainment, typehygienehealth, typenewsinfo, typelearning, "
"typenonepresenceservices, typeonlineshopping, typeothers, typeotherstext, "
"description, "
"audienceteens, audienceparents, audienceboys, audiencegirls, audiencewomen, "
"audiencemen, audiencechilds, audienceallfamilymembers, "
"usage, similar, difference "
"FROM [" + m_dbTables->Table("IDEAS")
+ "] WHERE rowid=?;" << m_editRowId << row;
if (!r.empty()) {
r >> title >> typegamesentertainment >> typehygienehealth
>> typenewsinfo >> typelearning >> typenonepresenceservices >> typeonlineshopping
>> typeothers >> typeotherstext >> description >> audienceteens >> audienceparents >> audienceboys
>> audiencegirls >> audiencewomen >> audiencemen >> audiencechilds >> audienceallfamilymembers
>> usage >> similar >> difference;
title = Crypto::Decrypt(title);
typeotherstext = Crypto::Decrypt(typeotherstext);
description = Crypto::Decrypt(description);
usage = Crypto::Decrypt(usage);
similar = Crypto::Decrypt(similar);
difference = Crypto::Decrypt(difference);
m_typeGamesEntertainmentCheckBox->setChecked(typegamesentertainment);
m_typeHygieneHealthCheckBox->setChecked(typehygienehealth);
m_typeNewsInfoCheckBox->setChecked(typenewsinfo);
m_typeLearningCheckBox->setChecked(typelearning);
m_typeNonePresenceServicesCheckBox->setChecked(typenonepresenceservices);
m_typeOnlineShoppingCheckBox->setChecked(typeonlineshopping);
m_typeOthersCheckBox->setChecked(typeothers);
if (typeothers)
m_typeOthersTextLineEdit->setText(WString::fromUTF8(typeotherstext));
m_titleLineEdit->setText(WString::fromUTF8(title));
m_descriptionTextArea->setText(WString::fromUTF8(description));
m_audienceTeensCheckBox->setChecked(audienceteens);
m_audienceParentsCheckBox->setChecked(audienceparents);
m_audienceBoysCheckBox->setChecked(audienceboys);
m_audienceGirlsCheckBox->setChecked(audiencegirls);
m_audienceWomenCheckBox->setChecked(audiencewomen);
m_audienceMenCheckBox->setChecked(audiencemen);
m_audienceChildsCheckBox->setChecked(audiencechilds);
m_audienceAllFamilyMembersCheckBox->setChecked(audienceallfamilymembers);
m_usageTextArea->setText(WString::fromUTF8(usage));
//.........这里部分代码省略.........
示例15: WContainerWidget
DetailManipulation::DetailManipulation(bool enhance, WContainerWidget *parent)
: WContainerWidget(parent), onlySmooth(!enhance)
{
resize(WLength::Auto, WLength::Auto);
// Image bar
prepareInputImages();
WContainerWidget *imageBar = new WContainerWidget;
WVBoxLayout *imageBarLayout = new WVBoxLayout();
for (size_t i = 0; i < inputImages.size(); ++i) {
WImage *img = inputImages[i]->getOriginalImage();
img->setStyleClass("image_button");
img->resize(160, 120);
img->setAttributeValue("onMouseOver", "this.width=192; this.height=144;");
img->setAttributeValue("onMouseOut", "this.width=160; this.height=120;");
img->clicked().connect(
boost::bind(&DetailManipulation::selectImage,
this,
i
)
);
imageBarLayout->addWidget(img);
}
imageBar->resize(200, WLength::Auto);
imageBar->setLayout(imageBarLayout);
selectedImageId = 0;
// Main component
imageTab = new WTabWidget();
imageTab->addTab(inputImages[selectedImageId]->getOriginalImage(), "Original");
if (onlySmooth) {
imageTab->addTab(new WImage(smoothedResult[selectedImageId].second), smoothedResult[selectedImageId].first);
}
else {
imageTab->addTab(new WImage(enhancedResult[selectedImageId].second), enhancedResult[selectedImageId].first);
}
imageTab->resize(600, WLength::Auto);
WGridLayout *controllerLayout = new WGridLayout();
WSlider *rSlider = new WSlider(Wt::Vertical);
rSlider->setRange(SLIDER_MINIMUM, SLIDER_MAXIMUM);
rSlider->setTickPosition(Wt::WSlider::TicksBothSides);
WDoubleSpinBox *rSpinBox = new WDoubleSpinBox();
rSpinBox->setMinimum(R_MINIMUM);
rSpinBox->setMaximum(R_MAXIMUM);
rSlider->sliderMoved().connect(
boost::bind(&DetailManipulation::changeDoubleSpinBoxValue,
this,
rSpinBox,
true,
_1)
);
rSpinBox->valueChanged().connect(
boost::bind(&DetailManipulation::changeSliderValue,
this,
rSlider,
1.f/(R_MAXIMUM-R_MINIMUM),
_1)
);
controllerLayout->addWidget(rSlider, 2, 0, 6, 1);
controllerLayout->addWidget(rSpinBox, 9, 0);
controllerLayout->addWidget(new WText("radius"), 10, 0);
WSlider *epsSlider = new WSlider(Wt::Vertical);
epsSlider->setMinimum(SLIDER_MINIMUM);
epsSlider->setMaximum(SLIDER_MAXIMUM);
epsSlider->setRange(SLIDER_MINIMUM, SLIDER_MAXIMUM);
epsSlider->setTickPosition(WSlider::TicksBothSides);
WDoubleSpinBox *epsSpinBox = new WDoubleSpinBox();
epsSpinBox->setMinimum(EPS_MINIMUM);
epsSpinBox->setMaximum(EPS_MAXIMUM);
epsSlider->sliderMoved().connect(
boost::bind(&DetailManipulation::changeDoubleSpinBoxValue,
this,
epsSpinBox,
false,
_1)
);
epsSpinBox->valueChanged().connect(
boost::bind(&DetailManipulation::changeSliderValue,
this,
epsSlider,
1.f/(EPS_MAXIMUM-EPS_MINIMUM),
_1)
);
controllerLayout->addWidget(epsSlider, 2, 1, 6, 1);
controllerLayout->addWidget(epsSpinBox, 9, 1);
controllerLayout->addWidget(new WText("epsilon"), 10, 1);
WPushButton *apply = new WPushButton("Apply");
apply->clicked().connect(
boost::bind(&DetailManipulation::applyEnhancement,
this,
rSpinBox,
epsSpinBox
)
);
//.........这里部分代码省略.........