Reading the header of a MP3 file.
"
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.
"
"{ Package: 'stx:libview2' }"
Object subclass:#DropContext
instanceVariableNames:'dropObjects rootPoint dropSource sourceWidget dropTarget
targetWidget targetId hasDropped dragHandler'
classVariableNames:''
poolDictionaries:''
category:'Interface-DragAndDrop'
!
!DropContext class methodsFor:'documentation'!
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.
"
!
documentation
"
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).
[see also:]
DragAndDropManager
DropObject
DropSource
DropTarget
[author:]
Claus Atzkern
"
! !
!DropContext methodsFor:'accessing'!
dragHandler
^ dragHandler
!
dragHandler:aHandler
dragHandler := aHandler
!
dropObjects
"returns the collection of droppable objects
"
^ dropObjects ? #()
!
rootPoint
"returns the absolute point on the screen (rootPoint)
"
^ rootPoint
! !
!DropContext methodsFor:'accessing-source'!
dropSource
"returns the drop source or nil
"
^ dropSource
!
sourceWidget
"returns the source widget the drag is started from
"
^ sourceWidget
! !
!DropContext methodsFor:'accessing-target'!
dropTarget
"returns the drop target or nil
"
^ dropTarget
!
targetId
"returns the id of the target widget
"
^ targetId
!
targetPoint
"returns the relative point on the target widget
"
|trn pnt dev|
dev := sourceWidget device.
pnt := dev translatePoint:rootPoint from:(dev rootView id) to:targetId.
targetWidget notNil ifTrue:[
(trn := targetWidget transformation) notNil ifTrue:[
^ trn applyInverseTo:pnt
]
].
^ pnt
!
targetWidget
"returns the widget assigned to the current dropTarget
"
^ targetWidget
! !
!DropContext methodsFor:'actions'!
doDrop
"evaluate the drop operation; set the feedBack
"
hasDropped := self canDrop.
self isAlienView ifFalse:[
hasDropped ifTrue:[
dropTarget drop:self
] ifFalse:[
"/
"/ called to restore the widget in
"/ case that something has changed
"/
dropTarget notNil ifTrue:[
dropTarget leave:self
]
]
] ifTrue:[
"/
"/ not one of my views
"/ external clipboard mechanism via display
"/
"/ ?? FEEDBACK ?? hasDropped ??
"/
sourceWidget device drop:dropObjects
inWindowID:targetId
position:(self targetPoint)
rootPosition:rootPoint.
].
dropSource notNil ifTrue:[
"/
"/ feedBack to dropSource
"/
dropSource feedBack:self
].
! !
!DropContext methodsFor:'change & update'!
contentsWillChange
"called by the dropTarget-widget if the contents will change during a
dragAndDrop operation
"
dragHandler notNil ifTrue:[
dragHandler dropTargetWillChange
]
! !
!DropContext methodsFor:'drag & drop manager interface'!
dropObjects:something
"set the collection of droppable objects
"
something notNil ifTrue:[
dropObjects := something isCollection ifTrue:[something]
ifFalse:[Array with:something]
]
!
dropSource:aDropSource
"set the dropSource
"
dropSource := aDropSource.
!
dropTarget:aDropTargetOrNil
"set a new drop target
"
dropTarget := aDropTargetOrNil.
!
rootPoint:something
"set the absolute point on the screen (rootPoint); called by the drag
and drop manager
"
rootPoint := something.
!
sourceWidget:aView
"set the source widget the drag is started from
"
sourceWidget := aView.
!
targetWidget:aViewOrNil id:anId
"set a new drop widget
"
targetWidget := aViewOrNil.
targetId := anId.
! !
!DropContext methodsFor:'queries'!
canDrop
"returns true if current dropTarget can drop draggable objects
"
^ dropTarget notNil ifTrue:[dropTarget canDrop:self] ifFalse:[false]
!
hasDropped
^ hasDropped ? false
!
isAlienView
"returns true if current dropTarget is not a ST/X view
"
^ targetWidget isNil
!
isRootView
"returns true if the current target widget is the root view (screen)
"
^ targetWidget notNil ifTrue:[targetWidget isRootView]
ifFalse:[false]
! !
!DropContext class methodsFor:'documentation'!
version
^ '$Header: /cvs/stx/stx/libview2/DropContext.st,v 1.3 2000-08-21 22:43:48 cg Exp $'
! !