cancel
Showing results for 
Search instead for 
Did you mean: 

Touchgfx::BoxWithBorder constructor

GMeur
Senior

Hi,

I don't get why I can't set the border thickness/color directly when creating the BoxWithBorder object.

_boxWithBorder3(50, 50, touchgfx::Color::getColorFrom24BitRGB(150, 150, 250), touchgfx::Color::getColorFrom24BitRGB(0, 0, 0), 5,50)

Indeed, it doesn't work and draw a box without a border! All the other params work, hence I can change its size, background color, transparency, but impossible to get it to be drawn with a border! Calling the setBorderSize function after the object has been created works just fine. An idea?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Hi @GMeur​,

You're right about that. It's in our task list (as low prio) but, yes, construction of a BoxWithBorder object ignores border related arguments. It shouldn't.

Thanks!

/Martin

View solution in original post

2 REPLIES 2
cameronf
Senior

Looking in BoxWithBorder.hpp, it looks like the borderColor and borderSize members don't actually get set with the arguments in the constructor.0690X000008wKufQAE.png

I would just call the setBorderSize() after construction. If you really need to set those in the constructor you could probably just add the missing parameters to the initializer list in this constructor but I would hesitate to change any of the touchgfx source without a really good reason.

Maybe @Martin KJELDSEN​ knows if this is intentional for some reason or if this is a typo that will be resolved in future releases?​ 

Martin KJELDSEN
Chief III

Hi @GMeur​,

You're right about that. It's in our task list (as low prio) but, yes, construction of a BoxWithBorder object ignores border related arguments. It shouldn't.

Thanks!

/Martin