Skip to main content
MWate.1
Associate
July 6, 2020
Solved

Can I change the text rendering?

  • July 6, 2020
  • 4 replies
  • 1407 views

I want to make a TextBox with a cursor (caret) and would like to change the TextAreaWithOneWildcard. Where can I see the implementation of the draw method? Is this code open?

This topic has been closed for replies.
Best answer by Martin KJELDSEN
touchgfx/widgets

You can inspect the draw methods of the text areas. `TextAreaWithOneWildcard` inherits from `TextArea`

Imagine that you have a widget of type `TextArea` that is time aware using:

Application::getInstance()->registerTimerWidget(this);

You can now receive ticks in:

void MyCustomTextArea::handleTickEvent()
{

And blink a cursor/caret at some interval. Now it's your job to move the caret as the TextArea receives new input (from the application). You can do this by moving the caret to the end of the text (you can get the total width of the text) or if you want to support editing at some location in the text,.

4 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
July 6, 2020
touchgfx/widgets

You can inspect the draw methods of the text areas. `TextAreaWithOneWildcard` inherits from `TextArea`

Imagine that you have a widget of type `TextArea` that is time aware using:

Application::getInstance()->registerTimerWidget(this);

You can now receive ticks in:

void MyCustomTextArea::handleTickEvent()
{

And blink a cursor/caret at some interval. Now it's your job to move the caret as the TextArea receives new input (from the application). You can do this by moving the caret to the end of the text (you can get the total width of the text) or if you want to support editing at some location in the text,.

MWate.1
MWate.1Author
Associate
July 6, 2020

thx, and standard implementations of this in libraries? I understand correctly that touchgfx is free but not open source?

Martin KJELDSEN
Principal III
July 7, 2020

Not open source, and free on STM32 yes :) There's no standard widget that gives you a cursor, but you could do it "easy" on your own!

/Martin