Changeset 109:be3a48f1d596

Show
Ignore:
Timestamp:
07/06/08 08:21:59 (5 months ago)
Author:
Frank Benoit <benoit@tionex.de>
Children:

110:cfd5fa2ce475 111:5fe95b1ccf68

branch:
default
Message:

ClipboardExample?: reactivate comment functionality and fixed a bug.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • examples/clipboard/ClipboardExample.d

    r78 r109  
    4545 
    4646import tango.io.Stdout; 
     47version(JIVE) import jive.stacktrace; 
    4748 
    4849class ClipboardExample { 
     
    9394         controlGroup.setLayout(new GridLayout(5, false)); 
    9495 
    95          /* Enable with Available Types * 
     96         /* Enable with Available Types */ 
    9697         Group typesGroup = new Group(parent, DWT.NONE); 
    9798         typesGroup.setText("Available Types"); 
     
    109110 
    110111         createTextTransfer(copyGroup, pasteGroup); 
    111          //TODO: Doesn't work 
    112 //       createRTFTransfer(copyGroup, pasteGroup); 
     112         createRTFTransfer(copyGroup, pasteGroup); 
    113113         createHTMLTransfer(copyGroup, pasteGroup); 
    114          //TODO: Doesn't work 
    115 //       createFileTransfer(copyGroup, pasteGroup); 
     114         createFileTransfer(copyGroup, pasteGroup); 
    116115         createMyTransfer(copyGroup, pasteGroup); 
    117116         createControlTransfer(controlGroup); 
    118          //TODO: Causes Segfault 
    119 //       createAvailableTypes(typesGroup); 
     117         createAvailableTypes(typesGroup); 
    120118 
    121119         sc.setMinSize(parent.computeSize(DWT.DEFAULT, DWT.DEFAULT)); 
     
    300298                         //copyFileTable.removeAll(); 
    301299                         //This cannot be used 
    302                          //auto separator = System.getProperty("file.separator"); 
    303                          version(linux) { 
    304                             auto separator = "/"; 
    305                          } 
    306                          version(Windows) { 
    307                             auto separator = "\\"; 
    308                          } 
     300                         auto separator = tango.io.model.IFile.FileConst.PathSeparatorString; 
    309301                         auto path = dialog.getFilterPath(); 
    310302                         auto names = dialog.getFileNames(); 
     
    463455         styledText.setLayoutData(data); 
    464456    } 
     457 
     458    List list; 
    465459    void createAvailableTypes(Composite parent){ 
    466          final List list = new List(parent, DWT.BORDER | DWT.H_SCROLL | DWT.V_SCROLL); 
     460         list = new List(parent, DWT.BORDER | DWT.H_SCROLL | DWT.V_SCROLL); 
    467461         GridData data = new GridData(GridData.FILL_BOTH); 
    468462         data.heightHint = 100; 
     
    482476} 
    483477void main() { 
    484      Stdout.formatln( "The ClipboardExample: still work left" ); 
    485     Stdout.formatln( "todo: RTF, File Transfer, Available types"); 
    486     Stdout.formatln( "line 300, there might be a better way to do" ); 
    487     Stdout.formatln( "system independent path seperators in tango" ); 
    488     Stdout.formatln( "" ); 
    489  
    490  
    491478    Display display = new Display(); 
    492479    (new ClipboardExample()).open(display);