Home » Eclipse Projects » Eclipse Platform » WizardPage Refresh
WizardPage Refresh [message #16723] |
Sat, 26 April 2003 15:21  |
Eclipse User |
|
|
|
Originally posted by: a_shishkov.yahoo.com
Hello,
I have a one page wizard with a Combo control and a Composite below that.
Depending on the selection in the Combo, different content is drawn into the
Composite. My problem is that the initial drawing of the Composite (in the
createControl method) works fine, but subsequent drawing (triggered by the
Combo's SelectionListener) has no effect. I have tried disposing of all the
Composite's children before drawing into it, but that just leaves me with an
empty, gray Composite.
My code is something like this:
class ColorSchemaPage extends WizardPage {
// constructor etc.
public void createControl(Composite parent) {
colorsCombo = new Combo(parent, SWT.SINGLE | SWT.READ_ONLY);
// populate the combo
colorsCombo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
String selection =
colorsCombo.getItem(colorsCombo.getSelectionIndex());
Control[] children = colorControl.getChildren();
for (int c=0; c<children.length; c++)
children[c].dispose();
drawSomeStuff(selection, colorControl);
}
});
colorControl = new Composite(parent, SWT.BORDER);
// this works
drawSomeStuff(colorControl);
setControl(parent);
}
}
Any ideas why the composite is not getting redrawn when a new Combo
selection is made? All that happens is the Composite gets cleared and stays
gray. I have found an identical question on the group, which was left
unanswered.
Thanks in advance for any help!
Angel
|
|
|
Re: WizardPage Refresh [message #17639 is a reply to message #16723] |
Sun, 27 April 2003 01:10   |
Eclipse User |
|
|
|
Um, I think you shouldn't need to recreate the widgets in most cases. I think
what you are missing is a call to WizardPage.setPageComplete(boolean) -- give
that a try.
HTH,
Paul K
Angel Shishkov wrote:
> Hello,
>
> I have a one page wizard with a Combo control and a Composite below that.
> Depending on the selection in the Combo, different content is drawn into the
> Composite. My problem is that the initial drawing of the Composite (in the
> createControl method) works fine, but subsequent drawing (triggered by the
> Combo's SelectionListener) has no effect. I have tried disposing of all the
> Composite's children before drawing into it, but that just leaves me with an
> empty, gray Composite.
>
> My code is something like this:
>
> class ColorSchemaPage extends WizardPage {
>
> // constructor etc.
>
> public void createControl(Composite parent) {
>
> colorsCombo = new Combo(parent, SWT.SINGLE | SWT.READ_ONLY);
>
> // populate the combo
>
> colorsCombo.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent e) {
> String selection =
> colorsCombo.getItem(colorsCombo.getSelectionIndex());
>
> Control[] children = colorControl.getChildren();
> for (int c=0; c<children.length; c++)
> children[c].dispose();
>
> drawSomeStuff(selection, colorControl);
> }
> });
>
> colorControl = new Composite(parent, SWT.BORDER);
>
> // this works
> drawSomeStuff(colorControl);
>
> setControl(parent);
> }
> }
>
> Any ideas why the composite is not getting redrawn when a new Combo
> selection is made? All that happens is the Composite gets cleared and stays
> gray. I have found an identical question on the group, which was left
> unanswered.
> Thanks in advance for any help!
>
> Angel
|
|
|
Re: WizardPage Refresh [message #17666 is a reply to message #17639] |
Sun, 27 April 2003 13:31   |
Eclipse User |
|
|
|
Originally posted by: a_shishkov.yahoo.com
Thanks, I tried setPageComplete(true) after I update the Composite but it is
still not refreshed. It seems that anything I draw into that Composite after
I am out of the createControl method does not appear there. This is strange
because I can *remove* widgets from the composite, I can change its
background color, but when I add a widget to it, it does not appear.
Angel
"Paul T. Keyser" <rolarenfan@earthlink.net> wrote in message
news:3EAB664D.4B3010E1@earthlink.net...
> Um, I think you shouldn't need to recreate the widgets in most cases. I
think
> what you are missing is a call to WizardPage.setPageComplete(boolean) --
give
> that a try.
>
> HTH,
> Paul K
>
> Angel Shishkov wrote:
>
> > Hello,
> >
> > I have a one page wizard with a Combo control and a Composite below
that.
> > Depending on the selection in the Combo, different content is drawn into
the
> > Composite. My problem is that the initial drawing of the Composite (in
the
> > createControl method) works fine, but subsequent drawing (triggered by
the
> > Combo's SelectionListener) has no effect. I have tried disposing of all
the
> > Composite's children before drawing into it, but that just leaves me
with an
> > empty, gray Composite.
> >
> > My code is something like this:
> >
> > class ColorSchemaPage extends WizardPage {
> >
> > // constructor etc.
> >
> > public void createControl(Composite parent) {
> >
> > colorsCombo = new Combo(parent, SWT.SINGLE | SWT.READ_ONLY);
> >
> > // populate the combo
> >
> > colorsCombo.addSelectionListener(new SelectionAdapter() {
> > public void widgetSelected(SelectionEvent e) {
> > String selection =
> > colorsCombo.getItem(colorsCombo.getSelectionIndex());
> >
> > Control[] children = colorControl.getChildren();
> > for (int c=0; c<children.length; c++)
> > children[c].dispose();
> >
> > drawSomeStuff(selection, colorControl);
> > }
> > });
> >
> > colorControl = new Composite(parent, SWT.BORDER);
> >
> > // this works
> > drawSomeStuff(colorControl);
> >
> > setControl(parent);
> > }
> > }
> >
> > Any ideas why the composite is not getting redrawn when a new Combo
> > selection is made? All that happens is the Composite gets cleared and
stays
> > gray. I have found an identical question on the group, which was left
> > unanswered.
> > Thanks in advance for any help!
> >
> > Angel
>
|
|
|
Re: WizardPage Refresh [message #17678 is a reply to message #16723] |
Sun, 27 April 2003 14:24   |
Eclipse User |
|
|
|
Originally posted by: a_shishkov.yahoo.com
Fixed it. For those interested, you need to call Composite.layout() whenever
you dynamically add a widget to the composite, outside of the initial
createParts method.
For instance, in my SelectionListener I should be calling
colorControl.layout() after my call to drawSomeStuff.
Angel
"Angel Shishkov" <a_shishkov@yahoo.com> wrote in message
news:b8em4q$2sn$1@rogue.oti.com...
> Hello,
>
> I have a one page wizard with a Combo control and a Composite below that.
> Depending on the selection in the Combo, different content is drawn into
the
> Composite. My problem is that the initial drawing of the Composite (in the
> createControl method) works fine, but subsequent drawing (triggered by the
> Combo's SelectionListener) has no effect. I have tried disposing of all
the
> Composite's children before drawing into it, but that just leaves me with
an
> empty, gray Composite.
>
> My code is something like this:
>
> class ColorSchemaPage extends WizardPage {
>
> // constructor etc.
>
> public void createControl(Composite parent) {
>
> colorsCombo = new Combo(parent, SWT.SINGLE | SWT.READ_ONLY);
>
> // populate the combo
>
> colorsCombo.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent e) {
> String selection =
> colorsCombo.getItem(colorsCombo.getSelectionIndex());
>
> Control[] children = colorControl.getChildren();
> for (int c=0; c<children.length; c++)
> children[c].dispose();
>
> drawSomeStuff(selection, colorControl);
> }
> });
>
> colorControl = new Composite(parent, SWT.BORDER);
>
> // this works
> drawSomeStuff(colorControl);
>
> setControl(parent);
> }
> }
>
> Any ideas why the composite is not getting redrawn when a new Combo
> selection is made? All that happens is the Composite gets cleared and
stays
> gray. I have found an identical question on the group, which was left
> unanswered.
> Thanks in advance for any help!
>
> Angel
>
>
|
|
|
Re: WizardPage Refresh [message #19565 is a reply to message #17678] |
Mon, 28 April 2003 10:43   |
Eclipse User |
|
|
|
Originally posted by: tod_creasey.oti.com
As another note it is usually easier to use setVisible() to get rid of
widgets that you are not currently using but may again (see
TitleAreaDialog).
Tod Creasey
Software Developer
Eclipse Team
"Angel Shishkov" <a_shishkov@yahoo.com> wrote in message
news:b8h76p$gbf$1@rogue.oti.com...
> Fixed it. For those interested, you need to call Composite.layout()
whenever
> you dynamically add a widget to the composite, outside of the initial
> createParts method.
>
> For instance, in my SelectionListener I should be calling
> colorControl.layout() after my call to drawSomeStuff.
>
> Angel
>
> "Angel Shishkov" <a_shishkov@yahoo.com> wrote in message
> news:b8em4q$2sn$1@rogue.oti.com...
> > Hello,
> >
> > I have a one page wizard with a Combo control and a Composite below
that.
> > Depending on the selection in the Combo, different content is drawn into
> the
> > Composite. My problem is that the initial drawing of the Composite (in
the
> > createControl method) works fine, but subsequent drawing (triggered by
the
> > Combo's SelectionListener) has no effect. I have tried disposing of all
> the
> > Composite's children before drawing into it, but that just leaves me
with
> an
> > empty, gray Composite.
> >
> > My code is something like this:
> >
> > class ColorSchemaPage extends WizardPage {
> >
> > // constructor etc.
> >
> > public void createControl(Composite parent) {
> >
> > colorsCombo = new Combo(parent, SWT.SINGLE | SWT.READ_ONLY);
> >
> > // populate the combo
> >
> > colorsCombo.addSelectionListener(new SelectionAdapter() {
> > public void widgetSelected(SelectionEvent e) {
> > String selection =
> > colorsCombo.getItem(colorsCombo.getSelectionIndex());
> >
> > Control[] children = colorControl.getChildren();
> > for (int c=0; c<children.length; c++)
> > children[c].dispose();
> >
> > drawSomeStuff(selection, colorControl);
> > }
> > });
> >
> > colorControl = new Composite(parent, SWT.BORDER);
> >
> > // this works
> > drawSomeStuff(colorControl);
> >
> > setControl(parent);
> > }
> > }
> >
> > Any ideas why the composite is not getting redrawn when a new Combo
> > selection is made? All that happens is the Composite gets cleared and
> stays
> > gray. I have found an identical question on the group, which was left
> > unanswered.
> > Thanks in advance for any help!
> >
> > Angel
> >
> >
>
>
|
|
|
Re: WizardPage Refresh [message #45425 is a reply to message #17666] |
Fri, 23 May 2003 08:56  |
Eclipse User |
|
|
|
Originally posted by: anthony.saucet.freesbee.fr
How do you 'remove' widgets from the composite?
thanks
anthony
Angel Shishkov wrote:
> Thanks, I tried setPageComplete(true) after I update the Composite but it is
> still not refreshed. It seems that anything I draw into that Composite after
> I am out of the createControl method does not appear there. This is strange
> because I can *remove* widgets from the composite, I can change its
> background color, but when I add a widget to it, it does not appear.
> Angel
> "Paul T. Keyser" <rolarenfan@earthlink.net> wrote in message
> news:3EAB664D.4B3010E1@earthlink.net...
> > Um, I think you shouldn't need to recreate the widgets in most cases. I
> think
> > what you are missing is a call to WizardPage.setPageComplete(boolean) --
> give
> > that a try.
> >
> > HTH,
> > Paul K
> >
> > Angel Shishkov wrote:
> >
> > > Hello,
> > >
> > > I have a one page wizard with a Combo control and a Composite below
> that.
> > > Depending on the selection in the Combo, different content is drawn into
> the
> > > Composite. My problem is that the initial drawing of the Composite (in
> the
> > > createControl method) works fine, but subsequent drawing (triggered by
> the
> > > Combo's SelectionListener) has no effect. I have tried disposing of all
> the
> > > Composite's children before drawing into it, but that just leaves me
> with an
> > > empty, gray Composite.
> > >
> > > My code is something like this:
> > >
> > > class ColorSchemaPage extends WizardPage {
> > >
> > > // constructor etc.
> > >
> > > public void createControl(Composite parent) {
> > >
> > > colorsCombo = new Combo(parent, SWT.SINGLE | SWT.READ_ONLY);
> > >
> > > // populate the combo
> > >
> > > colorsCombo.addSelectionListener(new SelectionAdapter() {
> > > public void widgetSelected(SelectionEvent e) {
> > > String selection =
> > > colorsCombo.getItem(colorsCombo.getSelectionIndex());
> > >
> > > Control[] children = colorControl.getChildren();
> > > for (int c=0; c<children.length; c++)
> > > children[c].dispose();
> > >
> > > drawSomeStuff(selection, colorControl);
> > > }
> > > });
> > >
> > > colorControl = new Composite(parent, SWT.BORDER);
> > >
> > > // this works
> > > drawSomeStuff(colorControl);
> > >
> > > setControl(parent);
> > > }
> > > }
> > >
> > > Any ideas why the composite is not getting redrawn when a new Combo
> > > selection is made? All that happens is the Composite gets cleared and
> stays
> > > gray. I have found an identical question on the group, which was left
> > > unanswered.
> > > Thanks in advance for any help!
> > >
> > > Angel
> >
|
|
|
Goto Forum:
Current Time: Sun Jul 06 09:29:38 EDT 2025
Powered by FUDForum. Page generated in 0.03639 seconds
|