Skip to content

Commit 1aee7b4

Browse files
author
Koen Deforche
committed
see Changelog
1 parent eb68cc0 commit 1aee7b4

File tree

132 files changed

+1715
-734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+1715
-734
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ doc/reference
44
doc/examples
55
CVS
66
.DS_Store
7+
examples/*/resources

Changelog

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
05-12-2010:
1+
11-01-2010:
2+
* themes/polished: several improvements
3+
4+
* WPanel, WCalendar, WDatePicker, WDialog: improved theme support
5+
6+
* WTreeView: several bug fixes and improved IE bug workaround support
7+
8+
05-01-2010:
29
* Chart/WAxis: added setLabelFont(), labelFont() methods
310

411
* WTreeNode: fix selection handling when removing and readding a node
512

613
* Boot.html, Hybrid.html: fix an XSS vulnerability arising from the
714
internal path
815

9-
04-12-2010:
16+
04-01-2010:
1017
* Wt.js, CommAjax.js, CommScript.js: support communication problems
1118
by retrying with exponential back-off
1219

examples/blog/model/Post.C

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ std::string Post::commentCount() const
3131

3232
dbo::ptr<Comment> Post::rootComment() const
3333
{
34-
return comments.session()->find<Comment>
35-
("where post_id = ? and parent_id is null").bind(comments.arg());
34+
if (session())
35+
return session()->find<Comment>
36+
("where post_id = ? and parent_id is null").bind(id());
37+
else
38+
return dbo::ptr<Comment>();
3639
}
3740

3841
std::string Post::titleToUrl() const

examples/blog/model/Post.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace dbo = Wt::Dbo;
2222
typedef dbo::collection< dbo::ptr<Comment> > Comments;
2323
typedef dbo::collection< dbo::ptr<Tag> > Tags;
2424

25-
class Post {
25+
class Post : public dbo::Dbo {
2626
public:
2727
enum State {
2828
Unpublished = 0,

examples/blog/model/User.C

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,26 @@ bool User::authenticate(const std::string& password) const
6565

6666
Posts User::latestPosts(int count) const
6767
{
68-
return posts.session()->find<Post>
69-
("where author_id = ? and state = ? "
70-
"order by date desc "
71-
"limit ?")
72-
.bind(posts.arg())
73-
.bind(Post::Published)
74-
.bind(count);
68+
if (session())
69+
return session()->find<Post>
70+
("where author_id = ? and state = ? "
71+
"order by date desc "
72+
"limit ?")
73+
.bind(id())
74+
.bind(Post::Published)
75+
.bind(count);
76+
else
77+
return Posts();
7578
}
7679

7780
Posts User::allPosts(Post::State state) const
7881
{
79-
return posts.session()->find<Post>
80-
("where author_id = ? and state = ? "
81-
"order by date desc")
82-
.bind(posts.arg())
83-
.bind(state);
82+
if (session())
83+
return session()->find<Post>
84+
("where author_id = ? and state = ? "
85+
"order by date desc")
86+
.bind(id())
87+
.bind(state);
88+
else
89+
return Posts();
8490
}

examples/blog/model/User.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace dbo = Wt::Dbo;
1818
typedef dbo::collection< dbo::ptr<Comment> > Comments;
1919
typedef dbo::collection< dbo::ptr<Post> > Posts;
2020

21-
class User {
21+
class User : public dbo::Dbo {
2222
public:
2323
enum Role {
2424
Visitor = 0,

examples/treeview/TreeViewExample.C

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
* See the LICENSE file for terms of use.
55
*/
66
#include "TreeViewExample.h"
7+
78
#include <iostream>
89
#include <boost/lexical_cast.hpp>
10+
911
#include <Wt/WContainerWidget>
12+
#include <Wt/WPanel>
1013
#include <Wt/WPushButton>
1114
#include <Wt/WStandardItem>
1215
#include <Wt/WStandardItemModel>
@@ -35,12 +38,13 @@ TreeViewExample::TreeViewExample(WStandardItemModel *model,
3538
/*
3639
* Now create the view
3740
*/
38-
treeView_ = new WTreeView(this);
41+
WPanel *panel = new WPanel(this);
42+
panel->resize(600, 300);
43+
panel->setCentralWidget(treeView_ = new WTreeView());
3944
treeView_->setAlternatingRowColors(!treeView_->alternatingRowColors());
4045
treeView_->setRowHeight(30);
4146
treeView_->setModel(model_);
4247
treeView_->setSelectionMode(NoSelection);
43-
treeView_->resize(600, 300);
4448

4549
treeView_->setColumnWidth(1, WLength(100));
4650
treeView_->setColumnAlignment(1, AlignCenter);

examples/widgetgallery/FormWidgets.C

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,10 @@ WWidget *FormWidgets::wInPlaceEdit()
283283
WContainerWidget *result = new WContainerWidget();
284284

285285
topic("WInPlaceEdit", result);
286-
new WText("<p>This widget allows you to edit a string by clicking "
287-
"on it. The text changes in a WLineEdit while editing.</p>",
286+
new WText("<p>This widget allows you to edit a text in-place by clicking "
287+
"on it. You can enable the save/cancel buttons (like here below) "
288+
"or disable them (as used in the WCalendar widget to edit the "
289+
"year).</p>",
288290
result);
289291
new WText("Try it here: ", result);
290292
WInPlaceEdit *ipe = new WInPlaceEdit("This is editable text", result);
@@ -380,17 +382,17 @@ WWidget *FormWidgets::wPopupMenu()
380382
new WText(tr("formwidgets-WPopupMenu"), result);
381383

382384
WPopupMenu *popup = new WPopupMenu();
383-
popup->addItem("icons/popupmenu.gif", "String item with image");
384-
popup->addItem("Checkable string item")->setCheckable(true);
385-
popup->addItem("Plain string item");
385+
popup->addItem("icons/house.png", "Build a house");
386+
popup->addItem("Roof included")->setCheckable(true);
387+
popup->addItem("Add a door");
386388
popup->addSeparator();
387-
popup->addItem("Another plain string item");
389+
popup->addItem("Add a window");
388390
WPopupMenu *subMenu = new WPopupMenu();
389-
subMenu->addItem("Sub item");
390-
popup->addMenu("Sub menu", subMenu);
391+
subMenu->addItem("Add a chair");
392+
subMenu->addItem("Add a table");
393+
popup->addMenu("Add furniture", subMenu);
391394

392-
WLabel* clickMe =
393-
new WLabel("Click me and a WPopupMenu will appear!", result);
395+
WLabel* clickMe = new WLabel("Clicking here will show a popup menu.", result);
394396
clickMe->setStyleClass("popupmenuLabel");
395397
clickMe->clicked().connect(SLOT(popup, WPopupMenu::popup));
396398

examples/widgetgallery/MvcWidgets.C

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@
88
#include "TreeViewExample.h"
99
#include "DeferredWidget.h"
1010

11+
#include <Wt/WBreak>
1112
#include <Wt/WComboBox>
13+
#include <Wt/WPanel>
1214
#include <Wt/WPushButton>
1315
#include <Wt/WSelectionBox>
16+
#include <Wt/WStandardItem>
17+
#include <Wt/WStandardItemModel>
1418
#include <Wt/WStringListModel>
1519
#include <Wt/WText>
16-
#include <Wt/Ext/ComboBox>
1720
#include <Wt/WTreeView>
1821
#include <Wt/WTable>
19-
#include <Wt/WBreak>
20-
#include <Wt/WStandardItemModel>
21-
#include <Wt/WStandardItem>
22+
#include <Wt/Ext/ComboBox>
2223
#include <iostream>
2324
using namespace Wt;
2425

@@ -60,11 +61,7 @@ void MvcWidgets::comboBoxAdd()
6061
if (extComboBox_->currentIndex() == -1) {
6162
std::vector<WString> sl = stringList_->stringList();
6263
sl.push_back(extComboBox_->currentText());
63-
//std::cout << "combobox text: " << extComboBox_->currentText() << std::endl;
64-
//sl.push_back("Blabla");
6564
stringList_->setStringList(sl);
66-
//stringList_->insertRows(0, 1);
67-
//stringList_->setData(0, 0, WString("Blabla"));
6865
}
6966
}
7067

@@ -222,7 +219,6 @@ WWidget *MvcWidgets::viewsTree()
222219
result->addWidget(tv2);
223220

224221
tv2->treeView()->setColumn1Fixed(true);
225-
tv2->treeView()->resize(300, 150);
226222

227223
return result;
228224
}

examples/widgetgallery/WidgetGallery.C

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ WidgetGallery::WidgetGallery(const WEnvironment& env)
7878
useStyleSheet("everywidget.css");
7979
useStyleSheet("dragdrop.css");
8080
useStyleSheet("combostyle.css");
81-
useStyleSheet("popupmenu.css");
8281
}
8382

8483
void WidgetGallery::addToMenu(WMenu *menu, const WString& name,

0 commit comments

Comments
 (0)