|Re: [ECP] Custom Control always in a ScrolledComposite [message #1408660 is a reply to message #1408390]
||Fri, 15 August 2014 18:15
| Charles Eutsler
Registered: July 2009
The troublesome part of our form is defined as:|
Leaf Category one
Leaf Category troublesome
Custom Control troublesome
Custom Domain Model Reference
When the renderControl is called for the troublesome custom control, the hierarchy of composites leading to the renderControl's parent parameter is:
The last Composite is the renderControl method's parent parameter value.
Into the parent composite we build:
Composite (with GridLayout(2, false)
TableViewer (with GridData(SWT.FILL, SWT.FILL, true, true, 2, 1))
So, the TableViewer should ultimately get all the real estate of the custom control not taken by the combo and its label (and any margins of the containing Composites).
The problem is that the ScrolledComposite is given all the real estate of its part of the SashForm and it displays scroll bars when the Composite it contains requires more area than is available in the ScrolledComposite's area.
The contained composite does not expand to fill the available space (nor do its children). The size of the topmost contained Composite is what is used to determine when scroll bars are displayed. The size of that Composite comes from the sizes of the components it contains (based on preferred dimensions and whatnot). But there is no filling of the ScrolledComposite.
What I think is needed here is to have the child of the SashForm be a simple Composite that gives its child all its real estate when it has a single, custom control as its child.
OK, I'm seeing a little bit of a problem here...I see that the View Model editor context menu lets me add a Control to a Leaf Category but it doesn't let me add a Custom Control. I seem to have defined the Custom Control somewhere then dragged it into the Leaf Category. The editor didn't help me create it there but it did let me move it there so I'm guessing it is valid and that the View Model editor is just missing the Custom Control entry in the context menu of the Leaf Category tree node.
Powered by FUDForum
. Page generated in 0.02733 seconds