7 #include <Wt/WApplication.h> 8 #include <Wt/WEnvironment.h> 11 #include <Wt/WVBoxLayout.h> 20 const std::string&
id)
37 """var s = $('#" +
id +
"');" 38 """s.toggleClass('chat-maximized chat-minimized');" 61 n = name + std::to_string(++tries);
70 auto bar(Wt::cpp14::make_unique<Wt::WContainerWidget>());
71 bar->setStyleClass(
"chat-bar");
73 auto toggleButton(Wt::cpp14::make_unique<Wt::WText>());
74 toggleButton->setInline(
false);
75 toggleButton->setStyleClass(
"chat-minmax");
79 bar->addWidget(std::move(toggleButton));
81 title_ = bar->addWidget(Wt::cpp14::make_unique<Wt::WText>());
107 name =
name_ + std::to_string(++tries);
118 std::unique_ptr<Wt::WWidget> userList,
119 std::unique_ptr<Wt::WWidget> messageEdit,
120 std::unique_ptr<Wt::WWidget> sendButton,
121 std::unique_ptr<Wt::WWidget> logoutButton)
123 auto layout(Wt::cpp14::make_unique<Wt::WVBoxLayout>());
150 " <span class=\"online\">({2} user{3})</span>")
151 .arg(
userName()).arg(count).arg(count == 1 ?
"" :
"s"));
UserSet users()
Get the users currently logged in.
bool changeName(const Wt::WString &user, const Wt::WString &newUser)
Changes the name.
bool setText(const WString &text)
Wt::WString suggestGuest()
Get a suggestion for a guest user name.
void setContentsMargins(int left, int top, int right, int bottom)
WStatelessSlot * implementJavaScript(void(T::*method)(), const std::string &jsCode)
static WApplication * instance()
void addWidget(std::unique_ptr< WWidget > widget)