302 views
in Embedded Wizard Studio by
Is it possible to do strike-though text? Either as regular text, a font parameter or attributed text?

Thanks

Phil

1 Answer

0 votes
by
 
Best answer

Hello Phil,

as configuration option, such feature is not available. There are only two applicable approaches:

1. Use a TTF which is explicitly designed to have strikethrough glyphs.

2. Implement code to display the strikethrough line.

In case of the second option: when using a Text view, you can query the area occupied by the displayed text rows. See the section Arrange other views on the content of the Text view. Knowing this information you can arrange a Line view so it strikes through the text. 

This approach is suitable if there are only few Text views intended to display such text. However, if you plan to use this style more frequently, it would be better to derive from the Views::Text class a new class and enhance it by the functionality to draw line segments. You would override the Draw() method of the class and enhance it accordingly.

Does it help you further?

Best regards

Paul Banach

by
Thanks Paul, yes this is all working now.

I decided to go the Class route and build something scalable rather than a one off item.

In the end I used a rectangle rather than a line as it was easier to control the thickness relative to the font size.

I am happy to share the implementation if it would be useful.

Best Regards

Phil
by
Hello Phil,

I'm happy, that you was able to solve the issue. If you have an example project demonstrating the implementation, it would be of course great when you upload it here to the Ask Embedded Wizard forum. Such examples are very helpful for other users. Thank you a lot!

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...