www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.dwt - Scale not shown

reply yidabu <yidabu.spam gmail.com> writes:
dwt-samples\jface\ShowFieldPrefs.d works fine before. but I build it today with
same command, the Scale widget not shown.

I create a test code, Scale not shown:


import dwt.DWT;
import dwt.events.SelectionAdapter;
import dwt.events.SelectionEvent;
import dwt.widgets.Display;
import dwt.widgets.Shell;
import dwt.widgets.Scale;
import dwt.widgets.Slider;

import dwt.dwthelper.utils;
import tango.util.log.Trace;

void main()
{
    SliderTest.main(null);
}

public class SliderTest {

    public static void main(String[] args) {
        Display display = new Display();
        Shell shell = new Shell(display);
        
        //Slider
        /*
        final Slider slider = new Slider(shell, DWT.HORIZONTAL);
        slider.setBounds(10, 10, 200, 32);
        slider.setMinimum(0);
        slider.setMaximum(100);
        slider.setThumb(5);
        slider.addSelectionListener(new class() SelectionAdapter {
            public void widgetSelected(SelectionEvent e) {
                Trace.formatln("Slider Selection: {}" ,slider.getSelection());
            }
        });
        */
        
        //Scale
        final Scale scale = new Scale(shell, DWT.HORIZONTAL);
        scale.setBounds(10, 50, 200, 72, 0,true);
        scale.setMinimum(0);
        scale.setMaximum(100);
        scale.addSelectionListener(new class SelectionAdapter {
            public void widgetSelected(SelectionEvent e) {
                Trace.formatln("Scale Selection:{}" , scale.getSelection());
            }
        });

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


build command:
dmd test.d dwt.res -L/SUBSYSTEM:windows:5 -L/rc:dwt.res -JD:\dwt-samples\res
-JD:\dwt-addons\res

tested with DMD 1.028, dwt-win svn, dwtx svn, 



-- 
yidabu <yidabu.spam gmail.com>
http://www.dsource.org/projects/dwin

D ÓïÑÔ-ÖÐÎÄ(D Chinese):
http://www.d-programming-language-china.org/
http://bbs.d-programming-language-china.org/
http://dwin.d-programming-language-china.org/
http://scite4d.d-programming-language-china.org/
Jun 19 2008
next sibling parent Tower Ty <tytower hotmail.com.au> writes:
yidabu Wrote:

 
 
 dwt-samples\jface\ShowFieldPrefs.d works fine before. but I build it today
with same command, the Scale widget not shown.
 
 I create a test code, Scale not shown:
You seem to have one on top of the other Try this module SliderTest; import dwt.DWT; import dwt.events.SelectionAdapter; import dwt.events.SelectionEvent; import dwt.widgets.Display; import dwt.widgets.Shell; import dwt.widgets.Scale; import dwt.widgets.Slider; import dwt.dwthelper.utils; import tango.util.log.Trace; void main() { SliderTest.main(null); } public class SliderTest { public static void main(char[][] args) { Display display = new Display(); Shell shell = new Shell(display); //Slider final Slider slider = new Slider(shell, DWT.HORIZONTAL); slider.setBounds(50, 50, 200, 32); slider.setMinimum(0); slider.setMaximum(100); slider.setThumb(5); slider.addSelectionListener(new class() SelectionAdapter { public void widgetSelected(SelectionEvent e) { Trace.formatln("Slider Selection: {}" ,slider.getSelection()); } }); //Scale final Scale scale = new Scale(shell, DWT.HORIZONTAL); scale.setBounds(10, 50, 200, 72, 0,true); scale.setMinimum(0); scale.setMaximum(100); scale.addSelectionListener(new class SelectionAdapter { public void widgetSelected(SelectionEvent e) { Trace.formatln("Scale Selection:{}" , scale.getSelection()); } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
Jun 19 2008
prev sibling parent reply yidabu <yidabu.spam gmail.com> writes:
Simple one, Snippet45,not work correctly too:

import dwt.DWT;
import dwt.widgets.Display;
import dwt.widgets.Shell;
import dwt.widgets.Scale;

import dwt.dwthelper.utils;


public static void main (String [] args) {
	Display display = new Display ();
	Shell shell = new Shell (display);
	Scale scale = new Scale (shell, DWT.BORDER);
	scale.setSize (200, 64);
	scale.setMaximum (40);
	scale.setPageIncrement (5);
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}



-- 
yidabu <yidabu.spam gmail.com>
http://www.dsource.org/projects/dwin

D ÓïÑÔ-ÖÐÎÄ(D Chinese):
http://www.d-programming-language-china.org/
http://bbs.d-programming-language-china.org/
http://dwin.d-programming-language-china.org/
http://scite4d.d-programming-language-china.org/
Jun 19 2008
parent reply Frank Benoit <keinfarbton googlemail.com> writes:
Was that going to brake with my commit rev 237:e2affbeb686d from yesterday?
Jun 19 2008
parent reply Frank Benoit <keinfarbton googlemail.com> writes:
Frank Benoit schrieb:
 Was that going to brake with my commit rev 237:e2affbeb686d from yesterday?
hm, no. last good rev is 212:ab60f3309436 It was introduced with the 3.4M7 update.
Jun 19 2008
parent Frank Benoit <keinfarbton googlemail.com> writes:
Frank Benoit schrieb:
 Frank Benoit schrieb:
 Was that going to brake with my commit rev 237:e2affbeb686d from 
 yesterday?
hm, no. last good rev is 212:ab60f3309436 It was introduced with the 3.4M7 update.
Fixed now. Thanks for the report.
Jun 19 2008