Set ListBox.CellAlignment and TextField.Alignment to Right for RTL text

I see that if I add just Hebrew text to a TextField or ListBox cell the behaviour of the backspace automatically deletes the characters to the right of the cursor, however the text is still aligned left. Is there a way to auto align or get the base alignment of the text so I can set the alignment of the TextField or ListBox Cell to the right when it contains RTL text? I can get DynaPDF to auto align Hebrew text to the right and English text to the left, just wondering how I can do this in the UI.

Initially I’d like to set this for OS X builds, but may also need to set this for Windows builds.



Xojo 2016r2.1 on OS X 10.11.6

Well I found this function in DynaPDFMBS in case it helps anyone else:

DynaPDFMBS.IsBidiText(text As String) As Integer

The function returns the position of the first bidirectional character that can be found in the string or -1 if no such character can be found.

Xojo controls should automatically switch to right justified to right to left script. If I remember right, there was a bug report about that.

You could probably look at the unicode value in keydown and switch justification yourself when a Hebrew character is presented.