Using FormLayout cannot get the actual size(Cond) [message #459342] |
Sat, 06 August 2005 13:47 |
Eclipse User |
|
|
|
Originally posted by: murley.murley.murley
Sorry about forgot to provide source code...
at first i want to describe my layout:
(Actually it divide 3 part horizontally)
--------------------------------------------------------
Menu Bar
--------------------------------------------------------
ToolBar
---------------------------------------------------------
|
SashForm with | SashForm with
Table | Table
|
|
---------------------------------------------------------
ToolBar
---------------------------------------------------------
Then i use FormLayout to do.......
// Composite for Tool Bar
Composite toolBarComposite = new Composite(shell, SWT.NONE);
// MyToolBar is a class that create the items in toolbar
MyToolBar toolBar = new MyToolBar(toolBarComposite);
FormData tbcData = new FormData();
tbcData.left = new FormAttachment(0);
tbcData.right = new FormAttachment(100);
tbcData.top = new FormAttachment(0);
toolBarComposite.setLayoutData(tbcData);
// A separator
Label s = new Label(shell, SWT.SHADOW_OUT | SWT.HORIZONTAL |
SWT.SEPARATOR);
FormData separatorData = new FormData();
separatorData.left = new FormAttachment(toolBarComposite, 0, SWT.LEFT);
separatorData.top = new FormAttachment(toolBarComposite);
separatorData.right = new FormAttachment(100);
s.setLayoutData(separatorData);
SashForm form = new SashForm(shell, SWT.HORIZONTAL);
form.setLayout(new FillLayout());
FormData sashData = new FormData();
sashData.left = new FormAttachment(toolBarComposite, 0, SWT.LEFT);
sashData.top = new FormAttachment(toolBarComposite);
sashData.right = new FormAttachment(100);
sashData.bottom = new FormAttachment(96);
form.setLayoutData(sashData);
// MainView is the class that create the Table view
MainView mainView = new MainView(form);
form.setWeights(new int[]{50, 50});
separatorData = new FormData();
separatorData.left = new FormAttachment(form, 0, SWT.LEFT);
separatorData.top = new FormAttachment(form);
separatorData.right = new FormAttachment(100);
// bottom - the bottom toolbar
Composite bottom = new Composite(shell, SWT.NONE);
bottom.setLayout(new FillLayout());
FormData bottomData = new FormData();
bottomData.left = new FormAttachment(form, 0, SWT.LEFT);
bottomData.top = new FormAttachment(form);
bottomData.right = new FormAttachment(100);
bottomData.bottom = new FormAttachment(100);
bottom.setLayoutData(bottomData);
My problem is...i have a table in sash form, as create the table consider
the size, i want table can completely fit to sash form,
but cannot get the actual size...
hope my explanations clear enough...
thanks
|
|
|
Powered by
FUDForum. Page generated in 0.03124 seconds