eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DropTarget':

Home

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

Class: DropTarget


Inheritance:

   Object
   |
   +--DropTarget

Package:
stx:libview2
Category:
Interface-DragAndDrop
Version:
rev: 1.13 date: 2021/01/20 13:12:43
user: cg
file: DropTarget.st directory: libview2
module: stx stc-classLibrary: libview2

Description:


this class keeps the current target of the drop operation; 
the object responsible for the widget under the current mouse position.
Usually a dropTarget object is created by the D&D manager automatically,
but a view may redefine the dropTarget method (or set its dropTarget instVar),
to provide a customized droptarget (with different selectors).

receiver        <Object>        receiver to which the requests are sent. 
                                The widget or an application.

argument        <Object>        user defined argument

enterSelector   <Symbol>        sent the first time to the drop target when entering
                                the widget. Nil, when defaulted from D&D manager.

leaveSelector   <Symbol>        sent the last time to the drop target when leaving
                                the widget. Nil, when defaulted from D&D manager.

overSelector    <Symbol>        sent all the time to the drop target when moveing the
                                mouse over the widget. Nil, when defaulted from D&D manager.

dropSelector    <Symbol>        sent to the drop target to drop the collection of
                                objects. #drop: when defaulted from D&D manager.

canDropSelector <Symbol>        sent to the drop target to ask if the context could
                                be dropped. #canDrop: when defaulted from D&D manager.

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:

instance creation
o  receiver: aReceiver

o  receiver: aReceiver argument: anArgument

o  receiver: aReceiver argument: anArgument dropSelector: aSelector

o  receiver: aReceiver argument: anArgument dropSelector: s1 canDropSelector: s2


Instance protocol:

accessing
o  argument
returns the user defined argument; this argument is used for a drop action
with two arguments, the context and the argument

o  argument: something
set the user defined argument; this argument is passed for a drop action
with two arguments, the context and the argument

o  canDropSelector
selector called to get a feedback if context is droppable.
the arguments to the selector are:
0 nothing
1 aDropContext
2 aDropContext and the argument

o  canDropSelector: aSelectorOrNil
selector called to get a feedback if context is droppable.
the arguments to the selector are:
0 nothing
1 aDropContext
2 aDropContext and the argument

o  dropSelector
return the selector of the message which is sent to the drop target
when the objects are to be dropped (i.e. when the mouse button is released).

Depending on the number of arguments of the selector,
the arguments of the message are:
0 nothing
1 aDropContext
2 aDropContext and the argument

o  dropSelector: aSelectorOrNil
specify the selector of the message which is sent to the drop target
when the objects are to be dropped (i.e. when the mouse button is released).

Depending on the number of arguments of the selector,
the arguments of the message are:
0 nothing
1 aDropContext
2 aDropContext and the argument

o  enterSelector
return the selector of the message which is sent to the drop target
when entering the widget for the first time.

Depending on the number of arguments of the selector,
the arguments of the message are:
0 nothing
1 aDropContext
2 aDropContext and the argument

o  enterSelector: aSelectorOrNil
specify the selector of the message which is sent to the drop target
when entering the widget for the first time.

Depending on the number of arguments of the selector,
the arguments of the message are:
0 nothing
1 aDropContext
2 aDropContext and the argument

o  keyPressSelector
return the selector of the message which is sent to the drop target
when a key is pressed during the drag operation.
By default, keyboard input is ignored,
(except for escape, shift, cmd, ctrl etc., which are handled by the d&d manager).
Apps which want to react on keypress, must return a dropTarget with the
keyPressSelector set.

o  keyPressSelector: aSelectorOrNil
set the selector of the message which is sent to the drop target
when a key is pressed during the drag operation.
By default, keyboard input is ignored,
(except for escape, shift, cmd, ctrl etc., which are handled by the d&d manager).
Apps which want to react on keypress, must return a dropTarget with the
keyPressSelector set.

o  leaveSelector
return the selector of the message which is sent to the drop target
when leaving the widget.

Depending on the number of arguments of the selector,
the arguments of the message are:
0 nothing
1 aDropContext
2 aDropContext and the argument

o  leaveSelector: aSelectorOrNil
specify the selector of the message which is sent to the drop target
when leaving the widget.

Depending on the number of arguments of the selector,
the arguments of the message are:
0 nothing
1 aDropContext
2 aDropContext and the argument

o  oldDropAPI: aBoolean
for backward compatibility

o  overSelector
send all the time to the drop target when moveing the mouse over the widget

Depending on the number of arguments of the selector,
the arguments of the message are:
0 nothing
1 aDropContext
2 aDropContext and the argument

o  overSelector: aSelectorOrNil
specify the selector of the message which is sent to the drop target
when the mouse is moved over the widget.

Depending on the number of arguments of the selector,
the arguments of the message are:
0 nothing
1 aDropContext
2 aDropContext and the argument

o  receiver
returns the receiver to which the requests are sent: a widget or an application.

o  receiver: viewOrApp
define the receiver to which the requests are sent.
The argument is a widget or an application.

actions
o  drop: aDropContext
sent, when the mouse button is released within the current widget.
Forwarded via dropSelector to the receiver

o  enter: aContext
sent, when entering a widget.
Forwarded via enterSelector (unless nil) to the receiver

o  keyPress: aContext key: aKey
sent, whenever a key is pressed while over a widget.
Forwarded via dropKeyPressSelector (unless nil) to the receiver

o  leave: aContext
sent, when leaving a widget.
Forwarded via leaveSelector (unless nil) to the receiver

o  over: aContext
sent, whenever the mouse is moved over a widget.
Forwarded via overSelector (unless nil) to the receiver

instance creation
o  receiver: aReceiver argument: anArgument
set the receiver and a user defined argument

o  receiver: aReceiver argument: anArgument dropSelector: s1 canDropSelector: s2
set the receiver and a user defined argument

private
o  receiverPerform: aSelector withContext: aContext
let the receiver perform the selector

** This is an obsolete interface - do not use it (it may vanish in future versions) **

queries
o  canDrop: aDropContext
sent to the receiver to ask if the context is droppable



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 16:12:36 GMT