login flow

This commit is contained in:
Michele Scandura 2020-11-10 12:14:21 +00:00
parent 886d2a88b0
commit 194f3cbffa
22 changed files with 642 additions and 141 deletions

View file

@ -0,0 +1,153 @@
/* Generated by MyraPad at 10/11/2020 11:32:04 */
using Myra.Graphics2D;
using Myra.Graphics2D.TextureAtlases;
using Myra.Graphics2D.UI;
using Myra.Graphics2D.Brushes;
#if !STRIDE
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
#else
using Stride.Core.Mathematics;
#endif
namespace Sledgemapper.UI
{
partial class LoginRegisterWindow: VerticalStackPanel
{
private void BuildUI()
{
RdoLogin = new RadioButton();
RdoLogin.Text = " Login";
RdoLogin.Id = "RdoLogin";
RdoRegister = new RadioButton();
RdoRegister.Text = " Register";
RdoRegister.Id = "RdoRegister";
var horizontalStackPanel1 = new HorizontalStackPanel();
horizontalStackPanel1.Spacing = 18;
horizontalStackPanel1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
horizontalStackPanel1.Widgets.Add(RdoLogin);
horizontalStackPanel1.Widgets.Add(RdoRegister);
var label1 = new Label();
label1.Text = "Email";
var label2 = new Label();
label2.Text = "Password";
label2.GridRow = 1;
TxtEmail = new TextBox();
TxtEmail.GridColumn = 1;
TxtEmail.Id = "TxtEmail";
TxtPassword = new TextBox();
TxtPassword.PasswordField = true;
TxtPassword.GridColumn = 1;
TxtPassword.GridRow = 1;
TxtPassword.Id = "TxtPassword";
LblFirstname = new Label();
LblFirstname.Text = "First name";
LblFirstname.GridRow = 2;
LblFirstname.Visible = false;
LblFirstname.Id = "LblFirstname";
LblLastname = new Label();
LblLastname.Text = "Last name";
LblLastname.GridRow = 3;
LblLastname.Visible = false;
LblLastname.Id = "LblLastname";
LblInitials = new Label();
LblInitials.Text = "Initials";
LblInitials.GridRow = 4;
LblInitials.Visible = false;
LblInitials.Id = "LblInitials";
TxtFirstname = new TextBox();
TxtFirstname.GridColumn = 1;
TxtFirstname.GridRow = 2;
TxtFirstname.Visible = false;
TxtFirstname.Id = "TxtFirstname";
TxtLastname = new TextBox();
TxtLastname.GridColumn = 1;
TxtLastname.GridRow = 3;
TxtLastname.Visible = false;
TxtLastname.Id = "TxtLastname";
TxtInitials = new TextBox();
TxtInitials.GridColumn = 1;
TxtInitials.GridRow = 4;
TxtInitials.Visible = false;
TxtInitials.Id = "TxtInitials";
var grid1 = new Grid();
grid1.ColumnSpacing = 25;
grid1.RowSpacing = 10;
grid1.ColumnsProportions.Add(new Proportion
{
Type = Myra.Graphics2D.UI.ProportionType.Pixels,
Value = 80,
});
grid1.ColumnsProportions.Add(new Proportion
{
Type = Myra.Graphics2D.UI.ProportionType.Fill,
});
grid1.Widgets.Add(label1);
grid1.Widgets.Add(label2);
grid1.Widgets.Add(TxtEmail);
grid1.Widgets.Add(TxtPassword);
grid1.Widgets.Add(LblFirstname);
grid1.Widgets.Add(LblLastname);
grid1.Widgets.Add(LblInitials);
grid1.Widgets.Add(TxtFirstname);
grid1.Widgets.Add(TxtLastname);
grid1.Widgets.Add(TxtInitials);
BtnLogin = new TextButton();
BtnLogin.Text = "Login";
BtnLogin.Width = 70;
BtnLogin.Height = 20;
BtnLogin.Padding = new Thickness(5);
BtnLogin.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
BtnLogin.Id = "BtnLogin";
BtnRegister = new TextButton();
BtnRegister.Text = "Register";
BtnRegister.Visible = false;
BtnRegister.Width = 70;
BtnRegister.Height = 20;
BtnRegister.Padding = new Thickness(5);
BtnRegister.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
BtnRegister.Id = "BtnRegister";
Spacing = 16;
HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center;
Width = 400;
Padding = new Thickness(10);
Widgets.Add(horizontalStackPanel1);
Widgets.Add(grid1);
Widgets.Add(BtnLogin);
Widgets.Add(BtnRegister);
}
public RadioButton RdoLogin;
public RadioButton RdoRegister;
public TextBox TxtEmail;
public TextBox TxtPassword;
public Label LblFirstname;
public Label LblLastname;
public Label LblInitials;
public TextBox TxtFirstname;
public TextBox TxtLastname;
public TextBox TxtInitials;
public TextButton BtnLogin;
public TextButton BtnRegister;
}
}

