UIPainterView.st
changeset 2116 90fc11105f36
parent 2112 74dfb69c88d4
child 2180 0912680e1fa7
equal deleted inserted replaced
2115:be5e920d6158 2116:90fc11105f36
   497     ].
   497     ].
   498 ! !
   498 ! !
   499 
   499 
   500 !UIPainterView methodsFor:'drag & drop'!
   500 !UIPainterView methodsFor:'drag & drop'!
   501 
   501 
   502 canDrop:aCollectionOfDropObjects
   502 canDrop:aDropContext
       
   503     ^ self canDropObjects:aDropContext dropObjects
       
   504 
       
   505     "Created: / 13-10-2006 / 17:46:11 / cg"
       
   506 !
       
   507 
       
   508 canDropObjects:aCollectionOfDropObjects
   503     "returns true if something can be dropped"
   509     "returns true if something can be dropped"
   504 
   510 
   505     ^ (aCollectionOfDropObjects size == 1 
   511     ^ (aCollectionOfDropObjects size == 1 
   506     and:[ self enabled 
   512     and:[ self enabled 
   507     and:[ self numberOfSelections <= 1
   513     and:[ self numberOfSelections <= 1
   508     and:[ aCollectionOfDropObjects first theObject isKindOf:UISpecification ]]])
   514     and:[ aCollectionOfDropObjects first theObject isKindOf:UISpecification ]]])
   509 
   515 
   510     "Modified: / 13-10-2006 / 11:38:01 / cg"
   516     "Created: / 13-10-2006 / 16:09:24 / cg"
   511 !
   517 !
   512 
   518 
   513 canPaste
   519 canPaste
   514     "returns true if there is something which can be pasted in the clipboard"
   520     "returns true if there is something which can be pasted in the clipboard"
   515 
   521 
   549         ^ prop spec class supportsSubComponents
   555         ^ prop spec class supportsSubComponents
   550     ].
   556     ].
   551     ^ aView specClass supportsSubComponents.
   557     ^ aView specClass supportsSubComponents.
   552 !
   558 !
   553 
   559 
   554 drop:aCollectionOfDropObjects at:aPoint
   560 dropObjects:aCollectionOfDropObjects at:aPoint
   555     |spec newSel oldSel dragOffset widg doit|
   561     |spec newSel oldSel dragOffset widg doit|
   556 
   562 
   557     doit := true.
   563     doit := true.
   558     self selection notNil ifTrue:[
   564     self selection notNil ifTrue:[
   559         oldSel := self singleSelection.
   565         oldSel := self singleSelection.
   575         newSel := self pasteSpecifications:spec keepLayout:false at:aPoint - dragOffset.
   581         newSel := self pasteSpecifications:spec keepLayout:false at:aPoint - dragOffset.
   576 
   582 
   577         self select:(oldSel ? newSel)
   583         self select:(oldSel ? newSel)
   578     ].
   584     ].
   579 
   585 
   580     "Modified: / 18.3.1999 / 18:29:43 / stefan"
   586     "Modified: / 18-03-1999 / 18:29:43 / stefan"
   581     "Modified: / 30.10.2001 / 14:02:35 / cg"
   587     "Created: / 13-10-2006 / 16:09:27 / cg"
   582 ! !
   588 ! !
   583 
   589 
   584 !UIPainterView methodsFor:'event handling'!
   590 !UIPainterView methodsFor:'event handling'!
   585 
   591 
   586 keyPress:key x:x y:y view:aView
   592 keyPress:key x:x y:y view:aView