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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user