How can I access the items such as Cancel button or Search input hint for the Options dialog?
Let say I want to localize/change the text to other language or change their properties?
And the properties do not persist when I clicked on Cancel.
Sample project attached.
Let say I want to localize/change the text to other language or change their properties?
And the properties do not persist when I clicked on Cancel.
Sample project attached.
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
CreateDialog1
End Sub
Private Sub B4XPage_Resize(Width As Int, Height As Int)
If PrefDialog1.IsInitialized And PrefDialog1.Dialog.Visible Then PrefDialog1.Dialog.Resize(Width, Height)
End Sub
Private Sub BtnShow_Click
ShowDialog1
End Sub
Private Sub CreateDialog1
PrefDialog1.Initialize(Root, "Product", 300dip, 250dip)
PrefDialog1.Dialog.OverlayColor = xui.Color_ARGB(128, 0, 10, 40)
PrefDialog1.Dialog.TitleBarHeight = 50dip
PrefDialog1.LoadFromJson(File.ReadString(File.DirAssets, "template.json"))
End Sub
Private Sub ShowDialog1
PrefDialog1.Dialog.TitleBarColor = xui.Color_RGB(65, 105, 225)
PrefDialog1.Title = "Product"
Dim Item As Map = CreateMap("Product Code": "", "Category": "", "Product Name": "", "id": 0)
Dim sf As Object = PrefDialog1.ShowDialog(Item, "CONFIRM", "CANCEL ACTION")
Dim btnCancel As B4XView = PrefDialog1.Dialog.GetButton(xui.DialogResponse_Cancel)
btnCancel.Width = btnCancel.Width + 60dip
btnCancel.Left = btnCancel.Left - 60dip
btnCancel.TextColor = xui.Color_Red
Dim btnOk As B4XView = PrefDialog1.Dialog.GetButton(xui.DialogResponse_Positive)
btnOk.Width = btnOk.Width + 20dip
btnOk.Left = btnCancel.Left - btnOk.Width
'Sleep(0)
'PrefDialog1.CustomListView1.sv.Height = PrefDialog1.CustomListView1.sv.ScrollViewInnerPanel.Height + 10dip
Wait For (sf) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Log("OK")
End If
End Sub