Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » ScrolledComposite in a Dialog
ScrolledComposite in a Dialog [message #319429] Mon, 20 August 2007 19:15 Go to next message
Eclipse UserFriend
I have a dialog with enough controls in it that in certain resolutions,
the OK and Cancel button don't appear on the screen.

I've looked at lots of samples and tried lots of variations, but haven't
been able to create a ScrolledComposite within a Dialog that actually
works.

I can create one that has diabled scrollbars, but the scrollbars never
get activated.

Does anyone have a working example of a ScrolledComposite in a Dialog?

Thanks.
Re: ScrolledComposite in a Dialog [message #319443 is a reply to message #319429] Tue, 21 August 2007 09:31 Go to previous messageGo to next message
Eclipse UserFriend
for ScrolledComposite example snippets see
http://www.eclipse.org/swt/snippets#scrolledcomposite

"John Lawrence" <lawrence@us.ibm.com> wrote in message
news:fad79l$rm2$1@build.eclipse.org...
> I have a dialog with enough controls in it that in certain resolutions,
> the OK and Cancel button don't appear on the screen.
>
> I've looked at lots of samples and tried lots of variations, but haven't
> been able to create a ScrolledComposite within a Dialog that actually
> works.
>
> I can create one that has diabled scrollbars, but the scrollbars never
> get activated.
>
> Does anyone have a working example of a ScrolledComposite in a Dialog?
>
> Thanks.
Re: ScrolledComposite in a Dialog [message #319447 is a reply to message #319443] Tue, 21 August 2007 10:51 Go to previous messageGo to next message
Eclipse UserFriend
Grant Gayed wrote:
> for ScrolledComposite example snippets see
> http://www.eclipse.org/swt/snippets#scrolledcomposite
>
> "John Lawrence" <lawrence@us.ibm.com> wrote in message
> news:fad79l$rm2$1@build.eclipse.org...
>> I have a dialog with enough controls in it that in certain resolutions,
>> the OK and Cancel button don't appear on the screen.
>>
>> I've looked at lots of samples and tried lots of variations, but haven't
>> been able to create a ScrolledComposite within a Dialog that actually
>> works.
>>
>> I can create one that has diabled scrollbars, but the scrollbars never
>> get activated.
>>
>> Does anyone have a working example of a ScrolledComposite in a Dialog?
>>
>> Thanks.
>
>
Thanks, Grant. I've seen that page and looked at the examples there.
Those examples, however, don't create the ScrolledComposite within a
dialog. I don't know why there should be a difference, but I'd like to
see some working code that uses a dialog, as I haven't been able to get
that to work.

Thanks.
Re: ScrolledComposite in a Dialog [message #319477 is a reply to message #319447] Wed, 22 August 2007 10:32 Go to previous message
Eclipse UserFriend
Here's a snippet:

public class SampleDialog extends TitleAreaDialog {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
SampleDialog dlg = new SampleDialog(shell);
dlg.open();
display.dispose();
}
public SampleDialog(Shell shell) {
super(shell);
}
protected Control createDialogArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout());
ScrolledComposite c1 = new ScrolledComposite(composite, SWT.BORDER |
SWT.H_SCROLL | SWT.V_SCROLL);
c1.setLayoutData(new GridData(700,700));
Button b1 = new Button(c1, SWT.PUSH);
b1.setText("fixed size button");
b1.setSize(1200, 1200);
c1.setContent(b1);
return composite;
}
}

Grant


"John Lawrence" <lawrence@us.ibm.com> wrote in message
news:46CAFBD4.8090507@us.ibm.com...
> Grant Gayed wrote:
> > for ScrolledComposite example snippets see
> > http://www.eclipse.org/swt/snippets#scrolledcomposite
> >
> > "John Lawrence" <lawrence@us.ibm.com> wrote in message
> > news:fad79l$rm2$1@build.eclipse.org...
> >> I have a dialog with enough controls in it that in certain resolutions,
> >> the OK and Cancel button don't appear on the screen.
> >>
> >> I've looked at lots of samples and tried lots of variations, but
haven't
> >> been able to create a ScrolledComposite within a Dialog that actually
> >> works.
> >>
> >> I can create one that has diabled scrollbars, but the scrollbars never
> >> get activated.
> >>
> >> Does anyone have a working example of a ScrolledComposite in a Dialog?
> >>
> >> Thanks.
> >
> >
> Thanks, Grant. I've seen that page and looked at the examples there.
> Those examples, however, don't create the ScrolledComposite within a
> dialog. I don't know why there should be a difference, but I'd like to
> see some working code that uses a dialog, as I haven't been able to get
> that to work.
>
> Thanks.
Previous Topic:Contribute to Eclipse's Java editor
Next Topic:Open a view relative to the java editor
Goto Forum:
  


Current Time: Sat Nov 08 01:00:25 EST 2025

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

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

Back to the top