# HG changeset patch # User Frank Benoit # Date 1215346919 -7200 # Node ID be3a48f1d5969433f118be39ba1cdcdeff5f3f9d # Parent d4e3f8db85f0823c0d224d62a105c9c16520985f ClipboardExample: reactivate comment functionality and fixed a bug. diff -r d4e3f8db85f0 -r be3a48f1d596 examples/clipboard/ClipboardExample.d --- a/examples/clipboard/ClipboardExample.d Sun Jul 06 14:21:21 2008 +0200 +++ b/examples/clipboard/ClipboardExample.d Sun Jul 06 14:21:59 2008 +0200 @@ -44,6 +44,7 @@ import dwt.dwthelper.utils; import tango.io.Stdout; +version(JIVE) import jive.stacktrace; class ClipboardExample { static const int SIZE = 60; @@ -92,7 +93,7 @@ controlGroup.setLayoutData(data); controlGroup.setLayout(new GridLayout(5, false)); - /* Enable with Available Types * + /* Enable with Available Types */ Group typesGroup = new Group(parent, DWT.NONE); typesGroup.setText("Available Types"); data = new GridData(GridData.FILL_BOTH); @@ -108,15 +109,12 @@ status.setLayoutData(data); createTextTransfer(copyGroup, pasteGroup); - //TODO: Doesn't work -// createRTFTransfer(copyGroup, pasteGroup); + createRTFTransfer(copyGroup, pasteGroup); createHTMLTransfer(copyGroup, pasteGroup); - //TODO: Doesn't work -// createFileTransfer(copyGroup, pasteGroup); + createFileTransfer(copyGroup, pasteGroup); createMyTransfer(copyGroup, pasteGroup); createControlTransfer(controlGroup); - //TODO: Causes Segfault -// createAvailableTypes(typesGroup); + createAvailableTypes(typesGroup); sc.setMinSize(parent.computeSize(DWT.DEFAULT, DWT.DEFAULT)); sc.setExpandHorizontal(true); @@ -299,13 +297,7 @@ if (result !is null && result.length > 0){ //copyFileTable.removeAll(); //This cannot be used - //auto separator = System.getProperty("file.separator"); - version(linux) { - auto separator = "/"; - } - version(Windows) { - auto separator = "\\"; - } + auto separator = tango.io.model.IFile.FileConst.PathSeparatorString; auto path = dialog.getFilterPath(); auto names = dialog.getFileNames(); for (int i = 0; i < names.length; i++) { @@ -462,8 +454,10 @@ data.heightHint = data.widthHint = SIZE; styledText.setLayoutData(data); } + + List list; void createAvailableTypes(Composite parent){ - final List list = new List(parent, DWT.BORDER | DWT.H_SCROLL | DWT.V_SCROLL); + list = new List(parent, DWT.BORDER | DWT.H_SCROLL | DWT.V_SCROLL); GridData data = new GridData(GridData.FILL_BOTH); data.heightHint = 100; list.setLayoutData(data); @@ -481,13 +475,6 @@ } } void main() { - Stdout.formatln( "The ClipboardExample: still work left" ); - Stdout.formatln( "todo: RTF, File Transfer, Available types"); - Stdout.formatln( "line 300, there might be a better way to do" ); - Stdout.formatln( "system independent path seperators in tango" ); - Stdout.formatln( "" ); - - Display display = new Display(); (new ClipboardExample()).open(display); display.dispose();