Pseudo-Code/Algorithm for an InputBox?

BlitzMax Forums/BlitzMax Programming/Pseudo-Code/Algorithm for an InputBox?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

let the cursor have a "working-area" which spans across the entire input box..
when you're writing, the cursor is moving to the right, and if it reaches the right side of the box, then display the text from the end of the text, and x number of characters "backwards" (the x number would most likely be the length of the input box divided by the font width); this is also the "work area" for the cursor.
now if the user is moving the cursor to the left, then check if it reaches the left side of the box.. if it does, then start decreasing the "start" character of the text displayed in the box..

I hope you can understand what I mean from what I wrote, as I found it kind of hard to explain what I'm thinking. hehe

If you don't get it, let me know, and I'll see if I can explain a bit better..