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);
HangmanGame(Wt::WContainerWidget *parent=0)
Wt::WAnchor * backToGameAnchor_
std::string userName() const
Wt::Auth::AbstractUserDatabase & users()
Wt::WStackedWidget * mainStack_
static const Wt::Auth::AuthService & auth()
static const std::vector< const Wt::Auth::OAuthService * > & oAuth()
Wt::Auth::Login & login()
Wt::WAnchor * scoresAnchor_
Wt::WContainerWidget * links_
HighScoresWidget * scores_
static const Wt::Auth::AbstractPasswordService & passwordAuth()
void handleInternalPath(const std::string &internalPath)