Jump to content

Overlapping windows and widgets


Sergey Kushnir

Recommended Posts

I have encountered such a problem. A table is displayed on the screen, in which a row is updated. On command from the button, a frame window with a console is displayed, which overlaps the table. However, the updated part of the table overlaps the window with the console and spoils the view. How to solve this problem?

Photos shows this problem.

 

Right.jpg

Wrong.jpg

Edited by Sergey Kushnir
clarification of information
Link to comment
Share on other sites

uGFX has a VERY simple window manager. It does not currently support overlapping Windows like you are using, as the generic case for that requires some very complex and processor intensive clipping algorithms. It is also an "unbounded" problem in that it may require additional memory allocation that cannot be pre-computed statically. Once the V3 uGFX has been released we can re-examine this as V3 puts significantly better clipping into the GDISP layer.

Until then you can either:

1. remove the overlap e.g by reducing the table size while the console is open, or

2. try to detect the situations it is happening and add additional clipping calls to GDISP.

The 2nd strategy may not work for you depending on how you are using GWIN so the most promising strategy is probably number 1.

Link to comment
Share on other sites

Thank you for the answer, inmarket!

I know and understand that uGFX is a very simple graphics library. Therefore, I try to look for solutions similar to those you described in point 1. But sometimes there are situations that cannot be avoided.
I just need to understand how to crop the widget display with minimal actions. For example, as shown in the photo, the upper window overlaps the right side of the table. Accordingly, it is possible to reconfigure the constraints for displaying the table. How can this be done with the existing library tools? Will this require making changes to the widget?
I assume the following actions.
The table is drawn. After some time, a window is called that should be drawn above the table and overlap it. New constraint coordinates are passed to the table object. The table is drawn with these constraints. After some time, the window is closed. Data with the constraints that were there before are passed to the table object. The table is drawn with these constraints. That's all.
This is a case in which everything is done manually, but it suits me quite well, since such cases will be very rare. I rely on the fact that widgets call setclip(...) when drawing.

Link to comment
Share on other sites

There are gwin calls that can resize a widget. Try starting there. I am thinking something like:

1. Change the size of the table when you display the console.

2. Change the size back when you hide the console.

How you handle this will really depend on what you are doing  with your console window and table widget.

Link to comment
Share on other sites

1 hour ago, inmarket said:

There are gwin calls that can resize a widget. Try starting there. I am thinking something like:

1. Change the size of the table when you display the console.

2. Change the size back when you hide the console.

How you handle this will really depend on what you are doing  with your console window and table widget.

Thank's for your reply! This solution is work perfectly!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...