9 #include <Wt/WStackedWidget>
10 #include <Wt/WVBoxLayout>
11 #include <Wt/WHBoxLayout>
12 #include <Wt/WApplication>
13 #include <Wt/Auth/AuthWidget>
22 WContainerWidget(parent),
28 Auth::AuthModel *authModel =
new Auth::AuthModel(
Session::auth(),
33 Auth::AuthWidget *authWidget =
new Auth::AuthWidget(
session_.
login());
34 authWidget->setModel(authModel);
35 authWidget->setRegistrationEnabled(
true);
37 WText *title =
new WText(
"<h1>A Witty game: Hangman</h1>");
40 addWidget(authWidget);
46 links_ =
new WContainerWidget();
47 links_->setStyleClass(
"links");
55 scoresAnchor_->setLink(WLink(WLink::InternalPath,
"/highscores"));
57 WApplication::instance()->internalPathChanged()
60 authWidget->processEnvironment();
79 if (internalPath ==
"/play")
81 else if (internalPath ==
"/highscores")
84 WApplication::instance()->setInternalPath(
"/play",
true);
void handleInternalPath(const std::string &internalPath)
HangmanGame(Wt::WContainerWidget *parent=0)
Wt::WAnchor * scoresAnchor_
HighScoresWidget * scores_
Wt::WStackedWidget * mainStack_
Wt::WAnchor * backToGameAnchor_
Wt::WContainerWidget * links_
static const Wt::Auth::AbstractPasswordService & passwordAuth()
static const std::vector< const Wt::Auth::OAuthService * > & oAuth()
std::string userName() const
static const Wt::Auth::AuthService & auth()
Wt::Auth::Login & login()
Wt::Auth::AbstractUserDatabase & users()