Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ScrolledComposite WizardPage Problem
ScrolledComposite WizardPage Problem [message #459326] Fri, 05 August 2005 16:06 Go to next message
Eclipse UserFriend
Originally posted by: p.clark.mindspring.com

I am having a problem trying to scroll a wizard page. All I get is a
blank page when the wizard page is generated. Here are the snippets of
the Wizard and the WizardPage.

Any help around why I can't scroll a wizard page would be greatly
appreciated.

Thanks!
Patrick

public class SnippetWizardPage extends WizardPage {

protected SnippetWizardPage(String pageName) {
super(pageName);
setTitle("Testing ScrolledComposite");
}

public void createControl(Composite parent) {
ScrolledComposite scroll = new ScrolledComposite(parent,
SWT.H_SCROLL | SWT.V_SCROLL);
scroll.getVerticalBar().setIncrement(20);
scroll.setLayout(new FillLayout());
Composite container = new Composite(scroll, SWT.NONE);
scroll.setContent(container);

GridLayout pageLayout = new GridLayout();
pageLayout.numColumns = 2;
container.setLayout(pageLayout);
container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

for (int x=0; x<30; x++) {
Label label = new Label(container, SWT.NONE);
label.setText("testing...");
label = new Label(container, SWT.NONE);
label.setText("testing...");
}

setControl(scroll);
}

}

public class SnippetWizard extends Wizard {

private SnippetWizardPage page1 = new SnippetWizardPage("page1");

public SnippetWizard() {
super();
}

public void addPages() {

addPage(page1);

this.setDefaultPageImageDescriptor(ImageDescriptor.createFro mFile(SelectImportServerWizardPage.class,
"/userimportlarge.gif"));
}

/*
* (non-Javadoc)
*
* @see org.eclipse.jface.wizard.IWizard#performFinish()
*/
public boolean performFinish() {
return true;
}

}
Re: ScrolledComposite WizardPage Problem [message #459332 is a reply to message #459326] Fri, 05 August 2005 18:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Patrick Clark" <p.clark@mindspring.com> wrote in message
news:dd02qm$ij5$1@news.eclipse.org...
>I am having a problem trying to scroll a wizard page. All I get is a blank
>page when the wizard page is generated. Here are the snippets of the
>Wizard and the WizardPage.
>
[snip]
> scroll.setLayout(new FillLayout());
> Composite container = new Composite(scroll, SWT.NONE);
[snip]
> container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
>
[snip]

This doesn't look right to me.
---
Sunil
Re: ScrolledComposite WizardPage Problem [message #459341 is a reply to message #459326] Sat, 06 August 2005 11:49 Go to previous message
Eclipse UserFriend
Originally posted by: BertinK.tiscali.nl

Patrick Clark wrote:
> I am having a problem trying to scroll a wizard page. All I get is a
> blank page when the wizard page is generated. Here are the snippets of
> the Wizard and the WizardPage.
>
> Any help around why I can't scroll a wizard page would be greatly
> appreciated.
>
> Thanks!
> Patrick
>
> public class SnippetWizardPage extends WizardPage {
>
> protected SnippetWizardPage(String pageName) {
> super(pageName);
> setTitle("Testing ScrolledComposite");
> }
>
> public void createControl(Composite parent) {
> ScrolledComposite scroll = new ScrolledComposite(parent,
> SWT.H_SCROLL | SWT.V_SCROLL);
> scroll.getVerticalBar().setIncrement(20);
> scroll.setLayout(new FillLayout());
> Composite container = new Composite(scroll, SWT.NONE);
> scroll.setContent(container);
>
> GridLayout pageLayout = new GridLayout();
> pageLayout.numColumns = 2;
> container.setLayout(pageLayout);
> container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
>
> for (int x=0; x<30; x++) {
> Label label = new Label(container, SWT.NONE);
> label.setText("testing...");
> label = new Label(container, SWT.NONE);
> label.setText("testing...");
> }
>
> setControl(scroll);
> }
>
> }
>
> public class SnippetWizard extends Wizard {
>
> private SnippetWizardPage page1 = new SnippetWizardPage("page1");
>
> public SnippetWizard() {
> super();
> }
>
> public void addPages() {
>
> addPage(page1);
>
> this.setDefaultPageImageDescriptor(ImageDescriptor.createFro mFile(SelectImportServerWizardPage.class,
>
> "/userimportlarge.gif"));
> }
>
> /*
> * (non-Javadoc)
> *
> * @see org.eclipse.jface.wizard.IWizard#performFinish()
> */
> public boolean performFinish() {
> return true;
> }
>
> }
after adding the components to the inner composite I call the next two
lines to make things visible. So this will be after you added the labels

scrolledComposite.setMinSize(innerComposite.computeSize(SWT. DEFAULT,SWT.DEFAULT));
innercomposite.layout();
Previous Topic:TreeItem.setExpanded() not showing the desired effect
Next Topic:Using FormLayout cannot get the actual size(Cond)
Goto Forum:
  


Current Time: Mon Oct 26 19:16:25 GMT 2020

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

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

Back to the top