I was just testing the jXUI messagebox and it's behaving strange.
When I call frm_CloseRequest from a cancel button my messagebox is shown and waits for the result.
However when i close the form with the close-button the messagebox pops up and dissapears immediatly and the form closes.
The commented code works as expected in both situations.
The form itself is a modal form.
When I call frm_CloseRequest from a cancel button my messagebox is shown and waits for the result.
However when i close the form with the close-button the messagebox pops up and dissapears immediatly and the form closes.
The commented code works as expected in both situations.
The form itself is a modal form.
B4X:
Sub frm_CloseRequest (EventData As Event)
Dim sf As Object = xui.Msgbox2Async(mResources.getResource(Main.c_language,"messageboxChanges") & CRLF & mResources.getResource(Main.c_language,"messageboxConfirm"), "", mResources.getResource(Main.c_language,"yes"), "", mResources.getResource(Main.c_language,"no"), Null)
Wait For (sf) Msgbox_Result (Result As Int)
If Result = xui.DialogResponse_Positive Then
frm.Close
End If
' If fx.Msgbox2(frm,mResources.getResource(Main.c_language,"messageboxChanges") & CRLF & mResources.getResource(Main.c_language,"messageboxConfirm"),"",mResources.getResource(Main.c_language,"yes"),"",mResources.getResource(Main.c_language,"no"),fx.MSGBOX_CONFIRMATION) = fx.dialogresponse.POSITIVE Then
' frm.Close
' End If
End Sub
B4X:
Sub btnUserCancel_MouseClicked (EventData As MouseEvent)
frm_CloseRequest(EventData)
End Sub