[ECP] Custom Control always in a ScrolledComposite [message #1407118] |
Mon, 11 August 2014 19:11  |
Eclipse User |
|
|
|
We have created a custom control that contains a Combo control and a table that contains the items of the type selected in the Combo. We'd like the Combo box always to be displayed and have the table take up all the remaining room in the parent Composite.
The problem is that the custom control, which extends ECPAbstractCustomControlSWT, always has a ScrolledComposite as a parent. As a result, our table takes up some fixed region and the whole custom control's area scrolls when the contents are larger that some size (often, that is smaller than the area shown in the sash). The Combo box gets scrolled out of view when items in the table are scrolled into view.
Is there a way to have the parent of our custom control be a simple Composite and let us deal with the scrolling?
I must be missing something, surely.
|
|
|
|
Re: [ECP] Custom Control always in a ScrolledComposite [message #1408660 is a reply to message #1408390] |
Fri, 15 August 2014 14:15   |
Eclipse User |
|
|
|
The troublesome part of our form is defined as:
ViewForm
Categorization
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:
...
SashForm
ScrolledComposite
Composite
Composite
The last Composite is the renderControl method's parent parameter value.
Into the parent composite we build:
Composite (with GridLayout(2, false)
Label
Combo
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.
|
|
|
|
|
|
|
Re: [ECP] Custom Control always in a ScrolledComposite [message #1410363 is a reply to message #1410115] |
Wed, 20 August 2014 10:55  |
Eclipse User |
|
|
|
Hi Charles,
if you need professional support for this, please let us know.
Best regards
Jonas
Am 20.08.2014 00:05, schrieb Charles Eutsler:
> Thanks for the suggestions, Eugen!
>
> I'm embarrassed that I said we could provided a Renderer for the
> Category level but didn't think that we could also provide our own
> Renderer for the higher level. This is all beginning to look like we can
> achieve what we want.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.50371 seconds