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));
|
||||
}
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
|
||||
#include <Wt/WContainerWidget>
|
||||
#include <Wt/WPushButton>
|
||||
#include <Wt/WVBoxLayout>
|
||||
#include <Wt/WHBoxLayout>
|
||||
#include <Wt/WLineEdit>
|
||||
#include <Wt/WText>
|
||||
#include "../WebInterface.h"
|
||||
|
||||
class LoginInterface : public Wt::WContainerWidget
|
||||
@@ -30,6 +34,15 @@ public:
|
||||
LoginInterface(WebInterface* app);
|
||||
private:
|
||||
Wt::WPushButton* loginButton;
|
||||
Wt::WVBoxLayout* loginLayout;
|
||||
Wt::WContainerWidget* loginContainer;
|
||||
Wt::WHBoxLayout* usernameArea;
|
||||
Wt::WContainerWidget* usernameContainer;
|
||||
Wt::WHBoxLayout* passwordArea;
|
||||
Wt::WContainerWidget* passwordContainer;
|
||||
Wt::WLineEdit* usernameField;
|
||||
Wt::WLineEdit* passwordField;
|
||||
WebInterface* app;
|
||||
};
|
||||
|
||||
#endif // LOGININTERFACE_H
|
||||
|
||||
27
src/ui/PlayerInterface.cpp
Normal file
27
src/ui/PlayerInterface.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Kevin Whitaker <eyecreate@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "PlayerInterface.h"
|
||||
#include <Wt/WText>
|
||||
|
||||
PlayerInterface::PlayerInterface(WebInterface* app)
|
||||
{
|
||||
this->app = app;
|
||||
addChild(new Wt::WText("You did it."));
|
||||
}
|
||||
33
src/ui/PlayerInterface.h
Normal file
33
src/ui/PlayerInterface.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Kevin Whitaker <eyecreate@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PLAYERINTERFACE_H
|
||||
#define PLAYERINTERFACE_H
|
||||
|
||||
#include <Wt/WContainerWidget>
|
||||
#include "../WebInterface.h"
|
||||
|
||||
class PlayerInterface : public Wt::WContainerWidget
|
||||
{
|
||||
public:
|
||||
PlayerInterface(WebInterface* app);
|
||||
WebInterface* app;
|
||||
};
|
||||
|
||||
#endif // PLAYERINTERFACE_H
|
||||
Reference in New Issue
Block a user