Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Groups and scrolling
Groups and scrolling [message #436492] Fri, 09 September 2005 13:32 Go to next message
Eclipse UserFriend
Originally posted by: bdberry.us.ibm.com

Hi,

I have created a composite and set the layout to FillLayout. This
composite contains three Groups vertically and each groups contains a
variety of user input fields. However, as inputs are added to each
group the group does not expand as new inputs are added. I tried adding
V_SCROLL and H_SCROLL to the composite and although the scroll bars
appear - they have no effect. So what I have is useless scrollbars and
inputs that are rendered outside each groups viewable area so you cant
see them - help!

Thanks
Re: Groups and scrolling [message #436495 is a reply to message #436492] Fri, 09 September 2005 13:58 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi Brian,

If you're adding input fields to the Groups after they have been laid out
then you need to invoke layout() on your Composite, which will update the
sizes of each of its Group children to their desired sizes based on their
contents.

Also, if you want to create a Composite with an active scrollbar then it's
easiest to use a ScrolledComposite.

Grant

"Brian Berry" <bdberry@us.ibm.com> wrote in message
news:dfs2tb$btr$1@news.eclipse.org...
> Hi,
>
> I have created a composite and set the layout to FillLayout. This
> composite contains three Groups vertically and each groups contains a
> variety of user input fields. However, as inputs are added to each
> group the group does not expand as new inputs are added. I tried adding
> V_SCROLL and H_SCROLL to the composite and although the scroll bars
> appear - they have no effect. So what I have is useless scrollbars and
> inputs that are rendered outside each groups viewable area so you cant
> see them - help!
>
> Thanks
Re: Groups and scrolling [message #436498 is a reply to message #436495] Fri, 09 September 2005 15:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bdberry.us.ibm.com

Grant Gayed wrote:
> Hi Brian,
>
> If you're adding input fields to the Groups after they have been laid out
> then you need to invoke layout() on your Composite, which will update the
> sizes of each of its Group children to their desired sizes based on their
> contents.
>
> Also, if you want to create a Composite with an active scrollbar then it's
> easiest to use a ScrolledComposite.
>
> Grant
>
> "Brian Berry" <bdberry@us.ibm.com> wrote in message
> news:dfs2tb$btr$1@news.eclipse.org...
>
>>Hi,
>>
>>I have created a composite and set the layout to FillLayout. This
>>composite contains three Groups vertically and each groups contains a
>>variety of user input fields. However, as inputs are added to each
>>group the group does not expand as new inputs are added. I tried adding
>>V_SCROLL and H_SCROLL to the composite and although the scroll bars
>>appear - they have no effect. So what I have is useless scrollbars and
>>inputs that are rendered outside each groups viewable area so you cant
>>see them - help!
>>
>>Thanks
>
>
>
ok that does not seem to have any effect. Here is what i have (keep in
mind that i am new at this).

protected void createTab (TabFolder folder){
TabItem item = null;
ScrolledComposite parent = null;
Group groupAttributes = null;
Group groupCustomerInfo = null;
Group groupDeliveryGeo = null;
Group groupEngagementManagement = null;
Group groupServicePlanning = null;

item = new TabItem(folder, SWT.BORDER);
item.setText("Details");

parent = new ScrolledComposite (folder, SWT.BORDER | SWT.V_SCROLL);
parent.setLayout(new FillLayout(SWT.VERTICAL));

groupAttributes = new Group (parent, SWT.SHADOW_ETCHED_IN);
groupAttributes.setText("Engagement Attributes");

groupCustomerInfo = new Group (parent, SWT.SHADOW_ETCHED_IN);
groupCustomerInfo.setText("Customer Information");

groupDeliveryGeo = new Group (parent, SWT.SHADOW_ETCHED_IN);
groupDeliveryGeo.setText("Delivery Geographics");

groupEngagementManagement = new Group (parent, SWT.SHADOW_ETCHED_IN);
groupEngagementManagement.setText("Delivery Geographics");

groupServicePlanning = new Group (parent, SWT.SHADOW_ETCHED_IN);
groupServicePlanning.setText("Delivery Geographics");

buildAttributes(groupAttributes);
buildCustomerInfo(groupCustomerInfo);
buildGeo(groupDeliveryGeo);
buildEngagementManagement(groupDeliveryGeo);
buildServicePlanning(groupDeliveryGeo);

folder.layout();
parent.layout();

item.setControl(parent);
}

here is a sample of a build method...

protected void buildServicePlanning(Composite parent) {
parent.setLayout(new GridLayout(4, true));

Label label = null;
GridData gridData = null;

label = new Label(parent, SWT.None);
label.setText("Service Planning:");
gridData = new GridData();
gridData.horizontalAlignment = SWT.RIGHT;
label.setLayoutData(gridData);


}

Any ideas?
Re: Groups and scrolling [message #436501 is a reply to message #436498] Fri, 09 September 2005 15:35 Go to previous messageGo to next message
Ben Brown is currently offline Ben BrownFriend
Messages: 23
Registered: July 2009
Junior Member
Hi Brian,

It looks like the problem that you're having with the scrolled composite
is that you're using the SC as a parent for your group items. Try
instead using a regular composite as a child of the scrolled composite
and then setting the contents of the scrolled composite to be the
underlying composite. There is a really good snippet of how to use
scrolled composites on the api at

http://download.eclipse.org/eclipse/downloads/documentation/ 2.0/html/plugins/org.eclipse.platform.doc.isv/reference/api/ org/eclipse/swt/custom/ScrolledComposite.html

Yesh, thats a long URL

Hope that helps,
Ben

Brian Berry wrote:
> Grant Gayed wrote:
>
>> Hi Brian,
>>
>> If you're adding input fields to the Groups after they have been laid out
>> then you need to invoke layout() on your Composite, which will update the
>> sizes of each of its Group children to their desired sizes based on their
>> contents.
>>
>> Also, if you want to create a Composite with an active scrollbar then
>> it's
>> easiest to use a ScrolledComposite.
>>
>> Grant
>>
>> "Brian Berry" <bdberry@us.ibm.com> wrote in message
>> news:dfs2tb$btr$1@news.eclipse.org...
>>
>>> Hi,
>>>
>>> I have created a composite and set the layout to FillLayout. This
>>> composite contains three Groups vertically and each groups contains a
>>> variety of user input fields. However, as inputs are added to each
>>> group the group does not expand as new inputs are added. I tried adding
>>> V_SCROLL and H_SCROLL to the composite and although the scroll bars
>>> appear - they have no effect. So what I have is useless scrollbars and
>>> inputs that are rendered outside each groups viewable area so you cant
>>> see them - help!
>>>
>>> Thanks
>>
>>
>>
>>
> ok that does not seem to have any effect. Here is what i have (keep in
> mind that i am new at this).
>
> protected void createTab (TabFolder folder){
> TabItem item = null;
> ScrolledComposite parent = null;
> Group groupAttributes = null;
> Group groupCustomerInfo = null;
> Group groupDeliveryGeo = null;
> Group groupEngagementManagement = null;
> Group groupServicePlanning = null;
>
> item = new TabItem(folder, SWT.BORDER);
> item.setText("Details");
>
> parent = new ScrolledComposite (folder, SWT.BORDER | SWT.V_SCROLL);
> parent.setLayout(new FillLayout(SWT.VERTICAL));
>
> groupAttributes = new Group (parent, SWT.SHADOW_ETCHED_IN);
> groupAttributes.setText("Engagement Attributes");
>
> groupCustomerInfo = new Group (parent, SWT.SHADOW_ETCHED_IN);
> groupCustomerInfo.setText("Customer Information");
>
> groupDeliveryGeo = new Group (parent, SWT.SHADOW_ETCHED_IN);
> groupDeliveryGeo.setText("Delivery Geographics");
>
> groupEngagementManagement = new Group (parent,
> SWT.SHADOW_ETCHED_IN);
> groupEngagementManagement.setText("Delivery Geographics");
>
> groupServicePlanning = new Group (parent, SWT.SHADOW_ETCHED_IN);
> groupServicePlanning.setText("Delivery Geographics");
>
> buildAttributes(groupAttributes);
> buildCustomerInfo(groupCustomerInfo);
> buildGeo(groupDeliveryGeo);
> buildEngagementManagement(groupDeliveryGeo);
> buildServicePlanning(groupDeliveryGeo);
>
> folder.layout();
> parent.layout();
>
> item.setControl(parent);
> }
>
> here is a sample of a build method...
>
> protected void buildServicePlanning(Composite parent) {
> parent.setLayout(new GridLayout(4, true));
>
> Label label = null;
> GridData gridData = null;
>
> label = new Label(parent, SWT.None);
> label.setText("Service Planning:");
> gridData = new GridData();
> gridData.horizontalAlignment = SWT.RIGHT;
> label.setLayoutData(gridData);
>
>
> }
>
> Any ideas?
Re: Groups and scrolling [message #436502 is a reply to message #436495] Fri, 09 September 2005 15:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bdberry.us.ibm.com

Grant Gayed wrote:
> Hi Brian,
>
> If you're adding input fields to the Groups after they have been laid out
> then you need to invoke layout() on your Composite, which will update the
> sizes of each of its Group children to their desired sizes based on their
> contents.
>
> Also, if you want to create a Composite with an active scrollbar then it's
> easiest to use a ScrolledComposite.
>
> Grant
>
> "Brian Berry" <bdberry@us.ibm.com> wrote in message
> news:dfs2tb$btr$1@news.eclipse.org...
>
>>Hi,
>>
>>I have created a composite and set the layout to FillLayout. This
>>composite contains three Groups vertically and each groups contains a
>>variety of user input fields. However, as inputs are added to each
>>group the group does not expand as new inputs are added. I tried adding
>>V_SCROLL and H_SCROLL to the composite and although the scroll bars
>>appear - they have no effect. So what I have is useless scrollbars and
>>inputs that are rendered outside each groups viewable area so you cant
>>see them - help!
>>
>>Thanks
>
>
>
ok that does not seem to have any effect. Here is what i have (keep in
mind that i am new at this).

protected void createTab (TabFolder folder){
TabItem item = null;
ScrolledComposite parent = null;
Group groupAttributes = null;
Group groupCustomerInfo = null;
Group groupDeliveryGeo = null;
Group groupEngagementManagement = null;
Group groupServicePlanning = null;

item = new TabItem(folder, SWT.BORDER);
item.setText("Details");

parent = new ScrolledComposite (folder, SWT.BORDER | SWT.V_SCROLL);
parent.setLayout(new FillLayout(SWT.VERTICAL));

groupAttributes = new Group (parent, SWT.SHADOW_ETCHED_IN);
groupAttributes.setText("Engagement Attributes");

groupCustomerInfo = new Group (parent, SWT.SHADOW_ETCHED_IN);
groupCustomerInfo.setText("Customer Information");

groupDeliveryGeo = new Group (parent, SWT.SHADOW_ETCHED_IN);
groupDeliveryGeo.setText("Delivery Geographics");

groupEngagementManagement = new Group (parent, SWT.SHADOW_ETCHED_IN);
groupEngagementManagement.setText("Delivery Geographics");

groupServicePlanning = new Group (parent, SWT.SHADOW_ETCHED_IN);
groupServicePlanning.setText("Delivery Geographics");

buildAttributes(groupAttributes);
buildCustomerInfo(groupCustomerInfo);
buildGeo(groupDeliveryGeo);
buildEngagementManagement(groupDeliveryGeo);
buildServicePlanning(groupDeliveryGeo);

folder.layout();
parent.layout();

item.setControl(parent);
}

here is a sample of a build method...

protected void buildServicePlanning(Composite parent) {
parent.setLayout(new GridLayout(4, true));

Label label = null;
GridData gridData = null;

label = new Label(parent, SWT.None);
label.setText("Service Planning:");
gridData = new GridData();
gridData.horizontalAlignment = SWT.RIGHT;
label.setLayoutData(gridData);


}

Any ideas?
Re: Groups and scrolling [message #436505 is a reply to message #436501] Fri, 09 September 2005 19:35 Go to previous message
Eclipse UserFriend
Originally posted by: bdberry.us.ibm.com

Ben Brown wrote:
> Hi Brian,
>
> It looks like the problem that you're having with the scrolled composite
> is that you're using the SC as a parent for your group items. Try
> instead using a regular composite as a child of the scrolled composite
> and then setting the contents of the scrolled composite to be the
> underlying composite. There is a really good snippet of how to use
> scrolled composites on the api at
>
> http://download.eclipse.org/eclipse/downloads/documentation/ 2.0/html/plugins/org.eclipse.platform.doc.isv/reference/api/ org/eclipse/swt/custom/ScrolledComposite.html
>
>
> Yesh, thats a long URL
>
> Hope that helps,
> Ben
>
> Brian Berry wrote:
>
>> Grant Gayed wrote:
>>
>>> Hi Brian,
>>>
>>> If you're adding input fields to the Groups after they have been laid
>>> out
>>> then you need to invoke layout() on your Composite, which will update
>>> the
>>> sizes of each of its Group children to their desired sizes based on
>>> their
>>> contents.
>>>
>>> Also, if you want to create a Composite with an active scrollbar then
>>> it's
>>> easiest to use a ScrolledComposite.
>>>
>>> Grant
>>>
>>> "Brian Berry" <bdberry@us.ibm.com> wrote in message
>>> news:dfs2tb$btr$1@news.eclipse.org...
>>>
>>>> Hi,
>>>>
>>>> I have created a composite and set the layout to FillLayout. This
>>>> composite contains three Groups vertically and each groups contains a
>>>> variety of user input fields. However, as inputs are added to each
>>>> group the group does not expand as new inputs are added. I tried
>>>> adding
>>>> V_SCROLL and H_SCROLL to the composite and although the scroll bars
>>>> appear - they have no effect. So what I have is useless scrollbars and
>>>> inputs that are rendered outside each groups viewable area so you cant
>>>> see them - help!
>>>>
>>>> Thanks
>>>
>>>
>>>
>>>
>>>
>> ok that does not seem to have any effect. Here is what i have (keep
>> in mind that i am new at this).
>>
>> protected void createTab (TabFolder folder){
>> TabItem item = null;
>> ScrolledComposite parent = null;
>> Group groupAttributes = null;
>> Group groupCustomerInfo = null;
>> Group groupDeliveryGeo = null;
>> Group groupEngagementManagement = null;
>> Group groupServicePlanning = null;
>> item = new TabItem(folder, SWT.BORDER);
>> item.setText("Details");
>> parent = new ScrolledComposite (folder, SWT.BORDER |
>> SWT.V_SCROLL);
>> parent.setLayout(new FillLayout(SWT.VERTICAL));
>> groupAttributes = new Group (parent,
>> SWT.SHADOW_ETCHED_IN);
>> groupAttributes.setText("Engagement Attributes");
>> groupCustomerInfo = new Group (parent,
>> SWT.SHADOW_ETCHED_IN);
>> groupCustomerInfo.setText("Customer Information");
>> groupDeliveryGeo = new Group (parent,
>> SWT.SHADOW_ETCHED_IN);
>> groupDeliveryGeo.setText("Delivery Geographics");
>> groupEngagementManagement = new Group (parent,
>> SWT.SHADOW_ETCHED_IN);
>> groupEngagementManagement.setText("Delivery Geographics");
>> groupServicePlanning = new Group (parent,
>> SWT.SHADOW_ETCHED_IN);
>> groupServicePlanning.setText("Delivery Geographics");
>> buildAttributes(groupAttributes);
>> buildCustomerInfo(groupCustomerInfo);
>> buildGeo(groupDeliveryGeo);
>> buildEngagementManagement(groupDeliveryGeo);
>> buildServicePlanning(groupDeliveryGeo);
>> folder.layout();
>> parent.layout();
>> item.setControl(parent);
>> }
>>
>> here is a sample of a build method...
>>
>> protected void buildServicePlanning(Composite parent) {
>> parent.setLayout(new GridLayout(4, true));
>> Label label = null;
>> GridData gridData = null; label = new
>> Label(parent, SWT.None);
>> label.setText("Service Planning:"); gridData =
>> new GridData();
>> gridData.horizontalAlignment = SWT.RIGHT;
>> label.setLayoutData(gridData);
>> }
>>
>> Any ideas?
That worked great - thanks!
another change I had to make was item.setControl(scrolledParent);

I had it sent to the old parent and that was giving errors.
Previous Topic:Deployed RCP Enteprise Applications
Next Topic:user-addable plugins
Goto Forum:
  


Current Time: Thu Dec 26 20:13:52 GMT 2024

Powered by FUDForum. Page generated in 0.04047 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top