cancel
Showing results for 
Search instead for 
Did you mean: 

Set Text without designer

JReed.1856
Associate II

Is it possible to create a Text without ueing the Designer first? Seems like everything has to be done through the Text Manager.​

17 REPLIES 17
Martin KJELDSEN
Chief III

You can simply edit the Excel sheet - That's what the designer does. It reads from- and writes to that text excel sheet and you can use this approach if you're not using the designer, for instance.

/Martin

JReed.1856
Associate II

Hi Martin,

I tried to do it that way, defining a text ID and Typography, and <value> as text. Wildcard Characters and Ranges have all been set. Trying to put it on screen like this:

        xDivText.setPosition(400, 240, 100, 50);
	Unicode::snprintf(txtBuffer, 7, "1 %d", 4000);
	xDivText.setTypedText(TypedText(T_GRAPHMINI));
	xDivText.setColor(Color::getColorFrom24BitRGB(0xFF, 0xFF, 0xFF));
	xDivText.setWildcard(txtBuffer);
	swipeContainer1Page1.add(xDivText);
	xDivText.resizeToCurrentText();
	xDivText.invalidate();

results in nothing being displayed.

The aim is to get axis labels on screen, without having to provide every single text area beforehand.

Martin KJELDSEN
Chief III

Dumb question, but you're adding it to swipeContainer1Page1. Is that page visible? (E.g. is swipeContainer1Page1 visible?) 🙂

JReed.1856
Associate II

Yep, I've added other widgets to it, and they're displayed fine

Martin KJELDSEN
Chief III

When you're setting the position of the textarea to 400,240 it will be relative to the container it's in. So, it may be outside =) And you're already using .resizeToCurrentText(), so try

xDivText.setXY(20,20);
...
...
xDivText.resizeToCurrentText();

Martin KJELDSEN
Chief III

Or alternatively, don't call resizeToCurrentText();

Try debugging and inspecting the xDivText object. You can inspect its Rect and check width and height, etc.

JReed.1856
Associate II

Ok so getSolidRect() on the textArea yields x,y, width and height all 0 without using resize

Martin KJELDSEN
Chief III

Does T_GRAPHMINI specify a wildcard character?

Martin KJELDSEN
Chief III

You could also simply send me the project and i'll check.

/Martin