|
Class: DropContext
Object
|
+--DropContext
- Package:
- stx:libview2
- Category:
- Interface-DragAndDrop
- Version:
- rev:
1.30
date: 2022/07/23 15:16:59
- user: cg
- file: DropContext.st directory: libview2
- module: stx stc-classLibrary: libview2
instance, which keeps information about the current drag & drop operation.
dropObjects <Collection> collection of dropObjects.
rootPoint <Point> the current mouse position on the screen (root view).
copyrightCOPYRIGHT (c) 1998 by eXept Software AG / Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
constants
-
dragTypeCopy
-
-
dragTypeDefault
-
-
dragTypeLink
-
-
dragTypeMove
-
accessing
-
dragHandler
-
-
dragHandler: aHandler
-
-
dragType
-
the type of drag - modified by pressing one of Shift, Ctrl or Alt
-
dragType: aSymbol
-
the type of drag - modified by pressing one of Shift, Ctrl or Alt
-
dropInfo
-
a hook for additional info;
can be used for additional attributes/info to be passed around the various
drop-API methods (especially for the widget)
-
dropObjects
-
returns the collection of dropobjects
-
manager: something
-
-
rootPoint
-
returns the current absolute drag position on the screen
-
updateDragKindForKeyboardStateOnScreen: aScreen
-
change the kind of drag operation, when CTRL, META/ALT or SHIFT are pressed
(change from default to dragTypeCopy, dragTypeLink or dragTypeMove)
accessing-source
-
dropSource
-
returns the drop source or nil
-
sourcePoint
-
returns the point in the source widget the drag is started from
-
sourceWidget
-
returns the source widget the drag is started from
accessing-target
-
dropTarget
-
returns the drop target or nil
-
targetId
-
returns the id of the target widget
-
targetPoint
-
returns the point on the target widget (in LOGICAL coordinates).
usually, a dropTarget will ask for this in its canDrop method;
as in:
canDrop:aDropContext
^ myContentsBounds containsPoint:(aDropContext targetPoint)
Usage example(s):
the targetPoint is in LOGICAL coordinates NOT in device coordinates
|
-
targetPointInDeviceCoordinates
-
returns the point on the target widget (in DEVICE coordinates)
-
targetWidget
-
returns the widget assigned to the current dropTarget
actions
-
doDrop
-
evaluate the drop operation; set the feedBack
-
exchangeDragHandler: aHandler
-
make the new handler to the active handler
-
passiveAction: aBlock
-
-
saveDraw: aBlock
-
evaluate aBlock with the drag temporarily being undrawn
(i.e. restore original picture, evaluate the block, and draw dragged objects again).
Returns the block's value.
Use this, to change the contents while being dragged over,
especially for autoscroll and/or autoexpand/collapse of tree items.
change & update
-
contentsWillChange
-
called by the dropTarget-widget if the contents will change during a
dragAndDrop operation.
This must be called before the widget performs
any changes to the view while being dragged over (eg. autoscroll),
to force the d&d operation to restore the view before
(from the bitmap image which it fetched before the opaque move)
drag & drop manager interface
-
dropObjects: aCollectionOfDropObjects
-
set the collection of dropobjects
-
dropSource: aDropSource
-
set the dropSource;
that contains information about the drop source
-
dropTarget: aDropTargetOrNil
-
set a new drop target;
that contains information about the drop target (operations)
-
rootPoint: aPoint
-
set the current absolute drag position on the screen (rootPoint);
called by the drag and drop manager
-
sourcePoint: aPoint
-
set the point in the source widget;
that's the widget from which the drag is started from
-
sourceWidget: aView
-
set the source widget;
that's the widget from which the drag is started from
-
targetWidget: aViewOrNil id: anId
-
set a new drop widget (i.e. the widget dragged over)
queries
-
canDrop
-
returns true if the current dropTarget can drop the objects
-
clearHasDroppedFlagToSuppressFeedBack
-
can be used from within a targets drop code,
to signal that no feedBack should be sent to the
dropSource (because the drop did not happen)
-
hasDropped
-
-
isAlienView
-
returns true if current dropTarget is not an ST/X view
-
isDragTypeCopy
-
especially for file-like drags: should the object be copied on drop?
-
isDragTypeLink
-
especially for file-like drags: should the object be linked on drop?
-
isDragTypeMove
-
especially for file-like drags: should the object be moved on drop?
-
isRootView
-
returns true if the current target widget is the root view (screen)
DragType
DragTypeCopy
DragTypeLink
DragTypeMove
|