A popup chat widget.
More...
#include <PopupChatWidget.h>
A popup chat widget.
Definition at line 20 of file PopupChatWidget.h.
◆ PopupChatWidget()
Definition at line 19 of file PopupChatWidget.C.
23{
25
28 == Wt::UserAgent::IE6)
30 else
32 }
33
36 "{"
37 """let s = " WT_CLASS ".$('" +
id +
"');"
38 """s.classList.toggle('chat-maximized');"
39 """s.classList.toggle('chat-minimized');"
40 "}");
41
45
49
51}
Wt::Auth::Dbo::UserDatabase< AuthInfo > UserDatabase
◆ createBar()
std::unique_ptr< Wt::WContainerWidget > PopupChatWidget::createBar |
( |
| ) |
|
|
private |
Definition at line 69 of file PopupChatWidget.C.
70{
71 auto bar(std::make_unique<Wt::WContainerWidget>());
72 bar->setStyleClass(
"chat-bar");
73
79
81
82 title_ =
bar->addWidget(std::make_unique<Wt::WText>());
83
85
87}
◆ createLayout()
void PopupChatWidget::createLayout |
( |
std::unique_ptr< WWidget > |
messages, |
|
|
std::unique_ptr< WWidget > |
userList, |
|
|
std::unique_ptr< WWidget > |
messageEdit, |
|
|
std::unique_ptr< WWidget > |
sendButton, |
|
|
std::unique_ptr< WWidget > |
logoutButton |
|
) |
| |
|
protectedvirtual |
Definition at line 118 of file PopupChatWidget.C.
123{
124 auto layout(std::make_unique<Wt::WVBoxLayout>());
125 layout->setContentsMargins(0, 0, 0, 0);
127
129 bar->setMinimumSize(Wt::WLength::Auto, 20);
132
134}
◆ goOnline()
void PopupChatWidget::goOnline |
( |
| ) |
|
|
private |
Definition at line 94 of file PopupChatWidget.C.
95{
98
100 Wt::WString name =
name_;
101 if (name.empty())
103
107 else
109 }
110
112 }
113
115 bar_->removeStyleClass(
"alert");
116}
Wt::WString suggestGuest()
Get a suggestion for a guest user name.
◆ minimized()
bool PopupChatWidget::minimized |
( |
| ) |
const |
|
private |
◆ newMessage()
void PopupChatWidget::newMessage |
( |
| ) |
|
|
protectedvirtual |
◆ setName()
void PopupChatWidget::setName |
( |
const Wt::WString & |
name | ) |
|
Definition at line 53 of file PopupChatWidget.C.
54{
55 if (name.empty())
56 return;
57
62 n = name + std::to_string(++
tries);
63
65 } else
67}
◆ toggleSize()
void PopupChatWidget::toggleSize |
( |
| ) |
|
|
private |
◆ updateUsers()
void PopupChatWidget::updateUsers |
( |
| ) |
|
|
protectedvirtual |
Reimplemented from SimpleChatWidget.
Definition at line 136 of file PopupChatWidget.C.
137{
139
141
144 title_->setText(
"Thoughts? Ventilate.");
146 title_->setText(
"Chat: 1 user online");
147 else
148 title_->setText(Wt::WString(
"Chat: {1} users online").
arg(
count));
149 } else {
150 title_->setText(Wt::WString(
"Chat: <span class=\"self\">{1}</span>"
151 " <span class=\"online\">({2} user{3})</span>")
153 }
154}
UserSet users()
Get the users currently logged in.
◆ bar_
Wt::WWidget* PopupChatWidget::bar_ |
|
private |
◆ minimized_
bool PopupChatWidget::minimized_ |
|
private |
◆ missedMessages_
int PopupChatWidget::missedMessages_ |
|
private |
◆ name_
Wt::WString PopupChatWidget::name_ |
|
private |
◆ online_
bool PopupChatWidget::online_ |
|
private |
◆ title_
Wt::WText* PopupChatWidget::title_ |
|
private |
The documentation for this class was generated from the following files: