Changeset 39:8ee0dfe6f685
- Timestamp:
- 03/13/08 18:53:38
(4 years ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Snippet134 with non rectangular shell. Some more minor fixes.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r35 |
r39 |
|
| 38 | 38 | [dwtsnippets/menu/Snippet97.d] |
|---|
| 39 | 39 | [dwtsnippets/sash/Snippet107.d] |
|---|
| | 40 | [dwtsnippets/shell/Snippet134.d] |
|---|
| 40 | 41 | [dwtsnippets/styledtext/Snippet163.d] |
|---|
| 41 | 42 | [dwtsnippets/styledtext/Snippet189.d] |
|---|
| r19 |
r39 |
|
| 1 | | /******************************************************************************* |
|---|
| | 1 | /******************************************************************************* |
|---|
| 2 | 2 | * Copyright (c) 2000, 2004 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| … | … | |
| 30 | 30 | import dwt.widgets.ScrollBar; |
|---|
| 31 | 31 | import dwt.widgets.Shell; |
|---|
| | 32 | import dwt.dwthelper.utils; |
|---|
| 32 | 33 | |
|---|
| 33 | 34 | void main () { |
|---|
| r27 |
r39 |
|
| 1 | | /******************************************************************************* |
|---|
| | 1 | /******************************************************************************* |
|---|
| 2 | 2 | * Copyright (c) 2000, 2004 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| … | … | |
| 18 | 18 | * For a list of all SWT example snippets see |
|---|
| 19 | 19 | * http://www.eclipse.org/swt/snippets/ |
|---|
| 20 | | * |
|---|
| | 20 | * |
|---|
| 21 | 21 | * @since 3.0 |
|---|
| 22 | 22 | */ |
|---|
| … | … | |
| 62 | 62 | table.setItemCount (COUNT); |
|---|
| 63 | 63 | auto t = elapsed.stop; |
|---|
| 64 | | label.setText ("Items: " ~ to!(char[])(COUNT) ~ |
|---|
| 65 | | ", Time: " ~ to!(char[])(t) ~ " (ms)"); |
|---|
| | 64 | label.setText ("Items: " ~ to!(char[])(COUNT) ~ |
|---|
| | 65 | ", Time: " ~ to!(char[])(t) ~ " (sec)"); |
|---|
| 66 | 66 | shell.layout (); |
|---|
| 67 | 67 | } |
|---|
| r27 |
r39 |
|
| 1 | | /******************************************************************************* |
|---|
| | 1 | /******************************************************************************* |
|---|
| 2 | 2 | * Copyright (c) 2000, 2004 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| … | … | |
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | module dwtsnippets.tree.Snippet8; |
|---|
| 14 | | |
|---|
| | 14 | |
|---|
| 15 | 15 | /* |
|---|
| 16 | 16 | * Tree example snippet: create a tree (lazy) |
|---|
| … | … | |
| 30 | 30 | import dwt.widgets.TreeItem; |
|---|
| 31 | 31 | |
|---|
| 32 | | import tango.math.Math; |
|---|
| | 32 | import dwt.dwthelper.utils; |
|---|
| 33 | 33 | import tango.io.FilePath; |
|---|
| 34 | 34 | import tango.io.FileRoots; |
|---|
| r32 |
r39 |
|
| 6 | 6 | * |
|---|
| 7 | 7 | * Drag sellected text to a label. |
|---|
| 8 | | * |
|---|
| | 8 | * |
|---|
| 9 | 9 | * Port to the D programming language: |
|---|
| 10 | 10 | * Jesse Phillips <Jesse.K.Phillips+D> gmail.com |
|---|
| … | … | |
| 27 | 27 | import dwt.widgets.Shell; |
|---|
| 28 | 28 | import dwt.widgets.Text; |
|---|
| | 29 | import dwt.dwthelper.utils; |
|---|
| 29 | 30 | |
|---|
| 30 | 31 | import tango.io.Stdout; |
|---|
| … | … | |
| 33 | 34 | auto display = new Display(); |
|---|
| 34 | 35 | auto shell = new Shell(display); |
|---|
| 35 | | |
|---|
| | 36 | |
|---|
| 36 | 37 | auto text = new Text(shell, DWT.BORDER|DWT.SINGLE); |
|---|
| 37 | 38 | |
|---|
| … | … | |
| 42 | 43 | auto source = new DragSource(text, DND.DROP_MOVE | DND.DROP_COPY); |
|---|
| 43 | 44 | source.setTransfer(types); |
|---|
| 44 | | |
|---|
| | 45 | |
|---|
| 45 | 46 | source.addDragListener(new class DragSourceAdapter { |
|---|
| 46 | 47 | public void dragSetData(DragSourceEvent event) { |
|---|