Skip to content

Commit 534d199

Browse files
author
Koen Deforche
committed
Several changes:
- make single click selection the default for a calendar, and un-deprecate WCalendar::setSingleClickSelect() (#2655) - wt-homepage: update google analytics API - themes: fix RTL regressions (#2648) - Wt::Auth: fix processEnvironment() in progressive bootstrap mode not showing the dialogs - Wt::Chart::WAxis: fix setLabelInterval() not working properly for range 30-120s - Wt::Dbo: isTransient() now also true for ptr's that were removed from DB - WDialog: fix #2646: footer() lazy-creates the footer - WStackedWidget: Fix #2645, patch from Bruce Toll, animation glitches - Revert firefox layout manager regression (in e.g. bootstrap 2 dialogs) - WAppcliation: restore confirm dialog when quited (#2603, Bruce Tool) - WPushButton: added a warning as per #1802 - WAbstractItemView: fix #2284, ctrl-select unselects in single selection mode too - WPopupWidget: implemented #2396: automatic deletion on close - WPushBtton: fix resolveUrl when updating button icon, and fix redundant set of icon (#2599) - WTableView, WTreeView: fix scrollTo() being done before geometry modifications (#2525) - Wt::Render: more robust detection of a thead for repeating headers - Wt::Dbo::mysql backend: Doing mysql_library_init once, without locking and fixed race condition: mysql_init is not threadsafe - Wt::Dbo: restore query<bool> functionality (#2543)
1 parent 813a601 commit 534d199

Some content is hidden

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

53 files changed

+887
-356
lines changed

examples/chart3D/CategoryExample.C

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ CategoryExample::~CategoryExample()
128128
delete planeModel_;
129129
delete isotopeModel_;
130130

131+
std::vector<WAbstractDataSeries3D*> onChart = chart_->dataSeries();
132+
for (unsigned i=0; i < onChart.size(); i++)
133+
chart_->removeDataSeries(onChart[i]);
131134
for (unsigned i=0; i < series_.size(); i++)
132135
delete series_[i];
133136
}

examples/chart3D/NumericalExample.C

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ NumericalExample::~NumericalExample()
164164
delete para1Model_;
165165
delete para2Model_;
166166

167+
std::vector<WAbstractDataSeries3D*> onChart = chart_->dataSeries();
168+
for (unsigned i=0; i < onChart.size(); i++)
169+
chart_->removeDataSeries(onChart[i]);
167170
for (unsigned i=0; i < series_.size(); i++)
168171
delete series_[i];
169172
}

examples/widgetgallery/approot/text.xml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -917,13 +917,26 @@
917917
</dd>
918918
<dt>bootstrap</dt>
919919
<dd>
920-
This theme is implemented by the ${doc-link WBootstrapTheme}
921-
class, and relies on Twitter's Bootstrap CSS framework. Use
922-
<tt>setTheme(new WBootstrapTheme())</tt> to use this theme.
923-
We support Bootstrap 2 and Bootstrap 3, so you may choose your
924-
favorite Bootstrap version with WTheme::setVersion function. The
925-
widget gallery is using Bootstrap 3.
926-
<a href="http://getbootstrap.com/">Bootstrap documentation</a>
920+
<p>
921+
This theme is implemented by the ${doc-link WBootstrapTheme}
922+
class, and relies on <a
923+
href="http://getbootstrap.com/">Twitter's Bootstrap CSS
924+
framework</a>. Use <tt>setTheme(new WBootstrapTheme())</tt>
925+
to use this theme.
926+
</p>
927+
<p>
928+
As of version 3.3.2, Bootstrap 2 and Bootstrap 3 versions
929+
are supported. The widget gallery has been restyled to use
930+
Bootstrap 3. While the theme makes sure that Wt's widgets
931+
are rendered with the markup expected by bootstrap, there
932+
are many features that are particular to the layout system
933+
of bootstrap (and chaned from version 2 to version
934+
3). Thus you need to know how bootstrap expects you to
935+
layout widgets in order to effectivily use this theme, for
936+
which we refer to the <a
937+
href="http://getbootstrap.com/">Bootstrap
938+
documentation</a>.
939+
</p>
927940
</dd>
928941
</dl>
929942
</p>

