cancel
Showing results for 
Search instead for 
Did you mean: 

Rectangle Frame widget?

CHech.1
Associate III

Hi,

I'm working on a project that has to support highlighting "focused" components with a frame around them.

The buttons have images, so I need the "inside" of the frame to be transparent.

BoxWithBorder doesn't suit my needs, as I can't set the inside to be transparent and the border not to be (right?)

Is there a recommended way to do this without creating a widget from scratch?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Romain DIELEMAN
ST Employee

Hi,

Unfortunately not that I am aware of. What I would do instead of creating a widget through code is to do a custom container instead where you use 4 box widgets to do the borders without alpha and either nothing or a box for the inside with alpha. You could always make it more intelligent through user code to have it adapt to the size of the images.

/Romain

View solution in original post

2 REPLIES 2
Romain DIELEMAN
ST Employee

Hi,

Unfortunately not that I am aware of. What I would do instead of creating a widget through code is to do a custom container instead where you use 4 box widgets to do the borders without alpha and either nothing or a box for the inside with alpha. You could always make it more intelligent through user code to have it adapt to the size of the images.

/Romain

Xzhiy.1
Associate II

It's easy to derive class from that widget, and override draw() function, like this

virtual void draw(const touchgfx::Rect& invalidatedArea) const;

{

parent widget‘s draw();

draw your box; //your box will NOT exceed the width and height of widget

}

​may not work, just a hint.