Can you please tell me how to disable uppercase in the button names for Msgbox2 (Msgbox2Async).
I used to see a way on the forum, but now I can not find it by searching for the word "allcaps".
I would also like to know how to change the position of the buttons.
Edit: B4XDialogs is part of XUI Views library. Use that instead: [B4X] XUI Views - Cross platform views and dialogs B4XDialog class helps with creating cross platform custom dialogs. The dialog is made of a simple panel and it is therefore completely customizable. Simple usage (change...
How do you declare the Msgbox2.
In the declaration you have:
B4X:
Msgbox2Async (Message As CharSequence, Title As CharSequence, Positive As String, Cancel As String, Negative As String, Icon As BitmapWrapper, Cancelable As Boolean)
And the texts displayed in the buttons are those you give in Positive, Cancel and Negative.
The text is displayed in upper case: POSITIVE, CANCEL, NEGATIVE.
Lowercase required. I saw on the forum how to do it in the manifest but can't find it.
I would also like to know how to change the position of the buttons without changing their return value.
Sorry, I tested it with an older version of Android where it was the case.
Unfortunately, on the latest Android versions the text is converted to uppercase.
I agree.
As you said probably there is a way to obtain the lower case text.
But then I don't know how to change the choices order (if I understood well what you want).
For that maybe you will just need to manage them apart from what they really are:
Positive = you will manage it as Negative
Cancel = you will manage it as Positive
and so on.
Private Sub Button1_Click
Dim sf As Object = xui.Msgbox2Async("Delete file?", "Title", "Cancel", "No", "Yes", Null)
Wait For (sf) Msgbox_Result (Result As Int)
If Result = xui.DialogResponse_Negative Then
Log("Yes is selected")
Else If Result = xui.DialogResponse_Cancel Then
Log("No is selected")
Else
Log("Cancel is selected")
End If
End Sub
Thanks a lot! This is exactly the way I was looking for. Works as desired.
Only earlier I found similar code that changed the case only for Msgbox2. From memory, the term "Alert" was used there.
Take note that the manifest may change all the styles not only for the alert button. I am not familiar with manifest. I just tested and it just works. Maybe there is better settings.
Also good to be aware that the capitalization is part of Material design standard so if you are following the standard, then you should use the recommended style as mentioned in many replies in Stack Overflow.
Aeric, thanks, I understand you.
When asked how to change the position of the buttons without changing their return value, no one answered.
Does it look like it's impossible?
What do you mean by changing the position of the buttons without changing their return value? You mean you can customize how many pixels Left and Top?
Isn't my example answers your question?
It doesn't matter what the return values are, you can do whatever you want after the return value.
I think it is not easy to customise the build-in or default behaviour of Android widget. You need some hacking like modifying the manifest. I don't use the msgbox in my app as it looks ugly in B4J. I would use other Dialog such as B4XPreferenceDialog where I can easily customize what I want.