[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform] Re: ScrolledComposite in a Dialog

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@xxxxxxxxxx> wrote in message
news:46CAFBD4.8090507@xxxxxxxxxxxxx
> Grant Gayed wrote:
> > for ScrolledComposite example snippets see
> > http://www.eclipse.org/swt/snippets#scrolledcomposite
> >
> > "John Lawrence" <lawrence@xxxxxxxxxx> wrote in message
> > news:fad79l$rm2$1@xxxxxxxxxxxxxxxxxxxx
> >> 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.