[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools] Re: Scrollable Composite for multipage editor
|
Here is what is wrong - I have taken your code and added my comments in
red:
tabFolder_ = new TabFolder(parent, SWT.NONE);
pageBook_ = new PageBook(tabFolder_, SWT.NONE);
// tabFolder_.setLayout(new FillLayout()); <- remove this line - like the ScrolledComposite, the
<- TabFolder lays out its
own children and setting a layout
<- in the TabFolder will either do nothing or cause flash
// Create a page....
//
TabItem propTab = new TabItem(tabFolder_, SWT.NULL);
propTab.setText("Properties");
propTab.setControl(pageBook_);
ScrolledComposite scp = new ScrolledComposite(pageBook_,
SWT.V_SCROLL);
// scp.setLayout(new RowLayout()); <- causes flash
Composite cp = new Composite(scp, SWT.NONE);
scp.setContent(cp);
GridLayout myLayout = new GridLayout();
myLayout.numColumns = 2;
cp.setLayout(myLayout);
// Create controls as children of cp...
//Set the size of the thing being scrolled.
cp.setSize(cp.computeSize(SWT.DEFAULT, SWT.DEFAULT));