UIPainterView.st
changeset 2366 69ed2aeb7e3d
parent 2362 a6a7ef98fdc3
child 2367 6684f50b22cd
equal deleted inserted replaced
2365:b63bf46bc18a 2366:69ed2aeb7e3d
   395         keepLayout:keepLayout
   395         keepLayout:keepLayout
   396         keepPosition:true
   396         keepPosition:true
   397         at:aPointOrNil
   397         at:aPointOrNil
   398 !
   398 !
   399 
   399 
   400 pasteSpecifications:aSpecificationOrList keepLayout:keepLayout keepPosition:keepPosition at:aPointOrNil
   400 pasteSpecifications:aSpecificationOrList keepLayout:keepLayout keepPosition:keepPosition at:aPointOrNilOrKeep
   401     "add the specs to the object view; returns list of pasted widgets"
   401     "add the specs to the object view; returns list of pasted widgets"
   402 
   402 
   403     |specsToPaste pasteOffset builder newSel 
   403     |specsToPaste pasteOffset builder newSel 
   404      bounds containerToPasteInto pastePoint|
   404      bounds containerToPasteInto pastePoint|
   405 
   405 
   406     treeView askForSelectionChangeAllowed ifFalse:[^ nil].
   406     treeView askForSelectionChangeAllowed ifFalse:[^ nil].
   407 
   407 
   408     (self window sensor shiftDown
   408     (aPointOrNilOrKeep == #keep
   409     or:[ self window sensor ctrlDown ]) ifTrue:[
   409     or:[ self window sensor shiftDown
       
   410     or:[ self window sensor ctrlDown ]]) ifTrue:[
   410         "/ paste into the selection
   411         "/ paste into the selection
   411         containerToPasteInto := self singleSelection.
   412         containerToPasteInto := self singleSelection.
   412     ] ifFalse:[
   413     ] ifFalse:[
   413         "/ ignore the selection and paste where we drop!!
   414         "/ ignore the selection and paste where we drop!!
   414         pastePoint := aPointOrNil.
   415         pastePoint := aPointOrNilOrKeep.
   415         pastePoint isNil ifTrue:[
   416         pastePoint isNil ifTrue:[
   416             pastePoint := device 
   417             pastePoint := device 
   417                                 translatePoint:(self sensor mousePoint)
   418                                 translatePoint:(self sensor mousePoint)
   418                                 fromView:nil
   419                                 fromView:nil
   419                                 toView:self.
   420                                 toView:self.
   521 pasteWithLayout
   522 pasteWithLayout
   522     "add the objects in the paste-buffer to the object view"
   523     "add the objects in the paste-buffer to the object view"
   523 
   524 
   524     |sel|
   525     |sel|
   525 
   526 
   526     sel := self pasteSpecifications:(self getClipboardObject) keepLayout:true.
   527     sel := self 
       
   528             pasteSpecifications:(self getClipboardObject)
       
   529             keepLayout:true
       
   530             keepPosition:true
       
   531             at:#keep.
   527     self changeSelectionAfterPasteOf:sel.
   532     self changeSelectionAfterPasteOf:sel.
   528 !
   533 !
   529 
   534 
   530 pasteWithoutLayout
   535 pasteWithoutLayout
   531     "add the objects in the paste-buffer to the object view"
   536     "add the objects in the paste-buffer to the object view"