1.2k views
in GUI Development by
I am developing a time module and use a text to display.

My code is like this:  

Text_HourMin.String = string(Hour,2) + ":" + string(Min,2);  ( Hour and Min is the variable to get time information )

But I found that the characters are too close, we have a requirement of 10 pixel distance between them, I just find a RowDistance in the property of text, but it is not used for the distance horizontal.

How to set the distance between characters horizontal?

My version of EW is 11.

1 Answer

0 votes
by

Hello,

the distance between characters is predetermined by the used font. Modifying the distance individually within a text is not possible.

I would recommend to use two Text views. One displaying the hour (e.g. named HourText) and the other one displaying the minutes (e.g. named MinutesText).

If the distance between the displayed hour and minutes should always be constant, you could configure the HourText to align the text to its right edge and the MinutesText to its left edge. See also Align the text within the Text view area. Then move the MinutesText so the desired distance is achieved.

More sophisticated approach, you can adjust the scroll position of the MinutesText view each time the displayed content in HourText changes so the distance is fixed. For such purpose the Text view permits you to attach an OnUpdate event handler. In the implementation of the handler, calculate the appropriate scroll offset from the area occupied by the text in the HourText view and assign this offset to the MinutesText view.

I hope it helps you further.

best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...