Add interface class to represent player interface. Have simple hide/show animation between. Put up more interface elements on login interface to show inteded ui.

This commit is contained in:
Kevin Whitaker
2017-01-28 16:51:14 -05:00
parent 93e095d46e
commit 22f1b90238
7 changed files with 115 additions and 5 deletions

View File

@@ -18,12 +18,33 @@
*/
#include "LoginInterface.h"
#include <Wt/WText>
LoginInterface::LoginInterface(WebInterface* app)
{
this->app = app;
loginContainer = new Wt::WContainerWidget();
loginLayout = new Wt::WVBoxLayout();
loginContainer->setLayout(loginLayout);
usernameArea = new Wt::WHBoxLayout();
passwordArea = new Wt::WHBoxLayout();
usernameContainer = new Wt::WContainerWidget();
passwordContainer = new Wt::WContainerWidget();
usernameContainer->setLayout(usernameArea);
passwordContainer->setLayout(passwordArea);
usernameField = new Wt::WLineEdit();
passwordField = new Wt::WLineEdit();
passwordField->setEchoMode(Wt::WLineEdit::EchoMode::Password);
usernameArea->addWidget(new Wt::WText("Username:"));
usernameArea->addWidget(usernameField);
passwordArea->addWidget(new Wt::WText("Password:"));
passwordArea->addWidget(passwordField);
loginLayout->addWidget(new Wt::WText("Please Login to access."));
loginLayout->addWidget(usernameContainer);
loginLayout->addWidget(passwordContainer);
loginButton = new Wt::WPushButton("Login");
loginButton->clicked().connect(app, &WebInterface::loginCompleted);
setContentAlignment(Wt::AlignmentFlag::AlignCenter);
addChild(loginButton);
loginLayout->addWidget(loginButton);
addChild(loginContainer);
loginContainer->setWidth(Wt::WLength(50, Wt::WLength::Percentage));
}