Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWT.DROP_DOWN style has no effect on DateTime widget #16

Open
jacob-carlborg opened this issue Feb 21, 2014 · 0 comments
Open

SWT.DROP_DOWN style has no effect on DateTime widget #16

jacob-carlborg opened this issue Feb 21, 2014 · 0 comments

Comments

@jacob-carlborg
Copy link
Member

Under Windows 7 64bit Enterprise the SWT.DROP_DOWN style has no effect on the DateTime widget. The widget does not show the date in a combo box with a dropdown button. It shows in the default with the up/down spin buttons that are found on the Spin widget.

Below is a slightly modified version of Snippet250 to test out this issue.

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.DateTime;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import java.lang.all;

version(Tango){
    import tango.io.Stdout;
} else { // Phobos
    import std.stdio;
}

void main () {
    Display display = new Display ();
    Shell shell = new Shell (display);
    shell.setLayout (new RowLayout ());

    DateTime calendar = new DateTime (shell, SWT.CALENDAR);
    calendar.addSelectionListener (new class SelectionAdapter{
        override
        void widgetSelected (SelectionEvent e) {
            version(Tango){
                Stdout("calendar date changed\n");
                Stdout.flush();
            } else { // Phobos
                writeln("calendar date changed");
            }
        }
    });

    DateTime date = new DateTime (shell, SWT.BORDER | SWT.DATE | SWT.DROP_DOWN);
    date.addSelectionListener (new class SelectionAdapter{
        override
        void widgetSelected (SelectionEvent e) {
            version(Tango){
                Stdout("date changed\n");
                Stdout.flush();
            } else { // Phobos
                writeln("date changed");
            }
        }
    });   
    DateTime time = new DateTime (shell, SWT.TIME);
    time.addSelectionListener (new class SelectionAdapter{
        override
        void widgetSelected (SelectionEvent e) {
            version(Tango){
                Stdout("time changed\n");
                Stdout.flush();
            } else { // Phobos
                writeln("time changed");
            }
        }
    });

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

I have tried it with and without the border even tried it with just SWT.DROP_DOWN style and that did not work either. This is not a critical issue I just wanted to bring it to someones attention. I am not sure what version of SWT DWT is based on these days so I don't know what version of DWT I have. I just downloaded a fresh copy of DWT a couple of weeks ago.

I am using dmd v2.064 and rdmd build 20131011

I compiled the code above with the following line from my install of dwt directory.

rdmd build swtsnippets[Snippet250]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant