Skip to content

Commit 94e5da5

Browse files
author
Koen Deforche
committed
see Changelog
1 parent 68aeb0d commit 94e5da5

File tree

5 files changed

+29
-17
lines changed

5 files changed

+29
-17
lines changed

Changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313

1414
* WDatePicker.C: implement setEnabled()
1515

16+
* WT_SERIES, WT_MAJOR, WT_MINOR, WT_VERSION: change to hexadecimal
17+
format for preprocessor defines
18+
19+
* Ext/TableView.C: fix access to null dataStore_
20+
1621
26-03-2009:
1722
* Fixed cookie handling. Cookie parser is now less strict, and cookie
1823
values are URL encoded, similar to PHP. Fixed setting multiple

WConfig.h.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#define WCONFIG_H
33

44
// Version defines
5-
#define WT_SERIES ${VERSION_SERIES}
6-
#define WT_MAJOR ${VERSION_MAJOR}
7-
#define WT_MINOR ${VERSION_MINOR}
5+
#define WT_SERIES 0x${VERSION_SERIES}
6+
#define WT_MAJOR 0x${VERSION_MAJOR}
7+
#define WT_MINOR 0x${VERSION_MINOR}
88

99
/*! \brief A constant that encodes the library version of %Wt
1010
*

examples/simplechat/simplechat.xml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
<h2><span>Wt Chat client</span></h2>
66

7-
<p>This is a simple multi-user chat client and server.</p>
7+
<p>This is a multi-user chat client and server.</p>
88

9-
<p>For simplicity, server and client all run in the same process, and
10-
therefore it is ideal for a deployment using wthttpd, when running all
11-
clients in the same process. (Because all I/O is asynchroneous, this
12-
probably could easily support thousands of simultaneous users as
13-
well).</p>
9+
<p>To keep the example simple, server and clients all run in the same
10+
process. Still, because all I/O in Wt is asynchronous even when using
11+
"server push" which requires an open connection with each client at
12+
all times, clients do not tie up threads, and as such the application
13+
could easily support thousands of simultaneous users as well.</p>
1414

1515
<p>The client is contained in a widget (SimpleChatWidget), and can be
1616
instantiated as many times as you like, even in the same
17-
application. <br />
17+
application.<br />
1818

1919
Because of the widget abstraction, it is straight forward to include a
2020
chat client in your own application, by linking both the client and
@@ -24,10 +24,11 @@ server classes into your application.</p>
2424
<message id="details">
2525

2626
<p>The implementation uses server-initiated updates, a feature that is
27-
still under development in Wt. When a message is received, the user
28-
interface (i.e. widget tree) not only of the current session, but also
29-
of all other clients is updated simultaneously, as part of handling
30-
the event.</p>
27+
not much different from regular client-server communication in Wt, and
28+
allows updating a session from outside its regular event loop. When a
29+
message is received, the user interface (i.e. widget tree) not only of
30+
the current session, but also of all other sessions is updated and
31+
"pushed" to these clients simultanously.</p>
3132

3233
</message>
3334

src/Wt/Ext/NumberField.C

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*
44
* See the LICENSE file for terms of use.
55
*/
6+
#include <iomanip>
67
#include <boost/lexical_cast.hpp>
78

89
#include "Wt/Ext/NumberField"
@@ -20,15 +21,19 @@ NumberField::NumberField(WContainerWidget *parent)
2021

2122
void NumberField::setValue(double value)
2223
{
23-
lineEdit()->setText(boost::lexical_cast<std::string>(value));
24+
std::ostringstream oss;
25+
oss << std::fixed << std::setprecision(decimals_) << value;
26+
lineEdit()->setText(oss.str());
2427
}
2528

2629
double NumberField::value() const
2730
{
2831
try {
2932
return boost::lexical_cast<double>(lineEdit()->text());
3033
} catch (boost::bad_lexical_cast& e) {
31-
return 0; // FIXME ?
34+
// You wouldn't expect this to happen anless a user is tampering
35+
// 0 with do in that case
36+
return 0;
3237
}
3338
}
3439

src/Wt/Ext/TableView.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ void TableView::refresh()
409409

410410
void TableView::updateExt()
411411
{
412-
addUpdateJS(dataStore_->jsGetUpdates(elVar() + ".getStore()"));
412+
if (dataStore_)
413+
addUpdateJS(dataStore_->jsGetUpdates(elVar() + ".getStore()"));
413414

414415
Panel::updateExt();
415416
}

0 commit comments

Comments
 (0)