Changeset 147:cf66b1446ffe

Show
Ignore:
Timestamp:
02/13/08 10:59:17 (10 months ago)
Author:
Frank Benoit <benoit@tionex.de>
Children:

148:029d0df3f515 150:8491a1efab40

branch:
default
Message:

TableDropTargetEffect?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/dnd/TableDropTargetEffect.d

    r137 r147  
    2020import dwt.dnd.DropTargetEffect; 
    2121import dwt.dnd.DropTargetEvent; 
     22import dwt.dnd.DND; 
     23 
     24import dwt.dwthelper.utils; 
    2225 
    2326/** 
     
    110113    public void dragLeave(DropTargetEvent event) { 
    111114        Table table = cast(Table) control; 
    112         int handle = table.handle; 
     115        auto handle = table.handle; 
    113116        if (dropHighlight !is null) { 
    114             LVITEM lvItem = new LVITEM ()
     117            LVITEM lvItem
    115118            lvItem.stateMask = OS.LVIS_DROPHILITED; 
    116             OS.SendMessage(handle, OS.LVM_SETITEMSTATE, -1, lvItem); 
     119            OS.SendMessage(handle, OS.LVM_SETITEMSTATE, -1, &lvItem); 
    117120            dropHighlight = null; 
    118121        } 
     
    141144        Table table = cast(Table) getControl(); 
    142145        int effect = checkEffect(event.feedback); 
    143         int handle = table.handle; 
     146        auto handle = table.handle; 
    144147        Point coordinates = new Point(event.x, event.y); 
    145148        coordinates = table.toControl(coordinates); 
    146         LVHITTESTINFO pinfo = new LVHITTESTINFO()
    147         pinfo.x = coordinates.x; 
    148         pinfo.y = coordinates.y; 
    149         OS.SendMessage(handle, OS.LVM_HITTEST, 0, pinfo); 
     149        LVHITTESTINFO pinfo
     150        pinfo.pt.x = coordinates.x; 
     151        pinfo.pt.y = coordinates.y; 
     152        OS.SendMessage(handle, OS.LVM_HITTEST, 0, &pinfo); 
    150153        if ((effect & DND.FEEDBACK_SCROLL) is 0) { 
    151154            scrollBeginTime = 0; 
     
    161164                        scroll = pinfo.iItem !is index; 
    162165                    } else { 
    163                         RECT itemRect = new RECT ()
     166                        RECT itemRect
    164167                        itemRect.left = OS.LVIR_BOUNDS; 
    165                         if (OS.SendMessage (handle, OS.LVM_GETITEMRECT, pinfo.iItem, itemRect) !is 0) { 
    166                             RECT rect = new RECT ()
    167                             OS.GetClientRect (handle, rect); 
    168                             POINT pt = new POINT ()
     168                        if (OS.SendMessage (handle, OS.LVM_GETITEMRECT, pinfo.iItem, &itemRect) !is 0) { 
     169                            RECT rect
     170                            OS.GetClientRect (handle, &rect); 
     171                            POINT pt
    169172                            pt.x = itemRect.left; 
    170173                            pt.y = itemRect.top; 
    171                             if (OS.PtInRect (rect, pt)) { 
     174                            if (OS.PtInRect (&rect, pt)) { 
    172175                                pt.y = itemRect.bottom; 
    173                                 if (OS.PtInRect (rect, pt)) scroll = false; 
     176                                if (OS.PtInRect (&rect, pt)) scroll = false; 
    174177                            } 
    175178                        } 
     
    191194            TableItem item = table.getItem(pinfo.iItem); 
    192195            if (dropHighlight !is item) { 
    193                 LVITEM lvItem = new LVITEM()
     196                LVITEM lvItem
    194197                lvItem.stateMask = OS.LVIS_DROPHILITED; 
    195                 OS.SendMessage(handle, OS.LVM_SETITEMSTATE, -1, lvItem); 
     198                OS.SendMessage(handle, OS.LVM_SETITEMSTATE, -1, &lvItem); 
    196199                lvItem.state = OS.LVIS_DROPHILITED; 
    197                 OS.SendMessage(handle, OS.LVM_SETITEMSTATE, pinfo.iItem, lvItem); 
     200                OS.SendMessage(handle, OS.LVM_SETITEMSTATE, pinfo.iItem, &lvItem); 
    198201                dropHighlight = item; 
    199202            } 
    200203        } else { 
    201204            if (dropHighlight !is null) { 
    202                 LVITEM lvItem = new LVITEM ()
     205                LVITEM lvItem
    203206                lvItem.stateMask = OS.LVIS_DROPHILITED; 
    204                 OS.SendMessage(handle, OS.LVM_SETITEMSTATE, -1, lvItem); 
     207                OS.SendMessage(handle, OS.LVM_SETITEMSTATE, -1, &lvItem); 
    205208                dropHighlight = null; 
    206209            }