examples/widgetgallery/examples/CalendarSimple.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ out->addStyleClass("help-block");
1313
c1->selectionChanged().connect(std::bind([=] () {
1414
std::set<Wt::WDate> selection = c1->selection();
1515
if (selection.size() != 0) {
16-
Wt::WDate d = *selection.begin();
16+
Wt::WDate d;
17+
d = (*selection.begin());
1718
Wt::WDate toDate(d.year() + 1, 1, 1);
1819
int days = d.daysTo(toDate);
1920
out->setText(Wt::WString("<p>That's {1} days until New Year's Day!</p>")

examples/widgetgallery/examples/CategoryCharts3D.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
#include <Wt/WApplication>
12
#include <Wt/WContainerWidget>
23
#include <Wt/WStandardItemModel>
34
#include <Wt/WCssDecorationStyle>
45
#include <Wt/WBorder>
6+
#include <Wt/WImage>
57
#include <Wt/Chart/WCartesian3DChart>
68
#include <Wt/Chart/WGridData>
79

@@ -44,6 +46,6 @@ isotopes->setType(Wt::Chart::BarSeries3D);
4446
// add the dataseries to the chart
4547
chart->addDataSeries(isotopes);
4648

47-
chart->setAlternativeContent(new Wt::WImage("pics/categoricalChartScreenshot.png", container));
49+
chart->setAlternativeContent(new Wt::WImage(Wt::WLink("pics/categoricalChartScreenshot.png"), container));
4850

4951
SAMPLE_END(return container)

examples/widgetgallery/examples/NumericalCharts3D.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <Wt/WCssDecorationStyle>
44
#include <Wt/WBorder>
55
#include <Wt/WContainerWidget>
6+
#include <Wt/WImage>
67
#include <Wt/Chart/WCartesian3DChart>
78
#include <Wt/Chart/WGridData>
89
#include <Wt/Chart/WEquidistantGridData>
@@ -70,6 +71,6 @@ chart->addDataSeries(dataset1);
7071
chart->addDataSeries(dataset2);
7172
chart->addDataSeries(dataset3);
7273

73-
chart->setAlternativeContent(new Wt::WImage("pics/numericalChartScreenshot.png", container));
74+
chart->setAlternativeContent(new Wt::WImage(Wt::WLink("pics/numericalChartScreenshot.png"), container));
7475

7576
SAMPLE_END(return container)

examples/widgetgallery/examples/PieChart.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@ table->setModel(model);
5353
table->setColumnWidth(1, 100);
5454
table->setRowHeight(28);
5555
table->setHeaderHeight(28);
56+
table->setWidth(150 + 100 + 14 + 2);
5657

57-
if (Wt::WApplication::instance()->environment().ajax()) {
58-
table->resize(150 + 100 + 14, 7 * 28);
58+
if (Wt::WApplication::instance()->environment().ajax())
5959
table->setEditTriggers(Wt::WAbstractItemView::SingleClicked);
60-
} else {
61-
table->resize(150 + 100 + 14, Wt::WLength::Auto);
60+
else
6261
table->setEditTriggers(Wt::WAbstractItemView::NoEditTrigger);
63-
}
6462

6563
/*
6664
* Create the pie chart.

examples/widgetgallery/examples/ScatterPlotData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ table->setColumnAlignment(0, Wt::AlignCenter);
4242
table->setHeaderAlignment(0, Wt::AlignCenter);
4343
table->setRowHeight(28);
4444
table->setHeaderHeight(28);
45-
table->resize(800, 200);
4645
table->setColumnWidth(0, 80);
4746
for (int column = 1; column < model->columnCount(); ++column)
4847
table->setColumnWidth(column, 90);
48+
table->resize(780, 200);
4949

5050
/*
5151
* Use a delegate for the numeric data which rounds values sensibly.

examples/widgetgallery/main.C

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,23 @@ Wt::WApplication *createApplication(const Wt::WEnvironment& env)
2424
<< "!!!!!!!!!!" << std::endl;
2525
}
2626

27+
// Choice of theme: defaults to bootstrap3 but can be overridden using
28+
// a theme parameter (for testing)
2729
const std::string *themePtr = env.getParameter("theme");
2830
std::string theme;
2931
if (!themePtr)
3032
theme = "bootstrap3";
3133
else
3234
theme = *themePtr;
3335

34-
if (theme == "bootstrap3"){
36+
if (theme == "bootstrap3") {
3537
Wt::WBootstrapTheme *bootstrapTheme = new Wt::WBootstrapTheme(app);
3638
bootstrapTheme->setVersion(Wt::WBootstrapTheme::Version3);
3739
app->setTheme(bootstrapTheme);
38-
} else if (theme == "bootstrap2"){
40+
41+
// load the default bootstrap3 (sub-)theme
42+
app->useStyleSheet("resources/themes/bootstrap/3/bootstrap-theme.min.css");
43+
} else if (theme == "bootstrap2") {
3944
Wt::WBootstrapTheme *bootstrapTheme = new Wt::WBootstrapTheme(app);
4045
app->setTheme(bootstrapTheme);
4146
} else

examples/wt-homepage/Home.C

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -419,16 +419,7 @@ WString Home::tr(const char *key)
419419

420420
void Home::googleAnalyticsLogger()
421421
{
422-
std::string googleCmd =
423-
"if (window.pageTracker) {"
424-
"""try {"
425-
"" "setTimeout(function() {"
426-
"" "window.pageTracker._trackPageview(\""
427-
+ environment().deploymentPath() + internalPath() + "\");"
428-
"" "}, 1000);"
429-
"""} catch (e) { }"
430-
"}";
431-
432-
doJavaScript(googleCmd);
422+
doJavaScript("ga('send','pageview','"
423+
+ environment().deploymentPath() + internalPath() + "');");
433424
}
434425

0 commit comments

Comments
 (0)