Tabs using radio button [message #480087] |
Thu, 13 August 2009 18:12 |
Eclipse User |
|
|
|
Originally posted by: rodrigo.garcia.kotasoft.com
Hi,
I'd like to simulate the tabFolder behaviour using radio buttons,
showing a different section or composite depending on the button pressed.
I have been trying with setVisible(false) to hide composites, but a
white space corresponding to this section is shown
Any idea?
Thanks in advance.
|
|
|
|
Re: Tabs using radio button [message #480147 is a reply to message #480091] |
Fri, 14 August 2009 07:16 |
Eclipse User |
|
|
|
Originally posted by: rodrigo.garcia.kotasoft.com
Below is my code, I'm going to try relayout and let you know
steven escribió:
> I can't know the panorama of your program. Maybe you can post some code.
> Try relayout your parent composite or execute update your composite.
>
private void createSectionPieza(IManagedForm mform, String title,
String desc, Composite parent){
final Composite client = createSection(mform, title, desc,
4,parent,0,vehicleKeyNumColumns);
FormToolkit toolkit = mform.getToolkit();
final ScrolledForm form = mform.getForm();
GridData gd=new GridData(SWT.FILL,SWT.TOP,true,false);
Button buttonPCorrecta=toolkit.createButton(
client, CotizacionesMessages.pieza_correcta_label,SWT.RADIO);
buttonPCorrecta.setLayoutData(gd);
buttonPCorrecta.setSelection(true);
Button buttonPDiscontinuada=toolkit.createButton(
client, CotizacionesMessages.pieza_discontinuada_label,SWT.RADIO |
SWT.BOLD);
buttonPDiscontinuada.setLayoutData(gd);
Button buttonPInfoIncompleta=toolkit.createButton(
client, CotizacionesMessages.pieza_info_incompleta_label,SWT.RADIO);
buttonPInfoIncompleta.setLayoutData(gd);
Button buttonPRefAlternativa=toolkit.createButton(
client, CotizacionesMessages.pieza_ref_alternativa_label,SWT.RADIO);
buttonPRefAlternativa.setLayoutData(gd);
// GridData gd=new GridData();
// gd.horizontalSpan=2;
// b.setLayoutData(gd);
createSpacer(toolkit, client, 4);
final Composite
compPiezaCorrecta=createCompositePiezaCorrecta(mform,5, client, 0,4);
// compPiezaCorrecta.setVisible(false);
final Composite
compPiezaDiscontinuada=createCompositePiezaDiscontinuada(mfo rm, 5,
client, 0, 4);
compPiezaDiscontinuada.setVisible(false);
buttonPCorrecta.addSelectionListener(new SelectionListener()
{
@Override
public void widgetDefaultSelected(SelectionEvent e) {}
@Override
public void widgetSelected(SelectionEvent e) {
compPiezaCorrecta.setVisible(true);
compPiezaDiscontinuada.setVisible(false);
});
buttonPDiscontinuada.addSelectionListener(new SelectionListener()
{
@Override
public void widgetDefaultSelected(SelectionEvent e) {}
@Override
public void widgetSelected(SelectionEvent e) {
compPiezaCorrecta.setVisible(false);
compPiezaDiscontinuada.setVisible(true);
}
});
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03053 seconds