B4J Question (Solved) PreferencesDialog Buttons Text

Solution
B4XPreferencesDialog uses a regular B4XDialog for the dialog.

B4X:
Dim rs As Object = p.ShowDialog(Data(0), "Ok", "CANCELLLL")
Dim btnCancel As B4XView = p.Dialog.GetButton(xui.DialogResponse_Cancel)
btnCancel.Width = btnCancel.Width + 20dip
btnCancel.Left = btnCancel.Left - 20dip
Dim btnOk As B4XView = p.Dialog.GetButton(xui.DialogResponse_Positive)
btnOk.Left = btnOk.Left - 20dip
Wait For (rs) Complete (Result As Int)

It is the same as with B4XDialog directly: https://www.b4x.com/android/forum/threads/solved-b4xinputtemplate-button-width.114021/#post-712233

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4XPreferencesDialog uses a regular B4XDialog for the dialog.

B4X:
Dim rs As Object = p.ShowDialog(Data(0), "Ok", "CANCELLLL")
Dim btnCancel As B4XView = p.Dialog.GetButton(xui.DialogResponse_Cancel)
btnCancel.Width = btnCancel.Width + 20dip
btnCancel.Left = btnCancel.Left - 20dip
Dim btnOk As B4XView = p.Dialog.GetButton(xui.DialogResponse_Positive)
btnOk.Left = btnOk.Left - 20dip
Wait For (rs) Complete (Result As Int)

It is the same as with B4XDialog directly: https://www.b4x.com/android/forum/threads/solved-b4xinputtemplate-button-width.114021/#post-712233
 
Upvote 2
Solution

aeric

Expert
Licensed User
Longtime User

Thanks. I tested with longer text.

B4X:
    Dim sf As Object = PrefDialog3.ShowDialog(Item, "OK", "CANCEL ACTION")
    Sleep(0)
    ' Fix Linux UI
    #if B4J
    Dim btnCancel As B4XView = PrefDialog3.Dialog.GetButton(xui.DialogResponse_Cancel)
    btnCancel.Width = btnCancel.Width + 80dip
    btnCancel.Left = btnCancel.Left - 80dip
    btnCancel.TextColor = xui.Color_Red
    Dim btnOk As B4XView = PrefDialog3.Dialog.GetButton(xui.DialogResponse_Positive)
    btnOk.Left = btnOk.Left - 80dip
    #End If
    Wait For (sf) Complete (Result As Int)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…