Sometimes you just need to show a quick msgbox or a single field inputbox to the user. In ABMaterial you can build some quick modal sheets to do this. But in 2.51 I've integrated the possibility for such cases just to do it in one line of code (like a normal msgbox/inputbox).
Examples:
Events:
I'll try to finish up 2.51 today so I can send out this Maintenance update next week.
Alain
Examples:
B4X:
page.Msgbox("MSGBOX1", "This is a very simple msgbox", "Msgbox()", "OK", "")
B4X:
theme.AddMsgBoxTheme("image")
theme.MsgBox("image").ConfirmButtonColor = ABM.COLOR_GREEN
theme.MsgBox("image").CancelButtonColor = ABM.COLOR_RED
theme.MsgBox("image").SetImage("https://unsplash.it/400/200", 400, 200)
theme.MsgBox("image").BackColor = ABM.COLOR_BLUEGREY
theme.MsgBox("image").BackColorIntensity = ABM.INTENSITY_LIGHTEN5
page.Msgbox2("MSGBOX3", "This is an msgbox with an image using a {C:#00AA00}theme{/C}!", "Msgbox2() 2", "OK","CANCEL",True, ABM.MSGBOX_TYPE_WARNING, "image")
B4X:
page.InputBox("INPUTBOX1", "This is an inputbox for text.","OK", "CANCEL", True, ABM.INPUTBOX_TYPE_QUESTION, ABM.INPUTBOX_QUESTIONTYPE_TEXT,"","Type some text...", "", "Please enter something!", "")
B4X:
page.InputBox("INPUTBOX3", "This is an inputbox for a password.","OK", "CANCEL", True, ABM.INPUTBOX_TYPE_QUESTION, ABM.INPUTBOX_QUESTIONTYPE_PASSWORD,"","Type your password...", "", "Please enter a password", "")
B4X:
page.InputBox("INPUTBOX6", "This is an inputbox with a radio selection.","OK", "CANCEL", True, ABM.INPUTBOX_TYPE_QUESTION, ABM.INPUTBOX_QUESTIONTYPE_RADIO,"#00ff00", "","{'#ff0000': 'Red','#00ff00': 'Green','#0000ff': 'Blue'}", "You must select a color", "")
B4X:
page.InputBox("INPUTBOX7", "This is an inputbox with a checkbox.","OK", "CANCEL", True, ABM.INPUTBOX_TYPE_QUESTION, ABM.INPUTBOX_QUESTIONTYPE_CHECKBOX,"", "I agree with the terms and conditions","", "Please agree with the conditions", "")
Events:
B4X:
Sub page_MsgboxResult(returnName As String, result As String)
myToastId = myToastId + 1
page.ShowToast("toast" & myToastId, "toastgreen", returnName & " " & result, 5000)
End Sub
Sub page_InputboxResult(returnName As String, result As String)
myToastId = myToastId + 1
page.ShowToast("toast" & myToastId, "toastred", returnName & " " & result, 5000)
End Sub
I'll try to finish up 2.51 today so I can send out this Maintenance update next week.
Alain