# HG changeset patch # User Frank Benoit # Date 1225029227 -3600 # Node ID c58389a70da3f05748c5bec99ee5a1917c3d9459 # Parent 33d9146198b2fd864330f743d7fc18a54d537ed2 Added novocode internal shell example, thanks WasserDragoon diff -r 33d9146198b2 -r c58389a70da3 .hgignore --- a/.hgignore Sun Oct 26 14:53:07 2008 +0100 +++ b/.hgignore Sun Oct 26 14:53:47 2008 +0100 @@ -25,6 +25,11 @@ ^jface.text/dsss_imports ^jface.text/Simple$ +^novocode/dsss_objs +^novocode/dsss.last +^novocode/dsss_imports +^novocode/InternalShellExample$ + ^examples/dsss_objs ^examples/dsss.last ^examples/dsss_imports diff -r 33d9146198b2 -r c58389a70da3 novocode/InternalShellExample.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/novocode/InternalShellExample.d Sun Oct 26 14:53:47 2008 +0100 @@ -0,0 +1,48 @@ +module InternalShellExample; + +import dwt.std; +import dwt.dwthelper.ByteArrayInputStream; +import dwtx.novocode.ScaledImage; +import dwtx.novocode.ishell.DesktopForm; +import dwtx.novocode.ishell.InternalShell; + +const char[] res_prefix = "novocode.InternalShellExample."; +void main() { + Display display = new Display(); + Shell shell = new Shell( display ); + shell.setLayout( new FillLayout() ); + shell.setImage( new Image( display, new ImageData( new ByteArrayInputStream( cast( byte[] ) import( res_prefix~"ishell.png" ) ) ) ) ); + shell.setText( "Internal Shell Example" ); + + DesktopForm desktop = new DesktopForm( shell, DWT.NONE ); + + ScaledImage si = new ScaledImage( desktop, DWT.NONE ); + si.setImage( new Image( display, new ImageData( new ByteArrayInputStream( cast( byte[] ) import( res_prefix~"bg.jpg" ) ) ) ) ); + si.setImagePlacement( ScaledImage.IMAGE_PLACEMENT_TILE ); + si.setLocation( 0, 0 ); + si.setSize( desktop.getSize() ); + + desktop.addListener( DWT.Resize, new class( si ) Listener { + ScaledImage si; + this( ScaledImage si ) { + this.si = si; + } + public void handleEvent(Event event) { + si.setSize(desktop.getSize()); + } + }); + + InternalShell ishell = new InternalShell( desktop, DWT.SHELL_TRIM ); + ishell.setText( "Internal Shell" ); + + shell.pack(); + shell.open(); + ishell.open(); + + while ( !shell.isDisposed ) { + if ( !display.readAndDispatch() ) + display.sleep(); + } + + display.dispose(); +} \ No newline at end of file diff -r 33d9146198b2 -r c58389a70da3 novocode/dsss.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/novocode/dsss.conf Sun Oct 26 14:53:47 2008 +0100 @@ -0,0 +1,26 @@ +# DWT dwt-samples/jface directory + +[*] +debugflags+=-g -gc +buildflags+=-J../res +buildflags+=-I../../dwt-addons +buildflags+=-J../../dwt-addons/res + +version(Windows) { + buildflags+=-I../../dwt-win + buildflags+=-J../../dwt-win/res + + # if no console window is wanted/needed use -version=gui + version(gui) { + buildflags+= -L/SUBSYSTEM:windows:5 + } else { + buildflags+= -L/SUBSYSTEM:console:5 + } + buildflags+= -L/rc:..\dwt +} +version(Posix) { + buildflags+=-I../../dwt-linux + buildflags+=-J../../dwt-linux/res +} + +[InternalShellExample.d] diff -r 33d9146198b2 -r c58389a70da3 res/novocode.InternalShellExample.bg.jpg Binary file res/novocode.InternalShellExample.bg.jpg has changed diff -r 33d9146198b2 -r c58389a70da3 res/novocode.InternalShellExample.ishell.png Binary file res/novocode.InternalShellExample.ishell.png has changed