eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DropContext':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: DropContext


Inheritance:

   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

Description:


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).

copyright

COPYRIGHT (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.

Class protocol:

constants
o  dragTypeCopy

o  dragTypeDefault

o  dragTypeLink

o  dragTypeMove


Instance protocol:

accessing
o  dragHandler

o  dragHandler: aHandler

o  dragType
the type of drag - modified by pressing one of Shift, Ctrl or Alt

o  dragType: aSymbol
the type of drag - modified by pressing one of Shift, Ctrl or Alt

o  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)

o  dropObjects
returns the collection of dropobjects

o  manager: something

o  rootPoint
returns the current absolute drag position on the screen

o  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
o  dropSource
returns the drop source or nil

o  sourcePoint
returns the point in the source widget the drag is started from

o  sourceWidget
returns the source widget the drag is started from

accessing-target
o  dropTarget
returns the drop target or nil

o  targetId
returns the id of the target widget

o  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

o  targetPointInDeviceCoordinates
returns the point on the target widget (in DEVICE coordinates)

o  targetWidget
returns the widget assigned to the current dropTarget

actions
o  doDrop
evaluate the drop operation; set the feedBack

o  exchangeDragHandler: aHandler
make the new handler to the active handler

o  passiveAction: aBlock

o  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
o  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
o  dropObjects: aCollectionOfDropObjects
set the collection of dropobjects

o  dropSource: aDropSource
set the dropSource;
that contains information about the drop source

o  dropTarget: aDropTargetOrNil
set a new drop target;
that contains information about the drop target (operations)

o  rootPoint: aPoint
set the current absolute drag position on the screen (rootPoint);
called by the drag and drop manager

o  sourcePoint: aPoint
set the point in the source widget;
that's the widget from which the drag is started from

o  sourceWidget: aView
set the source widget;
that's the widget from which the drag is started from

o  targetWidget: aViewOrNil id: anId
set a new drop widget (i.e. the widget dragged over)

queries
o  canDrop
returns true if the current dropTarget can drop the objects

o  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)

o  hasDropped

o  isAlienView
returns true if current dropTarget is not an ST/X view

o  isDragTypeCopy
especially for file-like drags: should the object be copied on drop?

o  isDragTypeLink
especially for file-like drags: should the object be linked on drop?

o  isDragTypeMove
especially for file-like drags: should the object be moved on drop?

o  isRootView
returns true if the current target widget is the root view (screen)


Private classes:

    DragType
    DragTypeCopy
    DragTypeLink
    DragTypeMove


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Tue, 10 Dec 2024 21:19:44 GMT