UIPainter.st
changeset 2280 d9a56ee79c70
parent 2277 342f25e2c276
child 2284 4116d91b6dda
equal deleted inserted replaced
2279:f077161d5d57 2280:d9a56ee79c70
  2453      self canMoveSelectionOutOfContainer value or: [
  2453      self canMoveSelectionOutOfContainer value or: [
  2454      self canMoveSelectionOutOfContainer value]]
  2454      self canMoveSelectionOutOfContainer value]]
  2455 !
  2455 !
  2456 
  2456 
  2457 canMoveSelectionIntoContainer
  2457 canMoveSelectionIntoContainer
  2458     "returns a boolean value holder which is true in case that one widget is selected
  2458     "returns true in case that one widget is selected and can change its container
  2459      and can change its container widget to the next element in the list which will have
  2459      widget to an element below"
  2460      the same container"
       
  2461 
  2460 
  2462     ^ builder booleanValueAspectFor:#canMoveSelectionIntoContainer
  2461     ^ builder booleanValueAspectFor:#canMoveSelectionIntoContainer
  2463 !
  2462 !
  2464 
  2463 
  2465 canMoveSelectionOutOfContainer
  2464 canMoveSelectionOutOfContainer
  5582     ^ true
  5581     ^ true
  5583 !
  5582 !
  5584 
  5583 
  5585 canMoveSelectionIntoContainer
  5584 canMoveSelectionIntoContainer
  5586     "returns true in case that one widget is selected and can change its container
  5585     "returns true in case that one widget is selected and can change its container
  5587      widget to the next element in the list which will have the same container"
  5586      widget to an element below"
  5588 
  5587 
  5589     |item prnt container|
  5588     |item oldParentItem newParentItem idx|
  5590 
  5589 
  5591     (     (item := self selectedNode) isNil
  5590     item := self selectedNode.
  5592       or:[(prnt := item parent) isNil
  5591     (item notNil and:[(oldParentItem := item parent) notNil]) ifTrue:[
  5593       or:[(container := prnt childAt:((prnt indexOfChild:item) + 1)) isNil
  5592         idx := (oldParentItem indexOfChild:item) + 1.
  5594       or:[container contents spec class supportsSubComponents not]]]
  5593         newParentItem := oldParentItem children detect:[:eachChild|
  5595     ) ifTrue:[
  5594             eachChild contents spec class supportsSubComponents
  5596         ^ false
  5595         ] startingAt:idx ifNone:nil.
  5597     ].
  5596         ^ newParentItem notNil.
  5598     ^ true
  5597     ].
       
  5598 
       
  5599     ^ false
  5599 !
  5600 !
  5600 
  5601 
  5601 canMoveSelectionOutOfContainer
  5602 canMoveSelectionOutOfContainer
  5602     "returns true in case that one widget is selected which is contained within
  5603     "returns true in case that one widget is selected which is contained within
  5603      another widget"
  5604      another widget"
  5681     canvas setSelection:(anItem contents view) withRedraw:false.
  5682     canvas setSelection:(anItem contents view) withRedraw:false.
  5682     canvas pasteWithLayout.
  5683     canvas pasteWithLayout.
  5683 !
  5684 !
  5684 
  5685 
  5685 doStepIn
  5686 doStepIn
  5686     |item prnt|
  5687     "move the currently selected widget into the next available container below"
  5687 
  5688 
  5688     (     (item := self selectedNode) isNil
  5689     |item oldParentItem newParentItem idx|
  5689       or:[(prnt := item parent) isNil
  5690 
  5690       or:[(prnt := prnt childAt:((prnt indexOfChild:item) + 1)) isNil
  5691     item := self selectedNode.
  5691       or:[prnt contents spec class supportsSubComponents not]]]
  5692     (item notNil and:[(oldParentItem := item parent) notNil]) ifTrue:[
  5692     ) ifFalse:[
  5693         idx := (oldParentItem indexOfChild:item) + 1.
  5693         self doChangeHierarchyOf:prnt
  5694         newParentItem := oldParentItem children detect:[:eachChild|
       
  5695             eachChild contents spec class supportsSubComponents
       
  5696         ] startingAt:idx ifNone:nil.
       
  5697         newParentItem notNil ifTrue:[
       
  5698             self doChangeHierarchyOf:newParentItem
       
  5699         ].
  5694     ]
  5700     ]
  5695 !
  5701 !
  5696 
  5702 
  5697 doStepOut
  5703 doStepOut
  5698     |item|
  5704     |item|