A chat demo application.
More...
A chat demo application.
Definition at line 25 of file simpleChat.C.
◆ ChatApplication()
ChatApplication::ChatApplication |
( |
const Wt::WEnvironment & | env, |
|
|
SimpleChatServer & | server ) |
Create a new instance.
Definition at line 45 of file simpleChat.C.
47 : WApplication(env),
50{
51 setTitle("Wt Chat");
52 useStyleSheet("chatapp.css");
53
54 messageResourceBundle().use(appRoot() + "simplechat");
55
57
58 root()->addWidget(std::make_unique<Wt::WText>(Wt::WString::tr("introduction")));
59
60 SimpleChatWidget *chatWidget =
61 root()->addWidget(std::make_unique<SimpleChatWidget>(
server_));
62 chatWidget->setStyleClass("chat");
63
64 root()->addWidget(std::make_unique<Wt::WText>(Wt::WString::tr("details")));
65
66 Wt::WPushButton *b =
67 root()->addWidget(std::make_unique<Wt::WPushButton>("I'm schizophrenic ..."));
68 b->clicked().
connect(b, &Wt::WPushButton::hide);
70}
void addChatWidget()
Add another chat client.
SimpleChatServer & server_
const Wt::WEnvironment & env_
◆ addChatWidget()
void ChatApplication::addChatWidget |
( |
| ) |
|
|
private |
Add another chat client.
Definition at line 90 of file simpleChat.C.
91{
92 SimpleChatWidget *chatWidget2 =
93 root()->addWidget(std::make_unique<SimpleChatWidget>(
server_));
94 chatWidget2->setStyleClass("chat");
95}
◆ emptyFunc()
void ChatApplication::emptyFunc |
( |
| ) |
|
|
private |
◆ javaScriptTest()
void ChatApplication::javaScriptTest |
( |
| ) |
|
|
private |
Definition at line 72 of file simpleChat.C.
73{
74 if(!
env_.javaScript()){
76 root()->addWidget(std::make_unique<Wt::WText>(Wt::WString::tr("serverpushwarning")));
77
78
79
80 timer_ = std::make_unique<Wt::WTimer>();
81 timer_->setInterval(std::chrono::milliseconds{5000});
84 }
85}
Wt::WText * javaScriptError_
std::unique_ptr< Wt::WTimer > timer_
◆ env_
const Wt::WEnvironment& ChatApplication::env_ |
|
private |
◆ javaScriptError_
Wt::WText* ChatApplication::javaScriptError_ |
|
private |
◆ server_
◆ timer_
std::unique_ptr<Wt::WTimer> ChatApplication::timer_ |
|
private |
The documentation for this class was generated from the following file: