Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private prefdialog As PreferencesDialog
End Sub
Public Sub Initialize
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage") 'has button1
prefdialog.Initialize(Root, "Preference Dialog Message", 300dip, 300dip)
prefdialog.AddMultilineTextItem("First", "", 300dip)
End Sub
Private Sub Button1_Click
Dim Data As Map = CreateMap("First": "This is an important B4X Preference Dialog message box")
Dim sf As Object = prefdialog.ShowDialog(Data, "OK", "CANCEL")
For i = 0 To prefdialog.PrefItems.Size - 1
Dim pi As B4XPrefItem = prefdialog.PrefItems.Get(i)
If pi.ItemType = prefdialog.TYPE_MULTILINETEXT Then
Dim ft As B4XFloatTextField = prefdialog.CustomListView1.GetPanel(i).GetView(0).Tag
ft.TextField.SetTextAlignment("CENTER", "CENTER")
Dim xfont As B4XFont=xui.CreateFont(Typeface.DEFAULT_BOLD,32)
ft.textfield.Font = xfont
ft.TextField.TextColor =xui.Color_Magenta
ft.TextField.Enabled = False
End If
Next
Wait For (sf) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Dim f As String = Data.Get("First")
Log(f)
End If