Page 1 of 1

StaticText Size

Posted: Wed Nov 02, 2005 10:31
by catalin1976
Hello!

I have a simple question. Is it possible to create a StaticText with a size bigger that 1.0?

If yes, how can I do it? I really need for my tree control implementation.

I have attached 2 images. In the second image the red from the viewport node must be like in the first image. The bug appear only when the size of the viewport is bigger that 1.0.

Thank!

Image

Image

Re: StaticText Size

Posted: Wed Nov 02, 2005 18:32
by martignasse
hi,

Is it possible to create a StaticText with a size bigger that 1.0?
yes, you can, you did it ;)

The bug appear only when the size of the viewport is bigger that 1.0
It because a widget having a size bigger than one mean "bigger than his parent, and by default, clipped by him"
You should use setClippedByParent( false ) on viewport to disable this.

but i suspect something wrong in you'r dimension computation if you have to use size>1.0. I don't see anything on the shot forcing you to do that.

Maybe check you'r maxsize of the viewport parent.

anyway, you'r app seem's very cool, want to see more :hammer:

keep up the good work :)

Re: StaticText Size

Posted: Thu Nov 03, 2005 02:21
by catalin1976
Hi again!

The colour red of the viewport is in fact a static text with the background colour set to red. I have check the again the calculation of the height is correct.

In the screen shoot the red must be longer that the green of the rotation.

I don't know where the problem is so if you could help me I would be grateful.

Thank you!


Image

Re: StaticText Size

Posted: Thu Nov 03, 2005 03:41
by lindquist
Have you checked the max size for the window that is being clipped?

The default maxsize for a window is (1, 1) relative.

so if your background window needs to be larger than that, you must change the maxsize first.

Code: Select all

// Will set the max size to:
// width = 200px
// height = 3*(parentheight)
Window* w = ...
w->setWindowMaxSize( UVector2( UDim(0,200), UDim(3,0) ) );

Re: StaticText Size

Posted: Thu Nov 03, 2005 09:23
by catalin1976
Thank you!!!!!

The problem is now solved!
Now when I modify the size of the staticText I modify also the window max size.

Thank again!