|
Re: form body [message #261328 is a reply to message #261311] |
Tue, 13 July 2004 21:43 |
Michal Tkacz Messages: 105 Registered: July 2009 |
Senior Member |
|
|
Tal wrote:
> Hi,
> I tried the follwing code in an editorPart.
> A form was constructed with a title and the background of the body but I
> couldn't add any controls to the body :(
> Any suggestions?
>
> public void createPartControl(Composite parent) {
> GridLayout gl = new GridLayout();
>
> toolkit = new FormToolkit(parent.getDisplay());
> Form form = toolkit.createForm(parent);
> form.setText("Version Properties");
> form.getBody().setLayoutData(gl);
> toolkit.createButton(form.getBody(), "Checkbox", SWT.CHECK);
> form.getBody().setBackground(new Color(parent.getDisplay(),100,100,100));
> // Hyperlink link =
> toolkit.createHyperlink(form.getBody(),"moo",SWT.WRAP);
> }
> Tal.
>
Hello Tal,
You forgot to set the layout for the form body. E.g:
public void createPartControl(Composite parent) {
GridLayout gl = new GridLayout();
toolkit = new FormToolkit(parent.getDisplay());
Form form = toolkit.createForm(parent);
form.setText("Version Properties");
form.getBody().setLayoutData(gl);
form.getBody().setLayout(new RowLayout(SWT.VERTICAL)); // <----
toolkit.createButton(form.getBody(), "Checkbox", SWT.CHECK);
form.getBody().setBackground(new Color(parent.getDisplay(),100,100,100));
// Hyperlink link =
toolkit.createHyperlink(form.getBody(),"moo",SWT.WRAP);
}
Regards,
Michal Tkacz
|
|
|
Powered by
FUDForum. Page generated in 0.02713 seconds