Mercurial > projects > dwt-win
diff dwt/dnd/TreeDragSourceEffect.d @ 136:04e357b8343d
DragSource
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 13 Feb 2008 14:24:54 +0100 |
parents | 242e33c0e383 |
children | 45172b7a0ee6 |
line wrap: on
line diff
--- a/dwt/dnd/TreeDragSourceEffect.d Wed Feb 13 04:51:22 2008 +0100 +++ b/dwt/dnd/TreeDragSourceEffect.d Wed Feb 13 14:24:54 2008 +0100 @@ -20,6 +20,9 @@ import dwt.widgets.Tree; import dwt.widgets.TreeItem; +import dwt.dnd.DragSourceEffect; +import dwt.dnd.DragSourceEvent; + /** * This class provides default implementations to display a source image * when a drag is initiated from a <code>Tree</code>. @@ -81,7 +84,7 @@ Image getDragSourceImage(DragSourceEvent event) { if (dragSourceImage !is null) dragSourceImage.dispose(); dragSourceImage = null; - Tree tree = (Tree) control; + Tree tree = cast(Tree) control; TreeItem[] selection = tree.getSelection(); if (selection.length is 0) return null; int treeImageList = OS.SendMessage (tree.handle, OS.TVM_GETIMAGELIST, OS.TVSIL_NORMAL, 0); @@ -89,17 +92,17 @@ int count = Math.min(selection.length, 10); Rectangle bounds = selection[0].getBounds(0); for (int i = 1; i < count; i++) { - bounds = bounds.union(selection[i].getBounds(0)); + bounds = bounds.union_(selection[i].getBounds(0)); } int hDC = OS.GetDC(0); int hDC1 = OS.CreateCompatibleDC(hDC); int bitmap = OS.CreateCompatibleBitmap(hDC, bounds.width, bounds.height); int hOldBitmap = OS.SelectObject(hDC1, bitmap); - RECT rect = new RECT(); + RECT rect; rect.right = bounds.width; rect.bottom = bounds.height; int hBrush = OS.GetStockObject(OS.WHITE_BRUSH); - OS.FillRect(hDC1, rect, hBrush); + OS.FillRect(hDC1, &rect, hBrush); for (int i = 0; i < count; i++) { TreeItem selected = selection[i]; Rectangle cell = selected.getBounds(0);