View file

@ -0,0 +1,11 @@
/* Generated by MyraPad at 09/11/2020 23:54:08 */
namespace Sledgemapper.UI
{
public partial class LoginRegisterWindow
{
public LoginRegisterWindow()
{
BuildUI();
}
}
}

View file

@ -0,0 +1,62 @@
/* Generated by MyraPad at 10/11/2020 10:59:36 */
using Myra.Graphics2D;
using Myra.Graphics2D.TextureAtlases;
using Myra.Graphics2D.UI;
using Myra.Graphics2D.Brushes;
#if !STRIDE
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
#else
using Stride.Core.Mathematics;
#endif
namespace Sledgemapper.UI
{
partial class SessionWindow: VerticalStackPanel
{
private void BuildUI()
{
var label1 = new Label();
label1.Text = "Session";
TxtSession = new TextBox();
TxtSession.GridColumn = 1;
TxtSession.Id = "TxtSession";
var grid1 = new Grid();
grid1.ColumnSpacing = 25;
grid1.RowSpacing = 10;
grid1.ColumnsProportions.Add(new Proportion
{
Type = Myra.Graphics2D.UI.ProportionType.Pixels,
Value = 60,
});
grid1.ColumnsProportions.Add(new Proportion
{
Type = Myra.Graphics2D.UI.ProportionType.Fill,
});
grid1.Widgets.Add(label1);
grid1.Widgets.Add(TxtSession);
BtnLogin = new TextButton();
BtnLogin.Text = "Join";
BtnLogin.Padding = new Thickness(10, 5);
BtnLogin.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
BtnLogin.Id = "BtnLogin";
Spacing = 16;
HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center;
Width = 300;
Padding = new Thickness(10);
Widgets.Add(grid1);
Widgets.Add(BtnLogin);
}
public TextBox TxtSession;
public TextButton BtnLogin;
}
}

View file

@ -0,0 +1,11 @@
/* Generated by MyraPad at 10/11/2020 10:59:36 */
namespace Sledgemapper.UI
{
public partial class SessionWindow
{
public SessionWindow()
{
BuildUI();
}
}
}

View file

@ -0,0 +1,27 @@
<Project>
<Project.ExportOptions Namespace="Sledgemapper.UI" Class="LoginRegisterWindow" OutputPath="C:\dev\Map\Sledgemapper\UI" />
<VerticalStackPanel Spacing="16" HorizontalAlignment="Center" VerticalAlignment="Center" Width="400" Padding="10">
<HorizontalStackPanel Spacing="18" HorizontalAlignment="Center">
<RadioButton Text=" Login" Id="RdoLogin" />
<RadioButton Text=" Register" Id="RdoRegister" />
</HorizontalStackPanel>
<Grid ColumnSpacing="25" RowSpacing="10">
<Grid.ColumnsProportions>
<Proportion Type="Pixels" Value="80" />
<Proportion Type="Fill" />
</Grid.ColumnsProportions>
<Label Text="Email" />
<Label Text="Password" GridRow="1" />
<TextBox GridColumn="1" Id="TxtEmail" />
<TextBox PasswordField="True" GridColumn="1" GridRow="1" Id="TxtPassword" />
<Label Text="First name" GridRow="2" Visible="False" Id="LblFirstname" />
<Label Text="Last name" GridRow="3" Visible="False" Id="LblLastname" />
<Label Text="Initials" GridRow="4" Visible="False" Id="LblInitials" />
<TextBox GridColumn="1" GridRow="2" Visible="False" Id="TxtFirstname" />
<TextBox GridColumn="1" GridRow="3" Visible="False" Id="TxtLastname" />
<TextBox GridColumn="1" GridRow="4" Visible="False" Id="TxtInitials" />
</Grid>
<TextButton Text="Login" Width="70" Height="20" Padding="5" HorizontalAlignment="Center" Id="BtnLogin" />
<TextButton Text="Register" Width="70" Height="20" Padding="5" HorizontalAlignment="Center" Id="BtnRegister" Visible="False"/>
</VerticalStackPanel>
</Project>

View file

@ -0,0 +1,17 @@
<Project>
<Project.ExportOptions Namespace="Sledgemapper.UI" Class="SessionWindow" OutputPath="C:\dev\Map\Sledgemapper\UI" />
<VerticalStackPanel Spacing="16" HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" Padding="10">
<Grid ColumnSpacing="25" RowSpacing="10">
<Grid.ColumnsProportions>
<Proportion Type="Pixels" Value="60" />
<Proportion Type="Fill" />
</Grid.ColumnsProportions>
<Label Text="Session" />
<TextBox GridColumn="1" Id="TxtSession" />
</Grid>
<TextButton Text="Join" Padding="10, 5" HorizontalAlignment="Center" Id="BtnLogin" />
</VerticalStackPanel>
</Project>