Show
Ignore:
Timestamp:
05/17/08 11:34:28 (8 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Update to SWT 3.4M7

Files:

Legend:

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

    r212 r213  
    143143 
    144144    static const String DEFAULT_DRAG_SOURCE_EFFECT = "DEFAULT_DRAG_SOURCE_EFFECT"; //$NON-NLS-1$ 
    145     static const String DRAGSOURCEID = "DragSource"; //$NON-NLS-1$ 
    146145    static const int CFSTR_PERFORMEDDROPEFFECT; 
    147146    static final TCHAR[] WindowClass = "#32770\0"; 
     
    181180    super(control, checkStyle(style)); 
    182181    this.control = control; 
    183     if (control.getData(DRAGSOURCEID) !is null) { 
     182    if (control.getData(DND.DRAG_SOURCE_KEY) !is null) { 
    184183        DND.error(DND.ERROR_CANNOT_INIT_DRAG); 
    185184    } 
    186     control.setData(DRAGSOURCEID, this); 
     185    control.setData(DND.DRAG_SOURCE_KEY, this); 
    187186    createCOMInterfaces(); 
    188187    this.AddRef(); 
     
    252251 * 
    253252 * @see DragSourceListener 
     253 * @see #getDragListeners 
    254254 * @see #removeDragListener 
    255255 * @see DragSourceEvent 
     
    303303    String key = "dwt.internal.win32.runMessagesInIdle"; //$NON-NLS-1$ 
    304304    Object oldValue = display.getData(key); 
    305     display.setData(key, new ValueWrapperBool(true)); 
     305    display.setData(key, new Boolean(true)); 
    306306    ImageList imagelist = null; 
    307307    Image image = event.image; 
     
    476476 
    477477/** 
     478 * Returns an array of listeners who will be notified when a drag and drop 
     479 * operation is in progress, by sending it one of the messages defined in 
     480 * the <code>DragSourceListener</code> interface. 
     481 * 
     482 * @exception DWTException <ul> 
     483 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     484 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 
     485 * </ul> 
     486 * 
     487 * @see DragSourceListener 
     488 * @see #addDragListener 
     489 * @see #removeDragListener 
     490 * @see DragSourceEvent 
     491 * 
     492 * @since 3.4 
     493 */ 
     494public DragSourceListener[] getDragListeners() { 
     495    Listener[] listeners = getListeners(DND.DragStart); 
     496    int length = listeners.length; 
     497    DragSourceListener[] dragListeners = new DragSourceListener[length]; 
     498    int count = 0; 
     499    for (int i = 0; i < length; i++) { 
     500        Listener listener = listeners[i]; 
     501        if ( auto l = cast(DNDListener)listener ) { 
     502            dragListeners[count] = cast(DragSourceListener) (l.getEventListener()); 
     503            count++; 
     504        } 
     505    } 
     506    if (count is length) return dragListeners; 
     507    DragSourceListener[] result = new DragSourceListener[count]; 
     508    SimpleType!(DragSourceListener).arraycopy(dragListeners, 0, result, 0, count); 
     509    return result; 
     510} 
     511 
     512/** 
    478513 * Returns the drag effect that is registered for this DragSource.  This drag 
    479514 * effect will be used during a drag and drop operation. 
     
    537572    } 
    538573    controlListener = null; 
    539     control.setData(DRAGSOURCEID, null); 
     574    control.setData(DND.DRAG_SOURCE_KEY, null); 
    540575    control = null; 
    541576    transferAgents = null; 
     
    636671 * @see DragSourceListener 
    637672 * @see #addDragListener 
     673 * @see #getDragListeners 
    638674 */ 
    639675public void removeDragListener(DragSourceListener listener) { 
     
    651687        STGMEDIUM* stgmedium = new STGMEDIUM(); 
    652688        COM.MoveMemory(stgmedium, pmedium,STGMEDIUM.sizeof); 
     689        //TODO - this should be GlobalLock() 
    653690        int[1] ptrEffect; 
    654691        OS.MoveMemory(ptrEffect.ptr, stgmedium.unionField,4);