ScrolledComposite problem. [message #461375] |
Wed, 21 September 2005 14:32 |
Bhavani Messages: 5 Registered: July 2009 |
Junior Member |
|
|
Hi,
My scenario is : I have a main composite on which i am placing 3 groups.
The first group is to be placed in a scrolled composite, since the content
of this group can be very large at times. The other 2 groups are fixed in
size.
Now the problem is the group is not fitting in that scrolledcomposite.
Here is the code for review.
super(getShell(), SWT.NONE); //extends composite
this.setLayout(new GridLayout());
this.setLayoutData(new GridData());
parentComp = new Composite(this, SWT.RESIZE);
GridLayout parentGlyt = new GridLayout();
parentGlyt.numColumns = 1;
parentComp.setLayout(parentGlyt);
GridData gridData = new GridData(GridData.GRAB_HORIZONTAL |
GridData.HORIZONTAL_ALIGN_CENTER |
GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_CENTER
|GridData.FILL_HORIZONTAL |GridData.FILL_VERTICAL);
parentComp.setLayoutData(gridData);
temp = (Vector) Input.clone();
Iterator itr = temp.iterator();
int count = 0;
while (itr.hasNext())
{
if (count == 0)
{
sComp = new ScrolledComposite(parentComp,SWT.V_SCROLL | SWT.H_SCROLL);
parametersGrp = new Group(sComp, SWT.NONE);
sComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL
| GridData.HORIZONTAL_ALIGN_CENTER |
GridData.GRAB_HORIZONTAL |
GridData.VERTICAL_ALIGN_CENTER));
GridLayout parametersGlyt = new GridLayout(2, false);
parametersGlyt.marginWidth = 100;
parametersGrp.setLayout(parametersGlyt);
parametersGrp.setText("Input Parameters");
parametersGrp.setSize(SWT.DEFAULT, 250);
}
//The group is filled in here. very lenghty code so removing it.
count++;
}
if (temp.size() > 0)
{
sComp.setContent(parametersGrp);
sComp.setExpandHorizontal(true);
sComp.setExpandVertical(true);
sComp.setMinSize(230,250);
}
initAdditionalXMLGui(); //this contains gui of other 2 groups.
|
|
|
Re: ScrolledComposite problem. [message #461399 is a reply to message #461375] |
Wed, 21 September 2005 22:48 |
No real name Messages: 97 Registered: July 2009 |
Member |
|
|
"Bhavani" <bhavaniku@gmail.com> wrote in message
news:09a9e2e61e29f879a963440db208a52a$1@www.eclipse.org...
> Hi,
> My scenario is : I have a main composite on which i am placing 3 groups.
> The first group is to be placed in a scrolled composite, since the content
> of this group can be very large at times. The other 2 groups are fixed in
> size.
Current version does not auto resize to the min of content and scrolled
pane. It is in the enhancement request: Bug#: 109375. You can add
your problem there.
Regards.
> Now the problem is the group is not fitting in that scrolledcomposite.
> Here is the code for review.
>
> super(getShell(), SWT.NONE); //extends composite
> this.setLayout(new GridLayout());
> this.setLayoutData(new GridData());
> parentComp = new Composite(this, SWT.RESIZE);
>
> GridLayout parentGlyt = new GridLayout();
> parentGlyt.numColumns = 1;
> parentComp.setLayout(parentGlyt);
> GridData gridData = new GridData(GridData.GRAB_HORIZONTAL |
> GridData.HORIZONTAL_ALIGN_CENTER |
> GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_CENTER
> |GridData.FILL_HORIZONTAL |GridData.FILL_VERTICAL);
> parentComp.setLayoutData(gridData);
> temp = (Vector) Input.clone();
> Iterator itr = temp.iterator();
> int count = 0;
> while (itr.hasNext())
> {
> if (count == 0)
> {
> sComp = new ScrolledComposite(parentComp,SWT.V_SCROLL | SWT.H_SCROLL);
> parametersGrp = new Group(sComp, SWT.NONE);
> sComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL |
> GridData.HORIZONTAL_ALIGN_CENTER |
> GridData.GRAB_HORIZONTAL |
> GridData.VERTICAL_ALIGN_CENTER));
> GridLayout parametersGlyt = new GridLayout(2, false);
> parametersGlyt.marginWidth = 100;
> parametersGrp.setLayout(parametersGlyt);
> parametersGrp.setText("Input Parameters");
> parametersGrp.setSize(SWT.DEFAULT, 250);
> }
> //The group is filled in here. very lenghty code so removing it.
> count++;
> }
> if (temp.size() > 0)
> {
> sComp.setContent(parametersGrp);
> sComp.setExpandHorizontal(true);
> sComp.setExpandVertical(true);
> sComp.setMinSize(230,250);
> }
> initAdditionalXMLGui(); //this contains gui of other 2 groups.
>
|
|
|
Powered by
FUDForum. Page generated in 0.02552 seconds