本文整理汇总了C++中WLabel类的典型用法代码示例。如果您正苦于以下问题:C++ WLabel类的具体用法?C++ WLabel怎么用?C++ WLabel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WLabel类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: addWidget
WContainerWidget *WForm::addControl(WWidget *w, const string &labelKey, bool isFormControl) {
string controlSize = (boost::format("col-sm-%d") % (12-d->labelColumns)).str();
string labelSize = (boost::format("col-sm-%d") % (d->labelColumns)).str();
string controlOffset = (boost::format("col-sm-offset-%d") % (d->labelColumns)).str();
if(d->type == Inline) {
controlSize = "";
labelSize = "";
controlOffset = "";
}
WContainerWidget *container = WW<WContainerWidget>().addCss("form-group");
if(isFormControl)
w->addStyleClass("form-control");
if(!labelKey.empty()) {
WLabel *label = WW<WLabel>(WString::tr(labelKey), container).addCss("control-label").addCss(labelSize);
if(dynamic_cast<WFormWidget*>(w))
label->setBuddy(dynamic_cast<WFormWidget*>(w));
}
if(d->type == Inline)
container->addWidget(w);
else
container->addWidget(WW<WContainerWidget>().addCss(controlSize).addCss(labelKey.empty() ? controlOffset : "").add(w));
addWidget(container);
return container;
}
开发者ID:GuLinux,项目名称:GuLinux-Commons,代码行数:25,代码来源:wform.cpp
示例2: WContainerWidget
WWidget *FormWidgets::wPopupMenu()
{
WContainerWidget *result = new WContainerWidget();
topic("WPopupMenu", "WPopupMenuItem", result);
addText(tr("formwidgets-WPopupMenu"), result);
WPopupMenu *popup = new WPopupMenu();
popup->setAutoHide(true, 1000);
popup->addItem("icons/house.png", "Build a house");
popup->addItem("Roof included")->setCheckable(true);
popup->addItem("Add a door")->setDisabled(true);
popup->addSeparator();
popup->addItem("Add a window");
WPopupMenu *subMenu = new WPopupMenu();
subMenu->addItem("Add a chair");
subMenu->addItem("Add a table");
popup->addMenu("Add furniture", subMenu);
popup->aboutToHide().connect(boost::bind(&FormWidgets::popupAction,
this, popup));
WLabel* clickMe = new WLabel("Clicking here will show a popup menu.",
result);
clickMe->setStyleClass("popupmenuLabel");
clickMe->clicked().connect(popup, &WPopupMenu::popup);
return result;
}
开发者ID:StevenFarley,项目名称:wt,代码行数:29,代码来源:FormWidgets.C
示例3: WFormWidget
WAbstractToggleButton::WAbstractToggleButton(WContainerWidget *parent)
: WFormWidget(parent),
checked_(false),
checkedChanged_(false)
{
WLabel *label = new WLabel(parent);
label->setBuddy(this);
}
开发者ID:SiteView,项目名称:ecc82Server,代码行数:8,代码来源:WAbstractToggleButton.Cpp
示例4: WContainerWidget
void Reports::createUi()
{
WContainerWidget *dateSelectForm = new WContainerWidget(this);
dateSelectForm ->setStyleClass("form-inline");
dateSelectForm ->setId("dateselectform");
WLabel *label;
label = new WLabel(tr("reports.begindate"), dateSelectForm );
m_pBeginDateEdit = new WDateEdit(dateSelectForm );
//label->setBuddy(m_pBeginDateEdit->lineEdit());
label->setBuddy(m_pBeginDateEdit);
//m_pBeginDateEdit->setBottom(WDate(WDate::currentDate().year(), WDate::currentDate().month(), 1));
m_pBeginDateEdit->setFormat("dd.MM.yyyy");
m_pBeginDateEdit->setDate(WDate(WDate::currentDate().year(), WDate::currentDate().month(), 1));
m_pBeginDateEdit->setTop(WDate::currentDate());
//m_pBeginDateEdit->lineEdit()->validator()->setMandatory(true);
m_pBeginDateEdit->validator()->setMandatory(true);
m_pBeginDateEdit->setStyleClass("input-medium");
//m_pBeginDateEdit->setWidth(120);
label = new WLabel(tr("reports.enddate"), dateSelectForm );
m_pEndDateEdit = new WDateEdit(dateSelectForm );
//label->setBuddy(m_pEndDateEdit->lineEdit());
label->setBuddy(m_pEndDateEdit);
//m_pEndDateEdit->setBottom(WDate::currentDate());
m_pEndDateEdit->setFormat("dd.MM.yyyy");
m_pEndDateEdit->setDate(WDate::currentDate());
m_pEndDateEdit->setTop(WDate::currentDate());
//m_pEndDateEdit->lineEdit()->validator()->setMandatory(true);
m_pEndDateEdit->validator()->setMandatory(true);
m_pEndDateEdit->setStyleClass("input-medium");
/*
WContainerWidget *corner_kick = new WContainerWidget(dateSelectForm );
corner_kick->setStyleClass("corner_kick get_filter");
WTemplate *button = new WTemplate("<ins class=\"i1\"></ins><ins class=\"i2\"></ins><ins class=\"i3\"></ins><ins class=\"i4\"></ins>${anchor}",corner_kick);
LineEdit *submitBtn = new LineEdit(0,LineEdit::Submit);
submitBtn->setValueText(tr("reports.filtered"));
submitBtn->clicked().connect(boost::bind(&Reports::changed, this, submitBtn));
button->bindWidget("anchor",submitBtn);
*/
//WTemplate *button = new WTemplate("<ins class=\"i1\"></ins><ins class=\"i2\"></ins><ins class=\"i3\"></ins><ins class=\"i4\"></ins>${anchor}",dateSelectForm);
WPushButton *anchor = new WPushButton(tr("reports.filtered"),dateSelectForm);
anchor->clicked().connect(boost::bind(&Reports::changed, this, dateSelectForm));
//button->bindWidget("anchor",anchor);
//button->setStyleClass("corner_kick get_filter");
//(new WLabel(tr("reports.filtered"), corner_kick))->setBuddy(new LineEdit(corner_kick,LineEdit::Submit));
}
开发者ID:ineron,项目名称:fit-zakaz-portal,代码行数:57,代码来源:Reports.cpp
示例5: setLabel
void WFormWidget::setLabel(WLabel *label)
{
if (label_) {
WLabel *l = label_;
label_ = 0;
l->setBuddy((WFormWidget *)0);
}
label_ = label;
if (label_)
label_->setHidden(isHidden());
}
开发者ID:bvanhauwaert,项目名称:wt,代码行数:12,代码来源:WFormWidget.C
示例6: wtr
void SettingsPage::addSetting(const string& settingName, WFormWidget* widget)
{
WString label = wtr(settingName + ".label");
WString helpText = wtr(settingName + ".description");
WLabel *labelWidget = WW<WLabel>(label).css("control-label");
labelWidget->setBuddy(widget);
WContainerWidget *control = WW<WContainerWidget>().css("controls").add(widget);
if(!helpText.empty()) {
control->addWidget(WW<WText>(helpText).css("help-block") );
}
addWidget(WW<WContainerWidget>().css("control-group")
.add(labelWidget)
.add( control ));
}
开发者ID:GuLinux,项目名称:Pandorica,代码行数:15,代码来源:settingspage.cpp
示例7: WContainerWidget
Login::Login(WContainerWidget* parent) : WContainerWidget(parent), loggedIn_(this)
{
setStyleClass("login");
WLabel* userNameL = new WLabel(tr("login.userName"), this);
userNameEdit_ = new WLineEdit(this);
userNameEdit_->setFocus();
userNameL->setBuddy(userNameEdit_);
loginButton_ = new WPushButton(tr("login.loginButton"), this);
loginButton_->setEnabled(false);
userNameEdit_->textInput().connect(std::bind([=] () {
if(userNameEdit_->text() == "")
loginButton_->setEnabled(false);
else
loginButton_->setEnabled(true);
}));
loginButton_->clicked().connect(this, &Login::login);
}
开发者ID:mickythump,项目名称:todo-app,代码行数:19,代码来源:Login.C
示例8: WTable
VanetNodeForm::VanetNodeForm()
{
WTable* t = new WTable(this);
int row = 0;
WLabel* l = new WLabel(tr("vanet.property.form.node.id"), t->elementAt(row, 0));
id_ = new WLineEdit(t->elementAt(row, 1));
WLengthValidator* lv = new WLengthValidator(1, 15);
id_->setValidator(lv);
l->setBuddy(id_);
++row;
t->elementAt(row, 0)->setColumnSpan(2);
l = new WLabel(tr("vanet.property.form.nodes.mobility"), t->elementAt(row, 0));
++row;
t->elementAt(row, 0)->setColumnSpan(2);
form_ = new VanetMobilityModelForm;
t->elementAt(row, 0)->addWidget(form_);
}
开发者ID:flaviu-toader,项目名称:vanetizer-c--,代码行数:20,代码来源:vanetnodeform.cpp
示例9: WContainerWidget
LoginWidget::LoginWidget(WContainerWidget *parent)
: WContainerWidget(parent)
{
this->setId("login_widget");
this->setStyleClass("login_widget_style");
WText *intro = new WText("Hello! Please, login into Geo2tag "
"or view marks from public channels",
this);
intro->setId("intro");
// WBreak *break1 = new WBreak(this);
WLabel *usernameLabel = new WLabel("Username:", this);
usernameEdit = new WLineEdit(this);
usernameLabel->setBuddy(usernameEdit);
WLabel *passwordLabel = new WLabel("Password:", this);
//m_loginQuery=new LoginQuery();
passwordEdit = new WLineEdit(this);
passwordEdit->setEchoMode(WLineEdit::Password);
passwordLabel->setBuddy(passwordEdit);
loginButton = new WPushButton("Login", this);
// WBreak *break2 = new WBreak(this);
map = new WGoogleMap(this);
map->setMinimumSize(WLength(300), WLength(400));
map->setMaximumSize(WLength(500), WLength(400));
map->setCenter(Wt::WGoogleMap::Coordinate(60, 30));
map->enableScrollWheelZoom();
// WBreak *break3 = new WBreak(this);
// WOpenStreetMap *map2 = new WOpenStreetMap(this);
// map2->setMinimumSize(WLength(300), WLength(400));
// //map2->setMaximumSize(WLength(500), WLength(400));
//
// WBreak *break4 = new WBreak(this);
// WYandexMap *map3 = new WYandexMap(this);
// map3->setMinimumSize(WLength(300), WLength(400));
// loginButton->clicked().connect(this, &LoginWidget::loginClicked);
fillMap();
initCons();
// m_con=new Connector<LoginWidget>(&m_loginQuery,LoginQueryConnected,&LoginWidget::userRecieved,this);
this->setStyleClass("login_wigdet");
}
开发者ID:aygerim,项目名称:geo2tag,代码行数:41,代码来源:LoginWidget.cpp
示例10: WLabel
void LoginView::createLayout()
{
WLabel* userNameL = new WLabel(tr("login.userName"), contents());
userNameL->setMargin(10, Left | Right);
_user_name = new WLineEdit(contents());
_user_name->setValidator(new WLengthValidator(5, 20, contents()));
userNameL->setBuddy(_user_name);
_user_name->setFocus();
new WBreak(contents());
WLabel* passwdL = new WLabel(tr("login.userPasswd"), contents());
passwdL->setMargin(10, Left | Right);
_user_passwd = new WLineEdit(contents());
passwdL->setBuddy(_user_passwd);
_user_passwd->setValidator(new WLengthValidator(5, 20, contents()));
_user_passwd->setEchoMode(WLineEdit::Password);
_user_passwd->enterPressed().connect(this, &LoginView::loginCheck);
new WBreak(contents());
_login_button = new WPushButton(tr("login.loginButton"),
contents());
//_login_button->clicked().connect(_user_passwd->jsRef() + ".value = " + "hex_md5(" + _user_passwd->jsRef() + ");");
_login_button->clicked().connect(this, &LoginView::loginCheck2);
//_user_passwd->enterPressed().connect(_user_passwd->jsRef() + ".value = " + "hex_md5(" + _user_passwd->jsRef() + ");");
}
开发者ID:snyh,项目名称:WHMon,代码行数:28,代码来源:LoginView.cpp
示例11: WTable
VanetRoutingProtocolPropertyForm::VanetRoutingProtocolPropertyForm(WContainerWidget* parent)
{
WTable* mainTable = new WTable(this);
int row = 0;
WLabel* l = new WLabel(tr("vanet.property.form.routing.combo"), mainTable->elementAt(row, 0));
routingCombo_ = new WComboBox(mainTable->elementAt(row, 1));
routingCombo_->addItem(tr("vanet.property.form.routing.combo.aodv"));
routingCombo_->addItem(tr("vanet.property.form.routing.combo.bf"));
routingCombo_->addItem(tr("vanet.property.form.routing.combo.dsr"));
routingCombo_->addItem(tr("vanet.property.form.routing.combo.lar"));
routingCombo_->addItem(tr("vanet.property.form.routing.combo.wrp"));
l->setBuddy(routingCombo_);
routingCombo_->setCurrentIndex(0);
// ++row;
// l = new WLabel(tr("vanet.property.form.routing.nodescount"), mainTable->elementAt(row, 0));
// nodesCount_ = new WSpinBox(mainTable->elementAt(row, 1));
// nodesCount_->setMaximum(225);
// nodesCount_->setMinimum(2);
// nodesCount_->setValue(30);
// l->setBuddy(nodesCount_);
}
开发者ID:flaviu-toader,项目名称:vanetizer-c--,代码行数:23,代码来源:vanetroutingprotocolpropertyform.cpp
示例12: WTable
VanetAreaPropertyForm::VanetAreaPropertyForm(WContainerWidget* parent)
{
WTable *formTable = new WTable(this);
int row = 0;
WLabel *xLabel = new WLabel(formTable->elementAt(row, 0));
xLabel->setText(WString::fromUTF8(tr("mappropertyeditor.group.general.dimx").toUTF8()));
dimx_ = new WSpinBox(formTable->elementAt(row, 1));
dimx_->setMinimum(0);
dimx_->setMaximum(90000);
xLabel->setBuddy(dimx_);
++row;
WLabel *yLabel = new WLabel(formTable->elementAt(row, 0));
yLabel->setText(WString::fromUTF8(tr("mappropertyeditor.group.general.dimy").toUTF8()));
dimy_ = new WSpinBox(formTable->elementAt(row, 1));
dimy_->setMinimum(0);
dimy_->setMaximum(90000);
yLabel->setBuddy(dimy_);
}
开发者ID:flaviu-toader,项目名称:vanetizer-c--,代码行数:20,代码来源:vanetareapropertyform.cpp
示例13: clear
void IndexView::render() {
clear();
WTable *queryTable = new WTable(this);
WLabel *label;
int row = 0;
// Title
queryTable->elementAt(row, 0)->setColumnSpan(3);
queryTable->elementAt(row, 0)->setContentAlignment(AlignTop | AlignCenter);
queryTable->elementAt(row, 0)->setPadding(10);
WText *title = new WText(("Leaked Password Query Kit"), queryTable->elementAt(row, 0));
title->decorationStyle().font().setSize(WFont::XLarge);
// error messages
++row;
queryTable->elementAt(row, 0)->setColumnSpan(3);
feedbackMessages_ = queryTable->elementAt(row, 0);
feedbackMessages_->setPadding(5);
WCssDecorationStyle& errorStyle = feedbackMessages_->decorationStyle();
errorStyle.setForegroundColor(Wt::red);
errorStyle.font().setSize(WFont::Smaller);
errorStyle.font().setWeight(WFont::Bold);
errorStyle.font().setStyle(WFont::Italic);
// User
++row;
keywordEdit_ = new WLineEdit(queryTable->elementAt(row, 2));
label = new WLabel("Keyword:", queryTable->elementAt(row, 0));
label->setBuddy(keywordEdit_);
keywordEdit_->setValidator(new WValidator(true));
keywordEdit_->enterPressed().connect(this, &IndexView::query);
// Search Area
++row;
areaOption_ = new WSelectionBox(queryTable->elementAt(row, 2));
areaOption_->addItem("Username");
areaOption_->addItem("Password");
areaOption_->setCurrentIndex(0);
label = new WLabel("Keyword Type:", queryTable->elementAt(row,0));
label->setBuddy(areaOption_);
// DB to Search
++row;
dbOption_ = new WSelectionBox(queryTable->elementAt(row, 2));
dbOption_->addItem("CSDN (6M)");
dbOption_->addItem("RenRen (5M)");
dbOption_->addItem("178 (10M)");
dbOption_->addItem("7k7k (20M)");
dbOption_->addItem("duduniu (10M)");
dbOption_->addItem("duowan (10M)");
dbOption_->addItem("MOP (10M)");
dbOption_->addItem("Tianya (40M)");
dbOption_->setCurrentIndex(0);
label = new WLabel("Database:", queryTable->elementAt(row,0));
label->setBuddy(dbOption_);
// Search Method
++row;
methodOption_ = new WSelectionBox(queryTable->elementAt(row, 2));
methodOption_->addItem("Header Match");
methodOption_->addItem("Full-Text (1 Quota Per Minute Per IP)");
methodOption_->setCurrentIndex(0);
label = new WLabel("Search Method:", queryTable->elementAt(row,0));
label->setBuddy(methodOption_);
// Query
++row;
WPushButton *query = new WPushButton("Query",
queryTable->elementAt(row, 0));
query->clicked().connect(this, &IndexView::query);
query->setMargin(15, Top);
queryTable->elementAt(row, 0)->setColumnSpan(3);
queryTable->elementAt(row, 0)->setContentAlignment(AlignTop | AlignCenter);
// Set column widths for label and validation icon
queryTable->elementAt(2, 0)->resize(WLength(30, WLength::FontEx), WLength::Auto);
queryTable->elementAt(2, 1)->resize(20, WLength::Auto);
// Result
result_ = new WTable(this);
result_->clear();
}
开发者ID:techpub,项目名称:archive-code,代码行数:84,代码来源:IndexView.cpp
示例14: FileEditDialog
FileEditDialog(WAbstractItemModel *model, const WModelIndex& item)
: WDialog("Edit..."),
model_(model),
item_(item)
{
int modelRow = item_.row();
resize(300, WLength::Auto);
/*
* Create the form widgets, and load them with data from the model.
*/
// name
nameEdit_ = new WLineEdit(asString(model_->data(modelRow, 1)));
// type
typeEdit_ = new WComboBox();
typeEdit_->addItem("Document");
typeEdit_->addItem("Spreadsheet");
typeEdit_->addItem("Presentation");
typeEdit_->setCurrentIndex
(typeEdit_->findText(asString(model_->data(modelRow, 2))));
// size
sizeEdit_ = new WLineEdit(asString(model_->data(modelRow, 3)));
sizeEdit_->setValidator
(new WIntValidator(0, std::numeric_limits<int>::max(), this));
// created
createdPicker_ = new WDatePicker();
createdPicker_->lineEdit()->validator()->setMandatory(true);
createdPicker_->setFormat(FileModel::dateEditFormat);
createdPicker_->setDate(boost::any_cast<WDate>(model_->data(modelRow, 4)));
// modified
modifiedPicker_ = new WDatePicker();
modifiedPicker_->lineEdit()->validator()->setMandatory(true);
modifiedPicker_->setFormat(FileModel::dateEditFormat);
modifiedPicker_->setDate(boost::any_cast<WDate>(model_->data(modelRow, 5)));
/*
* Use a grid layout for the labels and fields
*/
WGridLayout *layout = new WGridLayout();
WLabel *l;
int row = 0;
layout->addWidget(l = new WLabel("Name:"), row, 0);
layout->addWidget(nameEdit_, row, 1);
l->setBuddy(nameEdit_);
++row;
layout->addWidget(l = new WLabel("Type:"), row, 0);
layout->addWidget(typeEdit_, row, 1);
l->setBuddy(typeEdit_);
++row;
layout->addWidget(l = new WLabel("Size:"), row, 0);
layout->addWidget(sizeEdit_, row, 1);
l->setBuddy(sizeEdit_);
++row;
layout->addWidget(l = new WLabel("Created:"), row, 0);
layout->addWidget(createdPicker_->lineEdit(), row, 1);
layout->addWidget(createdPicker_, row, 2);
l->setBuddy(createdPicker_->lineEdit());
++row;
layout->addWidget(l = new WLabel("Modified:"), row, 0);
layout->addWidget(modifiedPicker_->lineEdit(), row, 1);
layout->addWidget(modifiedPicker_, row, 2);
l->setBuddy(modifiedPicker_->lineEdit());
++row;
WPushButton *b;
WContainerWidget *buttons = new WContainerWidget();
buttons->addWidget(b = new WPushButton("Save"));
b->clicked().connect(this, &WDialog::accept);
contents()->enterPressed().connect(this, &WDialog::accept);
buttons->addWidget(b = new WPushButton("Cancel"));
b->clicked().connect(this, &WDialog::reject);
/*
* Focus the form widget that corresonds to the selected item.
*/
switch (item.column()) {
case 2:
typeEdit_->setFocus(); break;
case 3:
sizeEdit_->setFocus(); break;
case 4:
createdPicker_->lineEdit()->setFocus(); break;
case 5:
modifiedPicker_->lineEdit()->setFocus(); break;
default:
nameEdit_->setFocus(); break;
}
//.........这里部分代码省略.........
开发者ID:USP,项目名称:wtcpp,代码行数:101,代码来源:TreeViewDragDrop.C
示例15: WContainerWidget
///
// Constructor
//
LoginPage::LoginPage(WContainerWidget *parent) :
WContainerWidget(parent),
mLoggedIn(false),
mLogoutRequested(false)
{
setStyleClass("maindiv");
WLabel* loginText = new WLabel("Enter username and password:");
mUserNameLineEdit = new WLineEdit("");
WText *userNameText = new WText("User Name:");
mPasswordLineEdit = new WLineEdit("");
mPasswordLineEdit->setEchoMode(WLineEdit::Password);
WText *passwordText = new WText("Password:");
WPushButton *loginButton = new WPushButton("Login");
WGridLayout *loginLayout = new WGridLayout();
loginLayout->addWidget(userNameText, 0, 0, AlignRight);
loginLayout->addWidget(mUserNameLineEdit, 0, 1, AlignLeft);
loginLayout->addWidget(passwordText, 1, 0, AlignRight);
loginLayout->addWidget(mPasswordLineEdit, 1, 1, AlignLeft);
WGridLayout *textLayout = new WGridLayout();
textLayout->addWidget(loginText, 0, 0, AlignCenter);
WGridLayout *buttonLayout = new WGridLayout();
buttonLayout->addWidget(loginButton, 0, 0, AlignCenter | AlignMiddle);
WImage *chbLogo = new WImage(tr("logo-image").toUTF8());
WGridLayout *chbLogoLayout = new WGridLayout();
chbLogoLayout->addWidget(chbLogo, 0, 0, AlignCenter);
WLabel *titleLabel = new WLabel(tr("page-top-text"));
titleLabel->setStyleClass("logintitlediv");
WGridLayout *titleLayout = new WGridLayout();
titleLayout->addWidget(titleLabel, 0, 0, AlignCenter);
WContainerWidget *loginContainer = new WContainerWidget();
loginContainer->setStyleClass("logindiv");
mFailureLabel = new WLabel("Invalid username and/or password. Try again.");
mFailureLabel->setStyleClass("redtext");
WVBoxLayout *layout = new WVBoxLayout();
layout->addLayout(chbLogoLayout, AlignCenter);
layout->addLayout(titleLayout, AlignCenter);
layout->addLayout(textLayout, AlignCenter);
layout->addLayout(loginLayout);
layout->addWidget(mFailureLabel);
layout->addLayout(buttonLayout, AlignCenter | AlignMiddle);
mFailureLabel->hide();
loginContainer->setLayout(layout, AlignTop);
WVBoxLayout *pageLayout = new WVBoxLayout();
pageLayout->addWidget(loginContainer);
pageLayout->addWidget(new WText(tr("login-page-text")));
setLayout(pageLayout, AlignMiddle | AlignCenter);
loginButton->clicked().connect(SLOT(this, LoginPage::login));
mPasswordLineEdit->enterPressed().connect(SLOT(this, LoginPage::login));
resetAll();
}
开发者ID:FNNDSC,项目名称:web,代码行数:72,代码来源:LoginPage.cpp
示例16: WTable
VanetMobilityModelForm::VanetMobilityModelForm(WContainerWidget* parent)
{
WTable* t = new WTable(this);
int row = 0;
WLabel* l = new WLabel(tr("vanet.property.form.mobility.combo"), t->elementAt(row, 0));
mobilityCombo_ = new WComboBox(t->elementAt(row, 1));
mobilityCombo_->addItem(tr("vanet.property.form.mobility.combo.im"));
mobilityCombo_->addItem(tr("vanet.property.form.mobility.combo.lc"));
mobilityCombo_->activated().connect(this, &VanetMobilityModelForm::mobilityChanged);
l->setBuddy(mobilityCombo_);
++row;
l = new WLabel(tr("vanet.property.form.mobility.minspeed"), t->elementAt(row, 0));
minSpeed_ = new WDoubleSpinBox(t->elementAt(row, 1));
minSpeed_->setDecimals(1);
minSpeed_->setMaximum(100.0);
minSpeed_->setMinimum(0.0);
minSpeed_->setValue(0.0);
l->setBuddy(minSpeed_);
++row;
l = new WLabel(tr("vanet.property.form.mobility.maxspeed"), t->elementAt(row, 0));
maxSpeed_ = new WDoubleSpinBox(t->elementAt(row, 1));
maxSpeed_->setDecimals(1);
maxSpeed_->setMaximum(300.0);
maxSpeed_->setMinimum(0.0);
maxSpeed_->setValue(0.0);
l->setBuddy(maxSpeed_);
++row;
l = new WLabel(tr("vanet.property.form.mobility.length"), t->elementAt(row, 0));
length_ = new WDoubleSpinBox(t->elementAt(row, 1));
length_->setDecimals(1);
length_->setMaximum(20.0);
length_->setMinimum(0.0);
length_->setValue(5.0);
l->setBuddy(length_);
++row;
l = new WLabel(tr("vanet.property.form.mobility.maxaccel"), t->elementAt(row, 0));
maxAccel_ = new WDoubleSpinBox(t->elementAt(row, 1));
maxAccel_->setDecimals(1);
maxAccel_->setMaximum(10.0);
maxAccel_->setMinimum(0.0);
maxAccel_->setValue(0.6);
l->setBuddy(maxAccel_);
++row;
l = new WLabel(tr("vanet.property.form.mobility.comfydecel"), t->elementAt(row, 0));
comfyDecel_ = new WDoubleSpinBox(t->elementAt(row, 1));
comfyDecel_->setDecimals(1);
comfyDecel_->setMaximum(10.0);
comfyDecel_->setMinimum(0.0);
comfyDecel_->setValue(0.6);
l->setBuddy(comfyDecel_);
++row;
l = new WLabel(tr("vanet.property.form.mobility.jamdist"), t->elementAt(row, 0));
jamDistance_ = new WDoubleSpinBox(t->elementAt(row, 1));
jamDistance_->setDecimals(1);
jamDistance_->setMaximum(5.0);
jamDistance_->setMinimum(0.0);
jamDistance_->setValue(2.0);
l->setBuddy(jamDistance_);
++row;
l = new WLabel(tr("vanet.property.form.mobility.t"), t->elementAt(row, 0));
safeTimeHeadway_ = new WDoubleSpinBox(t->elementAt(row, 1));
safeTimeHeadway_->setDecimals(1);
safeTimeHeadway_->setMaximum(10.0);
safeTimeHeadway_->setMinimum(0.0);
safeTimeHeadway_->setValue(1.5);
l->setBuddy(safeTimeHeadway_);
++row;
l = new WLabel(tr("vanet.property.form.mobility.step"), t->elementAt(row, 0));
step_ = new WDoubleSpinBox(t->elementAt(row, 1));
step_->setDecimals(1);
step_->setMaximum(10.0);
step_->setMinimum(0.1);
step_->setValue(0.9);
l->setBuddy(step_);
++row;
l = new WLabel(tr("vanet.property.form.mobility.stay"), t->elementAt(row, 0));
stay_ = new WDoubleSpinBox(t->elementAt(row, 1));
stay_->setDecimals(1);
stay_->setMaximum(10.0);
stay_->setMinimum(0.0);
stay_->setValue(0.0);
l->setBuddy(stay_);
++row;
l = new WLabel(tr("vanet.property.form.mobility.bsave"), t->elementAt(row, 0));
bsave_ = new WDoubleSpinBox(t->elementAt(row, 1));
bsave_->setDecimals(1);
bsave_->setMaximum(10.0);
bsave_->setMinimum(0.0);
bsave_->setValue(4.0);
//.........这里部分代码省略.........
开发者ID:flaviu-toader,项目名称:vanetizer-c--,代码行数:101,代码来源:vanetmobilitymodelform.cpp
示例17: log
void PriceEditDialog::update()
{
/// 0 id
/// 1 group type Группа / Элемент
/// 2 value
/// 3 value type Процент / Цена
/// 4 price type Динамический / Статический
/// 5 Изменять фиксированные цены
/// 6 Дата принятия изменений
//resize(450, WLength::Auto);
char number[50];
int modelRow = m_item.row();
m_id = boost::any_cast<std::string>(m_model->data(modelRow, 0,UserRole));
//double price = boost::any_cast<double>(m_model->data(modelRow, 2,UserRole));
double value = boost::any_cast<double>(m_model->data(modelRow, 2,UserRole));
int valueType = boost::any_cast<int>(m_model->data(modelRow, 3,UserRole));
int button = boost::any_cast<int>(m_model->data(modelRow, 4,UserRole));
WDate chDate = boost::any_cast<WDate>(m_model->data(modelRow,6,UserRole));
int roundIndex = boost::any_cast<int>(m_model->data(modelRow,7,UserRole));
log("info")<<asString(m_model->data(modelRow, 5,UserRole))<<" "<<__LINE__;
//log("info")<<asString(m_model->data(modelRow, 5,UserRole))<<" "<<__LINE__;
std::string parent = boost::any_cast<std::string>(m_model->data(modelRow, 5,UserRole));
int modifyStatic = 0;
setWindowTitle(asString(m_model->data(modelRow, 3)));
WGroupBox *container = new Wt::WGroupBox(WString("Вид расчета цены",UTF8));
//container->setHeight(65);
m_chbPercentEnabled = new WCheckBox();
m_chbCostEnabled = new WCheckBox();
m_chbModifyStatic = new WCheckBox(WString("Изменять статические цены ?:",UTF8));
m_rbGroup = new WButtonGroup(this);
m_rbDynamicCalc = new WRadioButton(WString("Динамически:",UTF8),container);
new WBreak(container);
m_rbStaticCalc = new WRadioButton(WString("Статически",UTF8),container);
//boost::any d = m_model->data(modelRow, 2,UserRole);
//int v = boost::lexical_cast<int>(d);
m_rbGroup->addButton(m_rbDynamicCalc,Dynamic);
m_rbGroup->addButton(m_rbStaticCalc,Static);
if(button == 1)
m_rbGroup->setCheckedButton(m_rbGroup->button(1));
else
m_rbGroup->setCheckedButton(m_rbGroup->button(2));
m_rbGroup->checkedChanged().connect(this,&PriceEditDialog::onCalcTypeChanged);
m_chbModifyStatic->setChecked(modifyStatic);
/// Прицент / Цена
m_leCost = new WLineEdit("0.00");
m_lePercent = new WLineEdit("0.00");
if(valueType == 2)
{
sprintf(number,"%.2f",value);
m_chbPercentEnabled->setChecked();
m_lePercent->setText(number);
}
else if(valueType == 1)
{
sprintf(number,"%.2f",value);
m_chbCostEnabled->setChecked();
m_leCost->setText(number);
}
m_lePercent->setValidator(new WRegExpValidator("[0-9]+\\.[0-9]{2}"));
m_leCost->setValidator(new WRegExpValidator("[0-9]+\\.[0-9]{2}"));
// created
m_dpModified = new WDatePicker();
m_dpModified->lineEdit()->validator()->setMandatory(true);
m_dpModified->setFormat(FileModel::dateEditFormat);
m_dpModified->setDate(chDate);
m_dpModified->setGlobalPopup (true);
//WDate d = WDate::fromString(item->text(), FileModel::dateEditFormat);
//item->setData(boost::any(d), DisplayRole);
/*
* Use a grid layout for the labels and fields
*/
WGridLayout *layout = new WGridLayout();
WLabel *l;
int row = 0;
//layout->setContentsMargins(0,0,0,0);
//layout->setVerticalSpacing(3);
layout->addWidget(container, row, 0,3,0);
layout->setRowStretch(1, 1);
//.........这里部分代码省略.........
开发者ID:ineron,项目名称:fit-zakaz-portal,代码行数:101,代码来源:PriceEditDialog.cpp
注:本文中的WLabel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论