|
Re: Possible Bug in SearchDialogs TabFolderLayout ? [message #456439 is a reply to message #456395] |
Fri, 03 June 2005 16:30 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
You could place the ScrolledComposite inside a Composite before addign it to
the TabFolder.
Give the Composite a GridLayout and for the GridData of the
ScrolledComposite set the widthHint and heightHint to values you feel are
reasonable.
e.g.
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
TabFolder folder = new TabFolder(shell, SWT.NONE);
TabItem item = new TabItem(folder, SWT.NONE);
Composite c = new Composite(folder, SWT.NONE);
item.setControl(c);
GridLayout layout = new GridLayout(1, false);
layout.marginWidth = layout.marginHeight = 0;
c.setLayout(layout);
ScrolledComposite sc = new ScrolledComposite(c, SWT.H_SCROLL |
SWT.V_SCROLL);
GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
data.widthHint = 300;
data.heightHint = 400;
sc.setLayoutData(data);
Label l = new Label(sc, SWT.BORDER | SWT.CENTER);
l.setText("content");
l.setBackground(display.getSystemColor(SWT.COLOR_RED));
l.setSize(600, 800);
sc.setContent(l);
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
"Harald" <harald@docufy.de> wrote in message
news:96593dc5a6b53e7adf1278f4cb2e4a6c$1@www.eclipse.org...
> Hi,
>
> I added a custom ISearchPage into the eclipse SearchDialog. Inside this
> page, search criteria can be added through a button. If more than a number
> of this criterias is added, the page should not resize but offer a
> scrollbar. This works fine as long as the search page is not changed.
> After switching to another page and back, my search page gets the full
> size of the composite inside the scrollbar showing all criteria.
>
> I had a look at SearchDialog and its inner class TabFolderLayout. In its
> computeSize Method TabFolderLayout iterates over all children of a
> composite to determine the size of the biggest child and returns this as
> the size of this composite. But imho, this is not the behavier wanted when
> a ScrolledComposite is involved?
>
> Also does anybody know a way to prevent this behavier for
> ScrolledComposites ?
>
> Harald
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05126 seconds