Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Expandable Group Widget


Hello again, Benoit.
If you need to emulate this behavior before the 'expandable group' widget exists, here is a snippet that shows how to do it using a FormLayout.
Carolyn

import org.eclipse.swt.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class DetailsButtonTest {
        static Display display;
        static Shell shell;

        public static void main(String[] args) {
                display = new Display();
                shell = new Shell(display);
                shell.setLayout (new FormLayout());

                Button button = new Button(shell, SWT.PUSH);
                button.setText(">>");
                FormData data = "">new FormData ();
                data.right = new FormAttachment (100, -4);
                data.top = new FormAttachment (0, 4);
                button.setLayoutData (data);

                final Composite composite = new Composite(shell, SWT.BORDER);
                final FormData down = new FormData ();
                down.left = new FormAttachment (0, 4);
                down.right = new FormAttachment (100, -4);
                down.top = new FormAttachment (button, 4, SWT.BOTTOM);
                down.bottom = new FormAttachment (100, -4);
                final FormData up = new FormData ();
                up.left = new FormAttachment (0);
                up.right = new FormAttachment (0);
                up.top = new FormAttachment (0);
                up.bottom = new FormAttachment (0);
                composite.setLayoutData (up);

                button.addSelectionListener(new SelectionAdapter() {
                        public void widgetSelected(SelectionEvent e) {
                                if (composite.getLayoutData() == up) {
                                        composite.setLayoutData (down);
                                } else {
                                        composite.setLayoutData (up);
                                }
                                shell.layout(true, true);
                        }
                });

                shell.setSize (400, 300);
                shell.open ();

                while (!shell.isDisposed ()) {
                        if (!display.readAndDispatch ())
                                display.sleep ();
                }
                display.dispose ();
        }
}





Steve Northover/Ottawa/IBM@IBMCA
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx

04/06/2005 10:59 AM

Please respond to
"Eclipse Platform SWT component developers list."

To
Benoit Sauvé <benoit.sauve2@xxxxxxxxx>, "Eclipse Platform SWT component developers list." <platform-swt-dev@xxxxxxxxxxx>
cc
Subject
Re: [platform-swt-dev] Expandable Group Widget






Hello Benoit!


We are API frozen for M6 so nothing will be released for 3.1.  Please add yourself to https://bugs.eclipse.org/bugs/show_bug.cgi?id=83431and ask the there.


Steve


Benoit Sauvé <benoit.sauve2@xxxxxxxxx>
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx

04/05/2005 10:00 PM

Please respond to
Benoit Sauvé and "Eclipse Platform SWT component developers list."

To
platform-swt-dev@xxxxxxxxxxx
cc
Subject
[platform-swt-dev] Expandable Group Widget







Hi !

I'm newbi on this post list. I want to have informations about the
expandable group widget that was a investigation on the last SWT
milestone plan.

Me and my university school team are working on a final project and we
use SWT. We have a need for a widget like this. Does it will be done
eventually ? Maybe we should help to develop it or something like that
?

Please anyone can give me informations about that !

Thank you so much

Benoit Sauvé
Computer Engineering
University of Sherbrooke, Québec, Canada
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top