# HG changeset patch # User Frank Benoit # Date 1204853126 -3600 # Node ID 8c8547842065fb332b17825f022eb54369e1c2f7 # Parent 200a229be5ca5fd351661c296e8d7bc64249cd7d Fix: version statement diff -r 200a229be5ca -r 8c8547842065 dwtexamples/clipboard/ClipboardExample.d --- a/dwtexamples/clipboard/ClipboardExample.d Tue Mar 04 15:57:21 2008 -0800 +++ b/dwtexamples/clipboard/ClipboardExample.d Fri Mar 07 02:25:26 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -11,7 +11,7 @@ * Jesse Phillips gmail.com *******************************************************************************/ module dwtexamples.clipboard; - + import dwt.DWT; import dwt.custom.ScrolledComposite; import dwt.custom.StyledText; @@ -60,37 +60,37 @@ Combo combo; StyledText styledText; Label status; - + public void open(Display display) { clipboard = new Clipboard(display); shell = new Shell (display); shell.setText("DWT Clipboard"); shell.setLayout(new FillLayout()); - + ScrolledComposite sc = new ScrolledComposite(shell, DWT.H_SCROLL | DWT.V_SCROLL); Composite parent = new Composite(sc, DWT.NONE); sc.setContent(parent); parent.setLayout(new GridLayout(2, true)); - + Group copyGroup = new Group(parent, DWT.NONE); copyGroup.setText("Copy From:"); GridData data = new GridData(GridData.FILL_BOTH); copyGroup.setLayoutData(data); copyGroup.setLayout(new GridLayout(3, false)); - + Group pasteGroup = new Group(parent, DWT.NONE); pasteGroup.setText("Paste To:"); data = new GridData(GridData.FILL_BOTH); pasteGroup.setLayoutData(data); pasteGroup.setLayout(new GridLayout(3, false)); - + Group controlGroup = new Group(parent, DWT.NONE); controlGroup.setText("Control API:"); data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; controlGroup.setLayoutData(data); controlGroup.setLayout(new GridLayout(5, false)); - + /* Enable with Available Types * Group typesGroup = new Group(parent, DWT.NONE); typesGroup.setText("Available Types"); @@ -99,13 +99,13 @@ typesGroup.setLayoutData(data); typesGroup.setLayout(new GridLayout(2, false)); /**/ - + status = new Label(parent, DWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 2; data.heightHint = 60; status.setLayoutData(data); - + createTextTransfer(copyGroup, pasteGroup); //TODO: Doesn't work // createRTFTransfer(copyGroup, pasteGroup); @@ -116,11 +116,11 @@ createControlTransfer(controlGroup); //TODO: Causes Segfault // createAvailableTypes(typesGroup); - + sc.setMinSize(parent.computeSize(DWT.DEFAULT, DWT.DEFAULT)); sc.setExpandHorizontal(true); sc.setExpandVertical(true); - + Point size = shell.computeSize(DWT.DEFAULT, DWT.DEFAULT); Rectangle monitorArea = shell.getMonitor().getClientArea(); shell.setSize(Math.min(size.x, monitorArea.width - 20), Math.min(size.y, monitorArea.height - 20)); @@ -131,7 +131,7 @@ clipboard.dispose(); } void createTextTransfer(Composite copyParent, Composite pasteParent) { - + // TextTransfer Label l = new Label(copyParent, DWT.NONE); l.setText("TextTransfer:"); //$NON-NLS-1$ @@ -157,7 +157,7 @@ } } }); - + l = new Label(pasteParent, DWT.NONE); l.setText("TextTransfer:"); //$NON-NLS-1$ pasteText = new Text(pasteParent, DWT.READ_ONLY | DWT.MULTI | DWT.BORDER | DWT.V_SCROLL | DWT.H_SCROLL); @@ -205,7 +205,7 @@ } } }); - + l = new Label(pasteParent, DWT.NONE); l.setText("RTFTransfer:"); //$NON-NLS-1$ pasteRtfText = new Text(pasteParent, DWT.READ_ONLY | DWT.MULTI | DWT.BORDER | DWT.V_SCROLL | DWT.H_SCROLL); @@ -252,7 +252,7 @@ } } }); - + l = new Label(pasteParent, DWT.NONE); l.setText("HTMLTransfer:"); //$NON-NLS-1$ pasteHtmlText = new Text(pasteParent, DWT.READ_ONLY | DWT.MULTI | DWT.BORDER | DWT.V_SCROLL | DWT.H_SCROLL); @@ -277,18 +277,18 @@ //File Transfer Label l = new Label(copyParent, DWT.NONE); l.setText("FileTransfer:"); //$NON-NLS-1$ - + Composite c = new Composite(copyParent, DWT.NONE); c.setLayout(new GridLayout(2, false)); GridData data = new GridData(GridData.FILL_HORIZONTAL); c.setLayoutData(data); - + copyFileTable = new Table(c, DWT.MULTI | DWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); data.heightHint = data.widthHint = SIZE; data.horizontalSpan = 2; copyFileTable.setLayoutData(data); - + Button b = new Button(c, DWT.PUSH); b.setText("Select file(s)"); b.addSelectionListener(new class SelectionAdapter { @@ -302,7 +302,7 @@ version(linux) { auto separator = "/"; } - version(win32) { + version(Windows) { auto separator = "\\"; } auto path = dialog.getFilterPath(); @@ -327,7 +327,7 @@ } } }); - + b = new Button(copyParent, DWT.PUSH); b.setText("Copy"); b.addSelectionListener(new class SelectionAdapter { @@ -349,7 +349,7 @@ } } }); - + l = new Label(pasteParent, DWT.NONE); l.setText("FileTransfer:"); //$NON-NLS-1$ pasteFileTable = new Table(pasteParent, DWT.MULTI | DWT.BORDER); @@ -372,7 +372,7 @@ status.setText("nothing to paste"); } } - }); + }); } void createMyTransfer(Composite copyParent, Composite pasteParent){ // MyType Transfer @@ -406,7 +406,7 @@ GridData data = new GridData(GridData.FILL_HORIZONTAL); data.heightHint = data.widthHint = SIZE; text.setLayoutData(data); - + l = new Label(parent, DWT.NONE); l.setText("Combo:"); b = new Button(parent, DWT.PUSH); @@ -437,7 +437,7 @@ str[2] = "Item 3"; str[3] = "A longer Item"; combo.setItems(str); - + l = new Label(parent, DWT.NONE); l.setText("StyledText:"); l = new Label(parent, DWT.NONE);