本文整理汇总了C++中WContainerWidget类的典型用法代码示例。如果您正苦于以下问题:C++ WContainerWidget类的具体用法?C++ WContainerWidget怎么用?C++ WContainerWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WContainerWidget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: editState
boost::any WItemDelegate::editState(WWidget *editor) const
{
WContainerWidget *w = dynamic_cast<WContainerWidget *>(editor);
WLineEdit *lineEdit = dynamic_cast<WLineEdit *>(w->widget(0));
return boost::any(lineEdit->text());
}
开发者ID:NeilNienaber,项目名称:wt,代码行数:7,代码来源:WItemDelegate.C
示例2: WContainerWidget
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);
}
开发者ID:rupindar,项目名称:witty_website,代码行数:28,代码来源:test.C
示例3: WContainerWidget
DragExample::DragExample(WContainerWidget *parent):
WContainerWidget(parent)
{
new WText("<p>Help these people with their decision by dragging one of "
"the pills.</p>", this);
if (!wApp->environment().javaScript()) {
new WText("<i>This examples requires that javascript support is "
"enabled.</i>", this);
}
WContainerWidget *pills = new WContainerWidget(this);
pills->setContentAlignment(AlignCenter);
createDragImage("icons/blue-pill.jpg",
"icons/blue-pill-small.png",
"blue-pill", pills);
createDragImage("icons/red-pill.jpg",
"icons/red-pill-small.png",
"red-pill", pills);
WContainerWidget *dropSites = new WContainerWidget(this);
new Character("Neo", dropSites);
new Character("Morpheus", dropSites);
new Character("Trinity", dropSites);
}
开发者ID:Dinesh-Ramakrishnan,项目名称:wt,代码行数:28,代码来源:DragExample.C
示例4: gdWDialog
gdWColorDialog::gdWColorDialog(WString title, gdWColorDialogData* refData)
: gdWDialog(title, refData), m_refData(refData), m_pColorTable(0)
{
if ( WString::tr("byObjectStyleSheet").narrow() == "true" )
wApp->useStyleSheet(wApp->theme()->resourcesUrl() + "gdwtcore/Css/gdWColorDialog.css");
wApp->messageResourceBundle().use(wApp->docRoot() + wApp->resourcesUrl() + "/gdwtcore/Transl/gdWColorDialog");
addStyleClass("gdWColorDialog");
m_refData->saveDataCallback = boost::bind(&gdWColorDialog::saveData, boost::ref(*this), m_refData);
WContainerWidget* content = getContent();
int row = 0;
int column = 0;
m_pColorTable = new WTable(content);
m_pColorTable->addStyleClass("gdWColorTable");
for (int red = 255; red > -1; red -= 51) {
for (int green = 255, column = 0; green > -1; green -= 51) {
for (int blue = 255; blue > -1; blue -= 51) {
addColor(m_pColorTable->elementAt(row, column), WColor(red, green, blue));
column++;
}
if ( green == 153 ) {
row++;
column = 0;
}
}
row++;
}
content->addWidget(m_pColorTable);
content->addWidget(new WBreak());
m_pText = new WText();
setColor(m_refData->m_color);
content->addWidget(m_pText);
resize(400, 450);
}
开发者ID:Wittyshare,项目名称:gdwtcore,代码行数:33,代码来源:gdWColorDialog.cpp
示例5: setEditState
void WItemDelegate::setEditState(WWidget *editor, const boost::any& value) const
{
WContainerWidget *w = dynamic_cast<WContainerWidget *>(editor);
WLineEdit *lineEdit = dynamic_cast<WLineEdit *>(w->widget(0));
lineEdit->setText(boost::any_cast<WT_USTRING>(value));
}
开发者ID:NeilNienaber,项目名称:wt,代码行数:7,代码来源:WItemDelegate.C
示例6: setImplementation
void WTabWidget::create(WFlags<AlignmentFlag> layoutAlignment)
{
setImplementation(layout_ = new WContainerWidget());
WT_DEBUG( setObjectName("WTabWidget") );
menu_ = new WMenu(new WStackedWidget(), Horizontal);
menu_->setRenderAsList(true);
WContainerWidget *menuDiv = new WContainerWidget();
menuDiv->setStyleClass("Wt-tabs");
menuDiv->addWidget(menu_);
layout_->addWidget(menuDiv);
layout_->addWidget(menu_->contentsStack());
setJavaScriptMember
(WT_RESIZE_JS, std::string() +
"function(self, w, h) {"
"""self.style.height= h + 'px';"
"""var c = self.firstChild;"
"""var t = self.lastChild;"
"""h -= c.offsetHeight + " WT_CLASS ".px(c, 'marginTop') "
"" "+ " WT_CLASS ".px(c, 'marginBottom');"
"""if (h > 0)"
"" "t." + WT_RESIZE_JS + "(t, w, h);"
"};");
menu_->itemSelected().connect(this, &WTabWidget::onItemSelected);
menu_->itemClosed().connect(this, &WTabWidget::onItemClosed);
}
开发者ID:Spencerx,项目名称:wt,代码行数:31,代码来源:WTabWidget.C
示例7: WApplication
mapboxApplication::mapboxApplication(const WEnvironment & env) : WApplication(env)
{
if (appRoot().empty()) {
std::cerr << "!!!!!!!!!!" << std::endl
<< "!! Warning: read the README.md file for hints on deployment,"
<< " the approot looks suspect!" << std::endl
<< "!!!!!!!!!!" << std::endl;
}
setTheme(new WBootstrapTheme());
this->useStyleSheet(WLink("wtMapExample.css"));
setTitle("Mapbox Examples");
WContainerWidget * mainContent = new WContainerWidget(root());
mainContent->setStyleClass("examplemap");
map = new MapBox::Map(mainContent, true);
map->setMapStyle(MapBox::MAPSTYLE::Streets);
map->zoom(14).center(MapBox::Coordinate(51.515823, -0.124331));
// add all controls
// map->addNavigationControl();
// map->addGeoLocateControl();
// map->addGeoCoderControl();
menuBar = new MenuBar(root());
}
开发者ID:yvanvds,项目名称:wtMapbox,代码行数:28,代码来源:mapboxApplication.cpp
示例8: container
void FlexLayoutImpl::update()
{
WContainerWidget *c = container();
if (c)
c->layoutChanged(false);
}
开发者ID:AlexanderKotliar,项目名称:wt,代码行数:7,代码来源:FlexLayoutImpl.C
示例9: WException
void WWidgetItem::setParentWidget(WWidget *parent)
{
if (!widget_)
return;
if (parent) {
WContainerWidget *pc = dynamic_cast<WContainerWidget *>(parent);
if (widget_->parent()) {
if (widget_->parent() != pc)
throw WException("Cannot move a WWidgetItem to another container");
} else
pc->widgetAdded(widget_.get());
bool flexLayout = dynamic_cast<FlexLayoutImpl *>
(parentLayout_->impl()) != 0;
if (flexLayout)
impl_ = cpp14::make_unique<FlexItemImpl>(this);
else
impl_ = cpp14::make_unique<StdWidgetItemImpl>(this);
} else {
WContainerWidget *pc = dynamic_cast<WContainerWidget *>(widget_->parent());
if (pc)
pc->widgetRemoved(widget_.get(), true);
impl_.reset();
}
}
开发者ID:kdeforche,项目名称:wt,代码行数:30,代码来源:WWidgetItem.C
示例10:
WWidget *WToolBar::widget(int index) const
{
if (compact_)
return impl_->widget(index);
else {
int current = 0;
for (int i = 0; i < impl_->count(); ++i) {
WWidget *w = impl_->widget(i);
if (dynamic_cast<WSplitButton *>(w)) {
if (index == current)
return w;
++current;
} else {
WContainerWidget *group = dynamic_cast<WContainerWidget *>(w);
if (index < current + group->count())
return group->widget(index - current);
current += group->count();
}
}
return 0;
}
}
开发者ID:ChowZenki,项目名称:wt,代码行数:26,代码来源:WToolBar.C
示例11: WAnchor
WWidget *ProductMenuItem::createItemWidget()
{
//<div class="collection" style="background: url(productimages/QEES_Dimmer_billed_tekst_01_thumb.jpg) no-repeat;">
WAnchor *result = new WAnchor();
WContainerWidget *collection = new WContainerWidget(result);
result->mouseWentOver().connect(SLOT(this, ProductMenuItem::_mouseWentOver));
result->mouseWentOut().connect(SLOT(this, ProductMenuItem::_mouseWentOut));
collection->setStyleClass("collection");
WString imageName = _product->imageThumbName("var/www/", "resources/images/productimages/");
collection->decorationStyle().setBackgroundImage(imageName.toUTF8());
_faderInvisible = new WContainerWidget(collection);
_faderInvisible->setStyleClass("fader invisible");
WContainerWidget *faderInvisible2 = new WContainerWidget(_faderInvisible);
new WText(_description(), faderInvisible2);
// @todo: Add this? Change picutre
// <!--<div class="sale_label"></div>-->
//WContainerWidget *salesLabel = new WContainerWidget(collection);
//salesLabel->setStyleClass("sale_label");
// @todo: Add this? Change picutre
// <!--<div class="sale_label"></div>-->
//WContainerWidget *offerLabel = new WContainerWidget(collection);
//offerLabel->setStyleClass("offer_label");
return result;
}
开发者ID:arlukin,项目名称:avshop,代码行数:30,代码来源:ProductMenuItem.cpp
示例12: modelDataChanged
void WSuggestionPopup::modelDataChanged(const WModelIndex& topLeft,
const WModelIndex& bottomRight)
{
if (topLeft.parent().isValid())
return;
if (modelColumn_ < topLeft.column() || modelColumn_ > bottomRight.column())
return;
for (int i = topLeft.row(); i <= bottomRight.row(); ++i) {
WContainerWidget *w = dynamic_cast<WContainerWidget *>(impl_->widget(i));
WAnchor *anchor = dynamic_cast<WAnchor *>(w->widget(0));
WText *value = dynamic_cast<WText *>(anchor->widget(0));
WModelIndex index = model_->index(i, modelColumn_);
boost::any d = index.data();
value->setText(asString(d));
TextFormat format = index.flags() & ItemIsXHTMLText ? XHTMLText : PlainText;
value->setTextFormat(format);
boost::any d2 = model_->data(i, modelColumn_, UserRole);
if (d2.empty())
d2 = d;
value->setAttributeValue("sug", asString(d2));
}
}
开发者ID:Unss,项目名称:wt,代码行数:29,代码来源:WSuggestionPopup.C
示例13: 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);
}
开发者ID:USP,项目名称:wtcpp,代码行数:35,代码来源:TreeViewDragDrop.C
示例14: WContainerWidget
WWidget *StyleLayout::wGridLayout()
{
WContainerWidget *result = new WContainerWidget();
topic("WGridLayout", result);
addText(tr("layout-WGridLayout"), result);
WContainerWidget *container;
container = new WContainerWidget(result);
container->resize(WLength::Auto, 400);
container->setStyleClass("yellow-box");
WGridLayout *grid = new WGridLayout();
container->setLayout(grid);
for (int row = 0; row < 3; ++row) {
for (int column = 0; column < 4; ++column) {
WText *t = addText(tr("grid-item").arg(row).arg(column));
if (row == 1 || column == 1 || column == 2)
t->setStyleClass("blue-box");
else
t->setStyleClass("green-box");
grid->addWidget(t, row, column);
}
}
grid->setRowStretch(1, 1);
grid->setColumnStretch(1, 1);
grid->setColumnStretch(2, 1);
return result;
}
开发者ID:ReWeb3D,项目名称:wt,代码行数:32,代码来源:StyleLayout.C
示例15: WPieChart
/*! \brief Creates the chart.
*/
WWidget *pieChart() {
using namespace Chart;
WPieChart *chart = new WPieChart();
chart->setModel(fileFilterModel_);
chart->setTitle("File sizes");
chart->setLabelsColumn(1); // Name
chart->setDataColumn(3); // Size
chart->setPerspectiveEnabled(true, 0.2);
chart->setDisplayLabels(Outside | TextLabel);
if (!WApplication::instance()->environment().ajax()) {
chart->resize(500, 200);
chart->setMargin(WLength::Auto, Left | Right);
WContainerWidget *w = new WContainerWidget();
w->addWidget(chart);
w->setStyleClass("about");
return w;
} else {
chart->setStyleClass("about");
return chart;
}
}
开发者ID:USP,项目名称:wtcpp,代码行数:27,代码来源:TreeViewDragDrop.C
示例16: WCompositeWidget
CookiesLawDisclaimer::CookiesLawDisclaimer(WContainerWidget* parent, const std::function<void()> &runOnAccepted)
: WCompositeWidget(parent)
{
WContainerWidget *content = new WContainerWidget;
content->addStyleClass("alert alert-danger");
content->addWidget(new WText("cookies_law_disclaimer"_wtr));
auto readMoreButton = new WPushButton("cookies_law_readmore"_wtr, content);
readMoreButton->setStyleClass("btn-link");
readMoreButton->clicked().connect([=](const WMouseEvent &){
WMessageBox *messageBox = new WMessageBox("cookies_law_readmore_caption"_wtr, "cookies_law_readmore_text"_wtr, Information, Ok, this);
messageBox->contents()->setOverflow(WContainerWidget::OverflowAuto);
messageBox->setHeight(500);
messageBox->buttonClicked().connect([=](StandardButton, _n5){
delete messageBox;
});
messageBox->show();
});
auto agreeButton = new WPushButton("cookies_law_agree"_wtr, content);
agreeButton->setStyleClass("btn-link");
agreeButton->clicked().connect([=](const WMouseEvent&){
wApp->setCookie(COOKIES_LAW_COOKIE_NAME, COOKIES_LAW_COOKIE_VALUE, 60 * 60 * 24 * 365);
runOnAccepted();
delete this;
});
content->addStyleClass("cookies_law_agreement");
setImplementation(content);
}
开发者ID:GuLinux,项目名称:GuLinux-Commons,代码行数:27,代码来源:cookieslawdisclaimer.cpp
示例17: WContainerWidget
void WSuggestionPopup::modelRowsInserted(const WModelIndex& parent,
int start, int end)
{
if (filterLength_ != 0 && !filtering_)
return;
if (modelColumn_ >= model_->columnCount())
return;
if (parent.isValid())
return;
for (int i = start; i <= end; ++i) {
WContainerWidget *line = new WContainerWidget();
content_->insertWidget(i, line);
boost::any d = model_->data(i, modelColumn_);
WText *value = new WText(asString(d), PlainText);
boost::any d2 = model_->data(i, modelColumn_, UserRole);
if (d2.empty())
d2 = d;
line->addWidget(value);
value->setAttributeValue("sug", asString(d2));
}
}
开发者ID:bvanhauwaert,项目名称:wt,代码行数:27,代码来源:WSuggestionPopup.C
示例18: WContainerWidget
FormExample::FormExample()
: WContainerWidget()
{
WContainerWidget *langLayout = this->addWidget(cpp14::make_unique<WContainerWidget>());
langLayout->setContentAlignment(AlignmentFlag::Right);
langLayout->addWidget(cpp14::make_unique<WText>(tr("language")));
const char *lang[] = { "en", "nl" };
for (int i = 0; i < 2; ++i) {
WText *t = langLayout->addWidget(cpp14::make_unique<WText>(lang[i]));
t->setMargin(5);
t->clicked().connect(std::bind(&FormExample::changeLanguage, this, t));
languageSelects_.push_back(t);
}
/*
* Start with the reported locale, if available
*/
setLanguage(wApp->locale().name());
Form *form = this->addWidget(cpp14::make_unique<Form>());
form->setMargin(20);
}
开发者ID:AlexanderKotliar,项目名称:wt,代码行数:25,代码来源:FormExample.C
示例19: setCondition
void AuthWidget::createOAuthLoginView()
{
if (!model_->oAuth().empty()) {
setCondition("if:oauth", true);
WContainerWidget *icons = new WContainerWidget();
icons->setInline(isInline());
for (unsigned i = 0; i < model_->oAuth().size(); ++i) {
const OAuthService *auth = model_->oAuth()[i];
WImage *w = new WImage("css/oauth-" + auth->name() + ".png", icons);
w->setToolTip(auth->description());
w->setStyleClass("Wt-auth-icon");
w->setVerticalAlignment(AlignMiddle);
OAuthProcess *const process
= auth->createProcess(auth->authenticationScope());
#ifndef WT_TARGET_JAVA
w->clicked().connect(process, &OAuthProcess::startAuthenticate);
#else
process->connectStartAuthenticate(w->clicked());
#endif
process->authenticated().connect
(boost::bind(&AuthWidget::oAuthDone, this, process, _1));
WObject::addChild(process);
}
bindWidget("icons", icons);
}
}
开发者ID:913862627,项目名称:wt,代码行数:33,代码来源:AuthWidget.C
示例20: WApplication
MainPage::MainPage( const WEnvironment& env)
: WApplication(env)
{
setTitle("Main page");
this->useStyleSheet(AppPaths::cssFile);
// Remove this 2 lines???
userList = new WContainerWidget(root());
userList->setStyleClass("list");
// Remove it?
WContainerWidget *t = new WContainerWidget();
t->setInline(false);
t->show();
t->setStyleClass("big");
// Remove it?
WStackedWidget *main = new WStackedWidget(root());
main->setStyleClass("");
root()->removeWidget(main);
Wt::WHBoxLayout *loginLayout = new Wt::WHBoxLayout(root());
LoginWidget *login = new LoginWidget();
loginLayout->addWidget(login);
login->loggedIn().connect(this,&MainPage::setMainPage);
}
开发者ID:jlesquembre,项目名称:remote-admin,代码行数:33,代码来源:MainPage.cpp
注:本文中的WContainerWidget类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论