OK-Cancel or Cancel-OK, what to prefer in dialogs? It depends on the guidelines and it should be flexible. That's why I did this small modification in the B4XDialog library and I hope, that something like that could be integrated in the official one.
Add in Class_Globals
Modify the Sub ShowCustom (Content As B4XView, Yes As Object, No As Object, Cancel As Object) As ResumableSub
And you use it like
Add in Class_Globals
B4X:
Public ButtonsYesToRight As Boolean
Modify the Sub ShowCustom (Content As B4XView, Yes As Object, No As Object, Cancel As Object) As ResumableSub
B4X:
If ButtonsYesToRight Then
CreateButton(Yes, xui.DialogResponse_Positive)
CreateButton(No, xui.DialogResponse_Negative)
CreateButton(Cancel, xui.DialogResponse_Cancel)
Else
CreateButton(Cancel, xui.DialogResponse_Cancel)
CreateButton(No, xui.DialogResponse_Negative)
CreateButton(Yes, xui.DialogResponse_Positive)
End If
And you use it like
B4X:
Dim Dialog As B4XDialog
Dialog.Initialize (Base)
Dialog.Title = "XUI Views"
Dialog.ButtonsYesToRight = True