Mercurial > projects > dwt-win
changeset 146:c605bf6c2f48
TableDragSourceEffect
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 13 Feb 2008 16:55:45 +0100 |
parents | 82d3cef3912d |
children | cf66b1446ffe |
files | dsss.conf dwt/dnd/TableDragSourceEffect.d |
diffstat | 2 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/dsss.conf Wed Feb 13 16:50:35 2008 +0100 +++ b/dsss.conf Wed Feb 13 16:55:45 2008 +0100 @@ -3,7 +3,6 @@ [dwt] type=library debugflags+=-g -gc -debug -exclude=dwt/dnd [simple.d]
--- a/dwt/dnd/TableDragSourceEffect.d Wed Feb 13 16:50:35 2008 +0100 +++ b/dwt/dnd/TableDragSourceEffect.d Wed Feb 13 16:55:45 2008 +0100 @@ -23,6 +23,8 @@ import dwt.dnd.DragSourceEffect; import dwt.dnd.DragSourceEvent; +import dwt.dwthelper.utils; + /** * This class provides default implementations to display a source image * when a drag is initiated from a <code>Table</code>. @@ -93,22 +95,22 @@ 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.makeUnion(selection[i].getBounds(0)); } auto hDC = OS.GetDC(null); auto hDC1 = OS.CreateCompatibleDC(hDC); auto bitmap = OS.CreateCompatibleBitmap(hDC, bounds.width, bounds.height); auto 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); + auto hBrush = OS.GetStockObject(OS.WHITE_BRUSH); + OS.FillRect(hDC1, &rect, hBrush); for (int i = 0; i < count; i++) { TableItem selected = selection[i]; Rectangle cell = selected.getBounds(0); - POINT pt = new POINT(); - int imageList = OS.SendMessage (table.handle, OS.LVM_CREATEDRAGIMAGE, table.indexOf(selected), pt); + POINT pt; + HANDLE imageList = cast(HANDLE) OS.SendMessage (table.handle, OS.LVM_CREATEDRAGIMAGE, table.indexOf(selected), &pt); OS.ImageList_Draw(imageList, 0, hDC1, cell.x - bounds.x, cell.y - bounds.y, OS.ILD_SELECTED); OS.ImageList_Destroy(imageList); }