Hello Mike,
it seems you have found the right solution. In fact, the example from my preceding answer used the length of the string stored already in TextEditor. In turn, your approach adapts in the TextEditor the caret position according to the just assigned string. Consequently, the code you added to PPS_Keyboard.String property could also be implemented within the TextEditor. You can try following:
1. In TextEditor component open the OnSetString method.
2. Scroll to the end of the method.
3. At the end of the onset method append following row:
caretIndex = value.length;
This updates the caretIndex each time the TextEditor receives a new string. Invoking updateCaret is not necessary in this case, because it will be invoked internally by Text view each time new string is assigned to the view.
4. The OnSetString method within the PPS_Keyboard component can be simplified now. Just relay the assigned string to the TextEditor:
// The value doesn't change - nothing to do.
if ( pure String == value )
return;
// Remember the property's new value.
pure String = value;
// ... and finally update the Text Editor to show the string.
TextEditor.String = value;
I tried out the above approach and it works. I hope it does also in your case. But finally, it is up to you which approach you prefer to use :o)
Best regards
Paul Banach