Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » ScrolledComposite & FormLayout
ScrolledComposite & FormLayout [message #299477] Fri, 17 February 2006 17:30 Go to next message
Eclipse UserFriend
Originally posted by: a1dutch.dsl.pipex.com

Having problem with a scollable composite and form layout it wont add the
composite, here's my code can anyone see any probs, thanks

andrew

FormData fd = null;

//shell stuff
Shell s = new Shell(display, SWT.SYSTEM_MODAL | SWT.SINGLE );
s.setLayout(new FormLayout());
s.setMaximized(true);

Color red = display.getSystemColor(SWT.COLOR_RED);
Color blue = display.getSystemColor(SWT.COLOR_BLUE);

ScrolledComposite sc1 = new ScrolledComposite(s, SWT.V_SCROLL |
SWT.BORDER);
Composite c1 = new Composite(sc1, SWT.NONE);
sc1.setContent(c1);

c1.setLayout(new FormLayout());
c1.setBackground(blue);

fd = new FormData();
fd.left = new FormAttachment(0, 00);
fd.right = new FormAttachment(70, 0);
fd.top = new FormAttachment( 0, 0);
fd.bottom = new FormAttachment(70, 0);
c1.setLayoutData(fd);
Re: ScrolledComposite & FormLayout [message #299484 is a reply to message #299477] Fri, 17 February 2006 21:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwpeck.mersoft.com

You set s.setLayout() to a new FormLayout then you added SC1 to that
layout but you never assigned a FormData to SC1. You did assign a
FormData to c1 inside of SC1.

Andrew Holland wrote:
> Having problem with a scollable composite and form layout it wont add the
> composite, here's my code can anyone see any probs, thanks
>
> andrew
>
> FormData fd = null;
>
> //shell stuff
> Shell s = new Shell(display, SWT.SYSTEM_MODAL | SWT.SINGLE );
> s.setLayout(new FormLayout());
> s.setMaximized(true);
>
> Color red = display.getSystemColor(SWT.COLOR_RED);
> Color blue = display.getSystemColor(SWT.COLOR_BLUE);
>
> ScrolledComposite sc1 = new ScrolledComposite(s, SWT.V_SCROLL |
> SWT.BORDER);
> Composite c1 = new Composite(sc1, SWT.NONE);
> sc1.setContent(c1);
>
> c1.setLayout(new FormLayout());
> c1.setBackground(blue);
>
> fd = new FormData();
> fd.left = new FormAttachment(0, 00);
> fd.right = new FormAttachment(70, 0);
> fd.top = new FormAttachment( 0, 0);
> fd.bottom = new FormAttachment(70, 0);
> c1.setLayoutData(fd);
>
>
Re: ScrolledComposite & FormLayout [message #299485 is a reply to message #299484] Fri, 17 February 2006 21:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a1dutch.dsl.pipex.com

ive tried that previously and still dosent work, ive assigned a form data to
the scrolled composite previously and this dos make the scrolled composite
full screen, but it will never let me add the composite to it and is never
displayed

any other ideas?


"Kevin Peck" <kwpeck@mersoft.com> wrote in message
news:dt5fjk$97j$1@utils.eclipse.org...
> You set s.setLayout() to a new FormLayout then you added SC1 to that
> layout but you never assigned a FormData to SC1. You did assign a FormData
> to c1 inside of SC1.
>
> Andrew Holland wrote:
>> Having problem with a scollable composite and form layout it wont add the
>> composite, here's my code can anyone see any probs, thanks
>>
>> andrew
>>
>> FormData fd = null;
>>
>> //shell stuff
>> Shell s = new Shell(display, SWT.SYSTEM_MODAL | SWT.SINGLE );
>> s.setLayout(new FormLayout());
>> s.setMaximized(true);
>>
>> Color red = display.getSystemColor(SWT.COLOR_RED);
>> Color blue = display.getSystemColor(SWT.COLOR_BLUE);
>>
>> ScrolledComposite sc1 = new ScrolledComposite(s, SWT.V_SCROLL |
>> SWT.BORDER);
>> Composite c1 = new Composite(sc1, SWT.NONE);
>> sc1.setContent(c1);
>>
>> c1.setLayout(new FormLayout());
>> c1.setBackground(blue);
>>
>> fd = new FormData();
>> fd.left = new FormAttachment(0, 00);
>> fd.right = new FormAttachment(70, 0);
>> fd.top = new FormAttachment( 0, 0);
>> fd.bottom = new FormAttachment(70, 0);
>> c1.setLayoutData(fd);
Re: ScrolledComposite & FormLayout [message #299487 is a reply to message #299485] Fri, 17 February 2006 22:07 Go to previous message
Eclipse UserFriend
Originally posted by: a1dutch.dsl.pipex.com

heres the code that still dont work if its handy

FormData fd = null;

//shell stuff
Shell s = new Shell(display, SWT.SYSTEM_MODAL | SWT.SINGLE );
s.setLayout(new FormLayout());
s.setMaximized(true);

Color red = display.getSystemColor(SWT.COLOR_RED);
Color blue = display.getSystemColor(SWT.COLOR_BLUE);

//set the size of the scrolled content - method 1
ScrolledComposite sc1 = new ScrolledComposite(s, SWT.V_SCROLL |
SWT.BORDER);
sc1.setLayout(new FormLayout());
sc1.setBackground(red);

fd = new FormData();
fd.left = new FormAttachment(0, 00);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment( 20, 0);
fd.bottom = new FormAttachment(100, 0);
sc1.setLayoutData(fd);

Composite c1 = new Composite(sc1, SWT.NONE);
c1.setLayout(new FormLayout());
c1.setBackground(blue);

fd = new FormData();
fd.left = new FormAttachment(20, 00);
fd.right = new FormAttachment(80, 0);
fd.top = new FormAttachment( 20, 0);
fd.bottom = new FormAttachment(80, 0);
c1.setLayoutData(fd);
sc1.setContent(c1);
Previous Topic:IBM j9 VM as "Installed JRE"
Next Topic:How to add a preference node to ConfigurationScope?
Goto Forum:
  


Current Time: Wed Jan 15 09:38:06 GMT 2025

Powered by FUDForum. Page generated in 0.03451 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top