Changeset 109:be3a48f1d596
- 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
| r78 |
r109 |
|
| 45 | 45 | |
|---|
| 46 | 46 | import tango.io.Stdout; |
|---|
| | 47 | version(JIVE) import jive.stacktrace; |
|---|
| 47 | 48 | |
|---|
| 48 | 49 | class ClipboardExample { |
|---|
| … | … | |
| 93 | 94 | controlGroup.setLayout(new GridLayout(5, false)); |
|---|
| 94 | 95 | |
|---|
| 95 | | /* Enable with Available Types * |
|---|
| | 96 | /* Enable with Available Types */ |
|---|
| 96 | 97 | Group typesGroup = new Group(parent, DWT.NONE); |
|---|
| 97 | 98 | typesGroup.setText("Available Types"); |
|---|
| … | … | |
| 109 | 110 | |
|---|
| 110 | 111 | createTextTransfer(copyGroup, pasteGroup); |
|---|
| 111 | | //TODO: Doesn't work |
|---|
| 112 | | // createRTFTransfer(copyGroup, pasteGroup); |
|---|
| | 112 | createRTFTransfer(copyGroup, pasteGroup); |
|---|
| 113 | 113 | createHTMLTransfer(copyGroup, pasteGroup); |
|---|
| 114 | | //TODO: Doesn't work |
|---|
| 115 | | // createFileTransfer(copyGroup, pasteGroup); |
|---|
| | 114 | createFileTransfer(copyGroup, pasteGroup); |
|---|
| 116 | 115 | createMyTransfer(copyGroup, pasteGroup); |
|---|
| 117 | 116 | createControlTransfer(controlGroup); |
|---|
| 118 | | //TODO: Causes Segfault |
|---|
| 119 | | // createAvailableTypes(typesGroup); |
|---|
| | 117 | createAvailableTypes(typesGroup); |
|---|
| 120 | 118 | |
|---|
| 121 | 119 | sc.setMinSize(parent.computeSize(DWT.DEFAULT, DWT.DEFAULT)); |
|---|
| … | … | |
| 300 | 298 | //copyFileTable.removeAll(); |
|---|
| 301 | 299 | //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; |
|---|
| 309 | 301 | auto path = dialog.getFilterPath(); |
|---|
| 310 | 302 | auto names = dialog.getFileNames(); |
|---|
| … | … | |
| 463 | 455 | styledText.setLayoutData(data); |
|---|
| 464 | 456 | } |
|---|
| | 457 | |
|---|
| | 458 | List list; |
|---|
| 465 | 459 | 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); |
|---|
| 467 | 461 | GridData data = new GridData(GridData.FILL_BOTH); |
|---|
| 468 | 462 | data.heightHint = 100; |
|---|
| … | … | |
| 482 | 476 | } |
|---|
| 483 | 477 | void 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 | | |
|---|
| 491 | 478 | Display display = new Display(); |
|---|
| 492 | 479 | (new ClipboardExample()).open(display); |
|---|