Activity Adventures in TextInputCavas : 13

This post is really to say “update to the latest code” as I’ve done a bunch of busy work - but nothing that is rocket science

Position To Line Column takes 2 byref params which is nicer
Lifted the code in the InsertText event handler into a method so we can reuse it in other places (like inserting newline and line breaks)
Made Insert text actually handled INSERTING instead of just appending

The biggest addition is code for handling the move to beginning and end of lineNeither is complex
But note that in the Canvas move to left end of line and move to beginning of line are, in our implementation, the SAME.
Note that this is NOT a requirement that this be true and in a right to left writing writing system the beginning of the line might be at the right. However, I’ve deliberately avoided dealing with this situation or supporting that in this tutorial.

2 Likes