| ScrolledComposite & FormLayout [message #299477] | 
Fri, 17 February 2006 12:30   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 16:35    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 16:44    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 17:07   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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);
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 1.53701 seconds