Changeset 146:c605bf6c2f48
- Timestamp:
- 02/13/08 10:55:45
(7 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
TableDragSourceEffect?
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r135 |
r146 |
|
| 4 | 4 | type=library |
|---|
| 5 | 5 | debugflags+=-g -gc -debug |
|---|
| 6 | | exclude=dwt/dnd |
|---|
| 7 | 6 | |
|---|
| 8 | 7 | |
|---|
| r136 |
r146 |
|
| 23 | 23 | import dwt.dnd.DragSourceEffect; |
|---|
| 24 | 24 | import dwt.dnd.DragSourceEvent; |
|---|
| | 25 | |
|---|
| | 26 | import dwt.dwthelper.utils; |
|---|
| 25 | 27 | |
|---|
| 26 | 28 | /** |
|---|
| … | … | |
| 94 | 96 | Rectangle bounds = selection[0].getBounds(0); |
|---|
| 95 | 97 | for (int i = 1; i < count; i++) { |
|---|
| 96 | | bounds = bounds.union_(selection[i].getBounds(0)); |
|---|
| | 98 | bounds = bounds.makeUnion(selection[i].getBounds(0)); |
|---|
| 97 | 99 | } |
|---|
| 98 | 100 | auto hDC = OS.GetDC(null); |
|---|
| … | … | |
| 100 | 102 | auto bitmap = OS.CreateCompatibleBitmap(hDC, bounds.width, bounds.height); |
|---|
| 101 | 103 | auto hOldBitmap = OS.SelectObject(hDC1, bitmap); |
|---|
| 102 | | RECT rect = new RECT(); |
|---|
| | 104 | RECT rect; |
|---|
| 103 | 105 | rect.right = bounds.width; |
|---|
| 104 | 106 | rect.bottom = bounds.height; |
|---|
| 105 | | int hBrush = OS.GetStockObject(OS.WHITE_BRUSH); |
|---|
| 106 | | OS.FillRect(hDC1, rect, hBrush); |
|---|
| | 107 | auto hBrush = OS.GetStockObject(OS.WHITE_BRUSH); |
|---|
| | 108 | OS.FillRect(hDC1, &rect, hBrush); |
|---|
| 107 | 109 | for (int i = 0; i < count; i++) { |
|---|
| 108 | 110 | TableItem selected = selection[i]; |
|---|
| 109 | 111 | Rectangle cell = selected.getBounds(0); |
|---|
| 110 | | POINT pt = new POINT(); |
|---|
| 111 | | int imageList = OS.SendMessage (table.handle, OS.LVM_CREATEDRAGIMAGE, table.indexOf(selected), pt); |
|---|
| | 112 | POINT pt; |
|---|
| | 113 | HANDLE imageList = cast(HANDLE) OS.SendMessage (table.handle, OS.LVM_CREATEDRAGIMAGE, table.indexOf(selected), &pt); |
|---|
| 112 | 114 | OS.ImageList_Draw(imageList, 0, hDC1, cell.x - bounds.x, cell.y - bounds.y, OS.ILD_SELECTED); |
|---|
| 113 | 115 | OS.ImageList_Destroy(imageList); |
|---|