diff options
Diffstat (limited to 'apps/X11/VCL/TDragImageList.cpp')
-rw-r--r-- | apps/X11/VCL/TDragImageList.cpp | 144 |
1 files changed, 0 insertions, 144 deletions
diff --git a/apps/X11/VCL/TDragImageList.cpp b/apps/X11/VCL/TDragImageList.cpp deleted file mode 100644 index 4f51c7c..0000000 --- a/apps/X11/VCL/TDragImageList.cpp +++ /dev/null @@ -1,144 +0,0 @@ -#include <TDragImageList.h> - -TDragImageList::TDragImageList() :TCustomImageList(0) { - -} - -/* -{ TDragImageList } - -function ClientToWindow(Handle: HWND; X, Y: Integer): TPoint; -var - Rect: TRect; - Point: TPoint; -begin - Point.X := X; - Point.Y := Y; - ClientToScreen(Handle, Point); - GetWindowRect(Handle, Rect); - Result.X := Point.X - Rect.Left; - Result.Y := Point.Y - Rect.Top; -end; - -procedure TDragImageList.Initialize; -begin - inherited Initialize; - DragCursor := crNone; -end; - -procedure TDragImageList.CombineDragCursor; -var - TempList: HImageList; - Point: TPoint; -begin - if DragCursor <> crNone then - begin - TempList := ImageList_Create(GetSystemMetrics(SM_CXCURSOR), - GetSystemMetrics(SM_CYCURSOR), ILC_MASK, 1, 1); - try - ImageList_AddIcon(TempList, Screen.Cursors[DragCursor]); - ImageList_AddIcon(TempList, Screen.Cursors[DragCursor]); - ImageList_SetDragCursorImage(TempList, 0, 0, 0); - ImageList_GetDragImage(nil, @Point); - ImageList_SetDragCursorImage(TempList, 1, Point.X, Point.Y); - finally - ImageList_Destroy(TempList); - end; - end; -end; - -function TDragImageList.SetDragImage(Index, HotSpotX, HotSpotY: Integer): Boolean; -begin - if HandleAllocated then - begin - FDragIndex := Index; - FDragHotspot.x := HotSpotX; - FDragHotspot.y := HotSpotY; - ImageList_BeginDrag(Handle, Index, HotSpotX, HotSpotY); - Result := True; - FDragging := Result; - end - else Result := False; -end; - -procedure TDragImageList.SetDragCursor(Value: TCursor); -begin - if Value <> DragCursor then - begin - FDragCursor := Value; - if Dragging then CombineDragCursor; - end; -end; - -function TDragImageList.GetHotSpot: TPoint; -begin - Result := inherited GetHotSpot; - if HandleAllocated and Dragging then - ImageList_GetDragImage(nil, @Result); -end; - -function TDragImageList.BeginDrag(Window: HWND; X, Y: Integer): Boolean; -begin - Result := False; - if HandleAllocated then - begin - if not Dragging then SetDragImage(FDragIndex, FDragHotspot.x, FDragHotspot.y); - CombineDragCursor; - Result := DragLock(Window, X, Y); - if Result then ShowCursor(False); - end; -end; - -function TDragImageList.DragLock(Window: HWND; XPos, YPos: Integer): Boolean; -begin - Result := False; - if HandleAllocated and (Window <> FDragHandle) then - begin - DragUnlock; - FDragHandle := Window; - with ClientToWindow(FDragHandle, XPos, YPos) do - Result := ImageList_DragEnter(FDragHandle, X, Y); - end; -end; - -procedure TDragImageList.DragUnlock; -begin - if HandleAllocated and (FDragHandle <> 0) then - begin - ImageList_DragLeave(FDragHandle); - FDragHandle := 0; - end; -end; - -function TDragImageList.DragMove(X, Y: Integer): Boolean; -begin - if HandleAllocated then - with ClientToWindow(FDragHandle, X, Y) do - Result := ImageList_DragMove(X, Y) - else - Result := False; -end; - -procedure TDragImageList.ShowDragImage; -begin - if HandleAllocated then ImageList_DragShowNoLock(True); -end; - -procedure TDragImageList.HideDragImage; -begin - if HandleAllocated then ImageList_DragShowNoLock(False); -end; - -function TDragImageList.EndDrag: Boolean; -begin - if HandleAllocated and Dragging then - begin - DragUnlock; - Result := ImageList_EndDrag; - FDragging := False; - DragCursor := crNone; - ShowCursor(True); - end - else Result := False; -end; -*/ |