Text Insertion Issue/Query

GTT TFT Support

Moderator: Mods

Post Reply
sabell
LCD?
Posts: 1
Joined: Wed Oct 26, 2011 3:20 pm

Text Insertion Issue/Query

Post by sabell »

Hello,

I have a question regarding the text insertion on the GTT. My goal is to have 3 text boxes on a screen and update these values when RTI occurs on my uC. My issue is that I need to be able to clear the text in each box and rewrite the new value. I'm pretty sure this is possible, but I guess I'm not sure on how it is implemented with the command strings. Currently it seems to just write to a point where the text area (inside the text region) is out of bounds.

A good example of what I would like to do is in the GTT video posted in the forums. The text is inserted upon keypress and cleared when "C" is pressed. All of which is contained in the slim text area defined.

If anyone can shed some light on this situation I would greatly appreciate it.

Thanks,
Stephen

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Post by Clark »

Hello Stephen,

Using the existing command set, filling a text area will take a little memory on your host side.

In your application, I could see a string or array variable for each text box. When a key is pressed you could update the string by either appending a character or clearing it. After each update you would draw a Filled Rectangle of the background colour to clear the area and write the current string to the newly cleared location.

Additionally, you could use the Get String Extents command before writing your updated string to ensure it doesn't exceed the text box boundaries.

All the best with your GTT development, if you find anything else that isn't clearly laid out in the manual, please don't hesitate to post.

Thanks,
~Troy
Troy Clark
Design & Development
Matrix Orbital

Post Reply