Sub BuildLoginSheet(AppPage As ABMPage) As ABMModalSheet
Dim myModal As ABMModalSheet
myModal.Initialize(AppPage, "login", False, False, "loginform")
myModal.IsDismissible = False
' create the grid for the content
myModal.Content.AddRowsM(1, True, 20,0, "").AddCellsOSMP(1,0,0, 0,6,6,6, 0, 0,0, 0,"").AddCellsOSMP(1,0,0, 0,6,6,6, 10, 0,0, 0,"") ' AddCells12(1, "") cnter
myModal.Content.AddRowsM(1,True,20,0, "").AddCells12(1,"")
myModal.Content.AddRowsM(2, True, 10,20, "").AddCellsOSMP(1,0,0, 0,6,6,6, 0, 0,0, 0,"").AddCellsOSMP(1,0,0, 0,6,6,6, 0, 0,0, 0,"") ' AddCells12(1, "") cnter
myModal.Content.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
Dim logo As ABMImage
logo.Initialize(AppPage,"imglogo", "../images/mmslogo.png", 1.0)
Log(" loading logo image")
logo.SetFixedSize(200,70 )
logo.IsResponsive = True
myModal.Content.Cell(1,1).AddComponent(logo)
myModal.Content.Cell(1,1).UseTheme("loginform")
' Dim loglbl1 As ABMLabel
' loglbl1.Initialize(AppPage, "loglbl1", "M M S", ABM.SIZE_H5, False, "")
' loglbl1.IsFlowText = True
' myModal.Content.Cell(1,1).AddComponent(loglbl1)
' myModal.Content.Cell(1,1).UseTheme("loginform")
Dim loglbl As ABMLabel
loglbl.Initialize(AppPage, "loglbl", "{B}"&"Please Login"&"{/B}", ABM.SIZE_H5, False, "")
loglbl.IsFlowText = True
myModal.Content.Cell(1,2).AddComponent(loglbl)
myModal.Content.Cell(1,2).UseTheme("loginform")
' Dim inp1 As ABMInput
' inp1.Initialize(AppPage, "logininp1", ABM.INPUT_TEXT, "User Name", False, "")
' myModal.Content.Cell(2,1).AddComponent(inp1)
'
' Dim inp2 As ABMInput
' inp2.Initialize(AppPage, "logininp2", ABM.INPUT_PASSWORD , "Password", False, "")
' myModal.Content.Cell(2,1).AddComponent(inp2)
Dim msbtn1 As ABMButton
msbtn1.InitializeFlat(AppPage, "loginbtn", "mdi-action-verified-user", ABM.ICONALIGN_CENTER, "Login", "btngreen")
msbtn1.SetBorderEx(ABM.COLOR_TRANSPARENT,ABM.INTENSITY_LIGHTEN1,1,ABM.BORDER_GROOVE,"10px")
myModal.Content.Cell(3,1).AddComponent(msbtn1)
myModal.Content.Cell(3,1).UseTheme("loginform")
Dim msbtn2 As ABMButton
msbtn2.InitializeFlat(AppPage, "logincancelbtn", "mdi-content-clear", ABM.ICONALIGN_CENTER, "Cancel", "btnred")
msbtn2.SetBorderEx(ABM.COLOR_TRANSPARENT,ABM.INTENSITY_LIGHTEN1,1,ABM.BORDER_GROOVE,"10px")
myModal.Content.Cell(3,2).AddComponent(msbtn2)
myModal.Content.Cell(3,2).UseTheme("loginform")
myModal.Content.SetBorderex(ABM.COLOR_BLACK, ABM.INTENSITY_DARKEN2, 4, ABM.BORDER_GROOVE, "25px")
' myModal.Footer.Cell(1,1).AddComponent(msbtn2)
Return myModal
End Sub
public Sub ShowLogin(page As ABMPage)
Dim mymodal As ABMModalSheet = page.ModalSheet("login")
' mymodal.Content.Cell(2,1).RemoveAllComponents
' mymodal.Content.Cell(1,1).RemoveAllComponents
Dim logo As ABMImage
logo.Initialize(page,"imglogo", "../images/mmslogo.png", 1.0)
Log(" loading logo image")
If page.IsPhone Or page.IsTablet Then
' If ABMShared.IsPhone(page) Then
logo.SetFixedSize( 120,50 )
Else
logo.SetFixedSize(200,70 )
End If
logo.IsResponsive = True
mymodal.Content.Cell(1,1).AddComponent(logo)
mymodal.Content.Cell(1,1).UseTheme("loginform")
Dim inp1 As ABMInput
inp1.Initialize(page, "logininp1", ABM.INPUT_TEXT, "User Name", False, "lightblue")
mymodal.Content.Cell(2,1).AddComponent(inp1)
Dim inp2 As ABMInput
inp2.Initialize(page, "logininp2", ABM.INPUT_PASSWORD, "Password", False, "lightblue")
mymodal.Content.Cell(2,1).AddComponent(inp2)
Dim inp3 As ABMInput
inp3.Initialize(page, "logininp3", ABM.INPUT_TEXT, "Provide Registration Number ( Then LOGIN Again )", False, "lightblue")
mymodal.Content.Cell(2,1).AddComponent(inp3)
inp3.Visibility = ABM.VISIBILITY_HIDE_ALL
If ABMShared.IsPhone(page) Or Not(ABMShared.IsPhone(page)) Then
Log(" --- ")
End If
Dim ps As String = page.GetCurrentPageSize
Log(" page.GetCurrentPageSize result: "&ps)
Log(" page.Isphone result: "&page.IsPhone)
Log(" page.IsTablet result: "&page.IsTablet)
Log(" page.IsDesktop result: "&page.IsDesktop)
Log(" --- ")
If page.GetCurrentPageSize = "phone" Then
' MHW - on phones, alter the modal sheet to fit the small screen size....
' If ABMShared.IsPhone(page) Then
mymodal.Size = ABM.MODALSHEET_SIZE_FULL
mymodal.MaxHeight = "100%"
' Dim loginbtn As ABMButton = mymodal.Content.Component("loginbtn")
' Dim logincancelbtn As ABMButton = mymodal.Content.Component("logincancelbtn")
' logincancelbtn.Text = "CAN"
' loginbtn.Text = "GO"
mymodal.Refresh
' page.ShowModalSheetAbsolute("login", "0px","1px", "100%","100%")
page.ShowModalSheetAbsolute("login", "-5%","1%", "110%","100%")
Log(" Phone - setting login to full screen!!!!!!!")
Return
Else If page.IsTablet Then
mymodal.Size = ABM.MODALSHEET_SIZE_FULL
mymodal.MaxHeight = "100%"
' Dim loginbtn As ABMButton = mymodal.Content.Component("loginbtn")
' Dim logincancelbtn As ABMButton = mymodal.Content.Component("logincancelbtn")
' logincancelbtn.Text = "CAN"
' loginbtn.Text = "GO"
mymodal.Refresh
' page.ShowModalSheetAbsolute("login", "0px","1px", "100%","100%")
page.ShowModalSheetAbsolute("login", "10%","1%", "78%","100%")
Log("Tablet setting login to full screen!!!!!!!")
Return
Else
Dim ps As String = page.GetCurrentPageSize
Log("full page size: "&ps)
mymodal.MaxWidth = "35%"
mymodal.Refresh
Log("NOT - setting login to full screen")
End If
Dim CSS As String = $"$('#login').css({'background-color': 'transparent', 'outline': 'none', 'box-shadow': 'unset'});
$('#login-content').removeClass('transparent').addClass('white');"$
page.ws.Eval(CSS, Null)
page.ws.Flush
page.ShowModalSheet("login")
End Sub