Skip to content

Commit e5fb715

Browse files
author
Koen Deforche
committed
see Changelog
1 parent f7e21dc commit e5fb715

Some content is hidden

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

60 files changed

+762
-251
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ OPTION(ENABLE_HARU "Enable Haru Free PDF Library, which is used to provide suppo
6060
OPTION(ENABLE_EXT "Build Wt Ext library with JavaScript-only widgets (http://extjs.com/)" ON)
6161
OPTION(ENABLE_SQLITE "Build SQLite3 backend for Wt::Dbo" ON)
6262
OPTION(ENABLE_POSTGRES "Build PostgreSQL backend for Wt::Dbo" ON)
63+
OPTION(WT_NO_STD_LOCALE "Build Wt ro run on a system without std::locale support" OFF)
64+
OPTION(WT_NO_STD_WSTRING "Build Wt ro run on a system without std::wstring support" OFF)
6365

6466
IF(NOT SHARED_LIBS)
6567
IF(WIN32)

Changelog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
10-23-2010:
2+
* Chart/WCartesianChart: support ToolTipRole data using WAbstractArea
3+
areas
4+
15
10-15-2010:
26
* Dbo/Sesion: add rereadAll()
37

WConfig.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#cmakedefine WT_HAS_WPDFIMAGE
3131

3232
#cmakedefine WT_NO_BOOST_INTRUSIVE
33+
#cmakedefine WT_NO_STD_LOCALE
34+
#cmakedefine WT_NO_STD_WSTRING
3335

3436
#if ${WT_DEBUG_ENABLED}
3537
#ifndef WT_TARGET_JAVA

examples/charts/ChartsExample.C

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,21 @@ namespace {
4444
readFromCsv(f, model);
4545

4646
for (int row = 0; row < model->rowCount(); ++row)
47-
for (int col = 0; col < model->columnCount(); ++col)
47+
for (int col = 0; col < model->columnCount(); ++col) {
4848
model->item(row, col)->setFlags(ItemIsSelectable | ItemIsEditable);
4949

50+
/*
51+
Example of tool tips (disabled here because they are not updated
52+
when editing data)
53+
*/
54+
55+
/*
56+
WString toolTip = asString(model->headerData(col)) + ": "
57+
+ asString(model->item(row, col)->data(DisplayRole), "%.f");
58+
model->item(row, col)->setToolTip(toolTip);
59+
*/
60+
}
61+
5062
return model;
5163
} else {
5264
WString error(WString::tr("error-missing-data"));
@@ -73,8 +85,8 @@ CategoryExample::CategoryExample(Wt::WContainerWidget *parent):
7385
{
7486
new WText(WString::tr("category chart"), this);
7587

76-
WAbstractItemModel *model = readCsvFile(
77-
WApplication::appRoot() + "category.csv", this);
88+
WAbstractItemModel *model = readCsvFile(WApplication::appRoot() + "category.csv",
89+
this);
7890

7991
if (!model)
8092
return;
@@ -128,7 +140,7 @@ CategoryExample::CategoryExample(Wt::WContainerWidget *parent):
128140
chart->setPlotAreaPadding(50, Top | Bottom);
129141

130142
/*
131-
* Add all (but first) column as bar series
143+
* Add all (but first) column as bar series
132144
*/
133145
for (int i = 1; i < model->columnCount(); ++i) {
134146
WDataSeries s(i, BarSeries);
@@ -164,7 +176,7 @@ TimeSeriesExample::TimeSeriesExample(Wt::WContainerWidget *parent):
164176
for (int i = 0; i < model->rowCount(); ++i) {
165177
WString s = asString(model->data(i, 0));
166178
WDate d = WDate::fromString(s, "dd/MM/yy");
167-
model->setData(i, 0, boost::any(d));
179+
model->setData(i, 0, d);
168180
}
169181

170182
// Show a view that allows editing of the model.
@@ -242,14 +254,14 @@ ScatterPlotExample::ScatterPlotExample(WContainerWidget *parent):
242254
new WText(WString::tr("scatter plot 2"), this);
243255

244256
WStandardItemModel *model = new WStandardItemModel(40, 2, this);
245-
model->setHeaderData(0, boost::any(WString("X")));
246-
model->setHeaderData(1, boost::any(WString("Y = sin(X)")));
257+
model->setHeaderData(0, WString("X"));
258+
model->setHeaderData(1, WString("Y = sin(X)"));
247259

248260
for (unsigned i = 0; i < 40; ++i) {
249261
double x = (static_cast<double>(i) - 20) / 4;
250262

251-
model->setData(i, 0, boost::any(x));
252-
model->setData(i, 1, boost::any(sin(x)));
263+
model->setData(i, 0, x);
264+
model->setData(i, 1, sin(x));
253265
}
254266

255267
/*
@@ -294,29 +306,30 @@ PieExample::PieExample(WContainerWidget *parent):
294306

295307
//headers
296308
model->insertColumns(model->columnCount(), 2);
297-
model->setHeaderData(0, boost::any(WString("Item")));
298-
model->setHeaderData(1, boost::any(WString("Sales")));
309+
model->setHeaderData(0, WString("Item"));
310+
model->setHeaderData(1, WString("Sales"));
299311

300312
//data
301313
model->insertRows(model->rowCount(), 6);
302314
int row = 0;
303-
model->setData(row, 0, boost::any(WString("Blueberry")));
304-
model->setData(row, 1, boost::any(120));
315+
model->setData(row, 0, WString("Blueberry"));
316+
model->setData(row, 1, 120);
317+
// model->setData(row, 1, WString("Blueberry"), ToolTipRole);
305318
row++;
306-
model->setData(row, 0, boost::any(WString("Cherry")));
307-
model->setData(row, 1, boost::any(30));
319+
model->setData(row, 0, WString("Cherry"));
320+
model->setData(row, 1, 30);
308321
row++;
309-
model->setData(row, 0, boost::any(WString("Apple")));
310-
model->setData(row, 1, boost::any(260));
322+
model->setData(row, 0, WString("Apple"));
323+
model->setData(row, 1, 260);
311324
row++;
312-
model->setData(row, 0, boost::any(WString("Boston Cream")));
313-
model->setData(row, 1, boost::any(160));
325+
model->setData(row, 0, WString("Boston Cream"));
326+
model->setData(row, 1, 160);
314327
row++;
315-
model->setData(row, 0, boost::any(WString("Other")));
316-
model->setData(row, 1, boost::any(40));
328+
model->setData(row, 0, WString("Other"));
329+
model->setData(row, 1, 40);
317330
row++;
318-
model->setData(row, 0, boost::any(WString("Vanilla Cream")));
319-
model->setData(row, 1, boost::any(120));
331+
model->setData(row, 0, WString("Vanilla Cream"));
332+
model->setData(row, 1, 120);
320333
row++;
321334

322335
//set all items to be editable and selectable

examples/widgetgallery/ControlsWidget.C

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include <Wt/WText>
99
#include <sstream>
1010

11+
#include <boost/algorithm/string.hpp>
12+
1113
using namespace Wt;
1214

1315
ControlsWidget::ControlsWidget(EventDisplayer *ed, bool hasSubMenu)
@@ -34,21 +36,37 @@ std::string ControlsWidget::escape(const std::string &name) const
3436
return ss.str();
3537
}
3638

37-
std::string ControlsWidget::doxygenAnchor(const std::string &classname) const
39+
std::string ControlsWidget::docAnchor(const std::string &classname) const
3840
{
3941
std::stringstream ss;
42+
43+
#if !defined(WT_TARGET_JAVA)
4044
ss << "<a href=\"http://www.webtoolkit.eu/wt/doc/reference/html/class"
4145
<< escape("Wt::" + classname)
4246
<< ".html\" target=\"_blank\">doc</a>";
47+
#else
48+
std::string cn = boost::replace_all(classname, "Chart::","chart/");
49+
ss << "<a href=\"http://www.webtoolkit.eu/"
50+
<< "jwt/latest/doc/javadoc/eu/webtoolkit/jwt/"
51+
<< classname
52+
<< ".html\" target=\"_blank\">doc</a>";
53+
#endif
4354

4455
return ss.str();
4556
}
4657

4758
std::string ControlsWidget::title(const std::string& classname) const
4859
{
49-
return "<span class=\"title\">" + classname + "</span> "
50-
+ "<span class=\"doc\">["
51-
+ doxygenAnchor(classname) + "]</span>";
60+
std::string cn;
61+
#if defined(WT_TARGET_JAVA)
62+
cn = boost::replace_all(classname, "Chart::","");
63+
#else
64+
cn = classname;
65+
#endif
66+
67+
return std::string("<span class=\"title\">") + cn + "</span> "
68+
+ "<span class=\"doc\">["
69+
+ docAnchor(classname) + "]</span>";
5270
}
5371

5472
void ControlsWidget::topic(const std::string &classname,

examples/widgetgallery/ControlsWidget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ControlsWidget : public Wt::WContainerWidget
4747
private:
4848
bool hasSubMenu_;
4949

50-
std::string doxygenAnchor(const std::string &classname) const;
50+
std::string docAnchor(const std::string &classname) const;
5151
std::string title(const std::string &classname) const;
5252
std::string escape(const std::string &name) const;
5353
};

examples/widgetgallery/DeferredWidget.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* We use this to defer widget creation until needed, which also defers
1313
* loading auxiliary javascript libraries.
1414
*/
15+
#if !defined(WT_TARGET_JAVA)
1516
template <typename Function>
1617
class DeferredWidget : public Wt::WContainerWidget
1718
{
@@ -33,5 +34,16 @@ DeferredWidget<Function> *deferCreate(Function f)
3334
{
3435
return new DeferredWidget<Function>(f);
3536
}
37+
#else
38+
class DeferredWidget : public Wt::WContainerWidget {
39+
public:
40+
DeferredWidget(boost::bound f) {}
41+
};
42+
DeferredWidget *deferCreate(boost::bound b)
43+
{
44+
return new DeferredWidget(b);
45+
}
46+
47+
#endif
3648

3749
#endif // DEFERRED_WIDGET_H_

examples/widgetgallery/DialogWidgets.C

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ void DialogWidgets::populateSubMenu(WMenu *menu)
5050
{
5151
menu->addItem("WDialog", wDialog());
5252
menu->addItem("WMessageBox", wMessageBox());
53+
#ifndef WT_TARGET_JAVA
5354
menu->addItem("Ext Dialogs",
5455
deferCreate(boost::bind(&DialogWidgets::eDialogs, this)));
56+
#endif
5557
}
5658

5759
WWidget *DialogWidgets::wDialog()
@@ -97,6 +99,7 @@ WWidget *DialogWidgets::wMessageBox()
9799
return result;
98100
}
99101

102+
#ifndef WT_TARGET_JAVA
100103
WWidget *DialogWidgets::eDialogs()
101104
{
102105
WContainerWidget *result = new WContainerWidget();
@@ -122,6 +125,7 @@ WWidget *DialogWidgets::eDialogs()
122125

123126
return result;
124127
}
128+
#endif
125129

126130
void DialogWidgets::messageBox1()
127131
{
@@ -221,6 +225,7 @@ void DialogWidgets::customModal()
221225
}
222226
}
223227

228+
#ifndef WT_TARGET_JAVA
224229
void DialogWidgets::createExtMessageBox()
225230
{
226231
Ext::MessageBox *mb = new Ext::MessageBox();
@@ -327,4 +332,5 @@ void DialogWidgets::deleteExtDialog()
327332
}
328333
delete extDialog_;
329334
}
335+
#endif
330336

examples/widgetgallery/DialogWidgets.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@ class DialogWidgets : public ControlsWidget
6666
Wt::WMessageBox *messageBox_;
6767
Wt::WText *status_;
6868

69+
#ifndef WT_TARGET_JAVA
6970
void createExtDialog();
7071
void createExtMessageBox();
7172
void createExtProgress();
7273
void deleteExtDialog();
7374
Wt::Ext::Dialog *extDialog_;
74-
75+
#endif
7576
};
7677

7778
#endif

examples/widgetgallery/EventDisplayer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class EventDisplayer: public Wt::WContainerWidget
3535
void showEventImpl(const Wt::WString& str);
3636
};
3737

38+
#ifndef WT_TARGET_JAVA
3839
template<typename T>
3940
void EventDisplayer::showSignal(T &s, const std::string& str)
4041
{
@@ -46,5 +47,6 @@ void EventDisplayer::showEvent(T &s, const Wt::WString& str)
4647
{
4748
s.connect(boost::bind(&EventDisplayer::showEventImpl, this, str));
4849
}
50+
#endif
4951

5052
#endif

0 commit comments

Comments
 (0)