Skip to main content
GMeur
Associate III
May 23, 2019
Solved

Touchgfx::BoxWithBorder constructor

  • May 23, 2019
  • 2 replies
  • 999 views

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.

This topic has been closed for replies.
Best answer by Martin KJELDSEN

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

2 replies

cameronf
Associate
May 23, 2019

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
Martin KJELDSENBest answer
Principal III
May 24, 2019

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