changeset 109:be3a48f1d596

ClipboardExample: reactivate comment functionality and fixed a bug.
author Frank Benoit <benoit@tionex.de>
date Sun, 06 Jul 2008 14:21:59 +0200
parents d4e3f8db85f0
children cfd5fa2ce475 5fe95b1ccf68
files examples/clipboard/ClipboardExample.d
diffstat 1 files changed, 9 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- 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();