Home » Eclipse Projects » Remote Application Platform (RAP) » How to Resize FillLayout in 2.0?(Converting 1.4 app to 2.0. Browser resize not working.)
| |
Re: How to Resize FillLayout in 2.0? [message #1060217 is a reply to message #1060189] |
Thu, 23 May 2013 14:46 |
Erwin Hogeweg Messages: 37 Registered: July 2009 |
Member |
|
|
Ivan,
Thanks for the reply. It is a bit difficult to post an complete example here because there are quite a few classes involved.
When looking for code to show here I noticed that it is likely not related to the FillLayout, but to the FormLayout. The code below, which is a shameless copy of the sample code, creates a header, a sidebar and a mainArea.
The form shows up correctly, but it won't resize.
Tested with FF-20.0 and Safari, both on Mac.
Any help is highly appreciated.
Kind Regards,
Erwin
private void createContent(Shell shell) {
FormLayout layout = new FormLayout();
shell.setLayout(layout);
Control header = createHeader(shell);
header.setLayoutData(createHeaderFormData());
sidebar = createSidebar(shell, someData);
sidebar.setLayoutData(createSidebarFormData());
mainArea = createMainArea(shell);
mainArea.setLayoutData(createMainAreaFormData());
statusArea = createStatusArea(shell);
statusArea.setLayoutData(createStatusAreaFormData());
}
private FormData createMainAreaFormData() {
FormData data = new FormData();
data.top = new FormAttachment(0, HEADER_HEIGHT + 20);
data.left = new FormAttachment(0, 230 + 10);
data.right = new FormAttachment(100, -20);
data.bottom = new FormAttachment(100, -30);
return data;
}
|
|
|
Re: How to Resize FillLayout in 2.0? [message #1060222 is a reply to message #1060217] |
Thu, 23 May 2013 15:11 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Erwin,
the following code works for me in both RAP 2.0 and 2.1RC1:
public class SimpleEntryPoint extends AbstractEntryPoint {
@Override
public void createContents( Composite parent ) {
parent.setLayout( new FormLayout() );
Composite composite = new Composite( parent, SWT.NONE );
composite.setBackground( parent.getDisplay().getSystemColor(
SWT.COLOR_DARK_CYAN ) );
composite.setLayoutData( createMainAreaFormData() );
}
private FormData createMainAreaFormData() {
FormData data = new FormData();
data.top = new FormAttachment( 0, 50 + 20 );
data.left = new FormAttachment( 0, 230 + 10 );
data.right = new FormAttachment( 100, -20 );
data.bottom = new FormAttachment( 100, -30 );
return data;
}
}
Best,
Ivan
On 5/23/2013 5:46 PM, Erwin Hogeweg wrote:
> Ivan,
>
> Thanks for the reply. It is a bit difficult to post an complete
> example here because there are quite a few classes involved.
>
> When looking for code to show here I noticed that it is likely not
> related to the FillLayout, but to the FormLayout. The code below,
> which is a shameless copy of the sample code, creates a header, a
> sidebar and a mainArea.
>
> The form shows up correctly, but it won't resize.
>
> Tested with FF-20.0 and Safari, both on Mac.
>
> Any help is highly appreciated.
>
>
> Kind Regards,
>
> Erwin
>
> private void createContent(Shell shell) {
> FormLayout layout = new FormLayout();
> shell.setLayout(layout);
> Control header = createHeader(shell);
> header.setLayoutData(createHeaderFormData());
> sidebar = createSidebar(shell, someData);
> sidebar.setLayoutData(createSidebarFormData());
> mainArea = createMainArea(shell);
> mainArea.setLayoutData(createMainAreaFormData());
> statusArea = createStatusArea(shell);
> statusArea.setLayoutData(createStatusAreaFormData());
> }
>
>
> private FormData createMainAreaFormData() {
> FormData data = new FormData();
> data.top = new FormAttachment(0, HEADER_HEIGHT + 20);
> data.left = new FormAttachment(0, 230 + 10);
> data.right = new FormAttachment(100, -20);
> data.bottom = new FormAttachment(100, -30);
> return data;
> }
>
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
| | |
Goto Forum:
Current Time: Thu Apr 25 17:00:57 GMT 2024
Powered by FUDForum. Page generated in 0.03639 seconds
|