This content has been marked as final. Show 3 replies
I'm constantly running into the same issue.
Sometimes there are 3 horizontal or vertical scrollbars..
Have you ever found a solution for this problem?
Reducing containers is surely a good thing. Unfortunately the application I'm working on is pretty large and at places there are easily between 5 and 10 nested containers. I'm not using AbsoluteLayout though and mostly a combination of HBox/VBox/Forms.
One problem I ran into is with the use of HDividedBox, which when resizing caused its children to contain double scrollbars. The child would have a scrollbar and one of the child's children would have a scrollbar. If you get small enough then the parent also has a scrollbar. It ain't a pretty picture.
Sofar I've found that HDividedBox has a problem with resizing a child component if that child is a container holding more components/containers. Its difficult to debug but my impression is that when the layout manager pass takes place, the child container's size hasn't been updated yet. As a result the deeper level is set larger than it should, causing an extra scrollbar.
My workaround (bit hack) that helped somewhat is to catch the resize event in the HDividedBox child and set its minWidth to be the max of the measuredMinWidth of the child's children. This only affects how HDividedBox resizes its child, and isn't a general solution unfortunately.
For those interested:
if ((child1 != null) && (child2 != null))
this.minWidth = Math.max( child1.measuredMinWidth, child2.measuredMinWidth);