UIObjectView.st
changeset 3691 362d9b0f6b47
parent 3647 7833be8fb641
child 3756 7fad458b3706
equal deleted inserted replaced
3690:79c13fe7d6bc 3691:362d9b0f6b47
  1339     self invertOutlineOf:object
  1339     self invertOutlineOf:object
  1340 ! !
  1340 ! !
  1341 
  1341 
  1342 !UIObjectView methodsFor:'private'!
  1342 !UIObjectView methodsFor:'private'!
  1343 
  1343 
       
  1344 findContainerOfView:view
       
  1345     self subclassResponsibility
       
  1346 
       
  1347     "Created: / 17-07-2019 / 10:29:36 / Claus Gittinger"
       
  1348 !
       
  1349 
  1344 undoHistoryChanged
  1350 undoHistoryChanged
  1345     self hasUndoHistoryHolder value:(self hasUndoHistory).
  1351     self hasUndoHistoryHolder value:(self hasUndoHistory).
  1346 ! !
  1352 ! !
  1347 
  1353 
  1348 !UIObjectView methodsFor:'private-handles'!
  1354 !UIObjectView methodsFor:'private-handles'!
  2344                         self shiftLayout:v left:0 right:delta
  2350                         self shiftLayout:v left:0 right:delta
  2345                     ]
  2351                     ]
  2346                 ]
  2352                 ]
  2347             ] ifFalse:[
  2353             ] ifFalse:[
  2348                 self extentToFrame:#Right do:[:aLayout|
  2354                 self extentToFrame:#Right do:[:aLayout|
  2349                     aLayout rightOffset:0.
  2355                     aLayout rightFraction:1.0 offset:0.
  2350                     aLayout rightFraction:1.0.
       
  2351                 ]
  2356                 ]
  2352             ]
  2357             ]
  2353         ].
  2358         ].
  2354         self layoutChanged
  2359         self layoutChanged
  2355     ]
  2360     ]
       
  2361 
       
  2362     "Modified: / 17-07-2019 / 10:25:26 / Claus Gittinger"
  2356 !
  2363 !
  2357 
  2364 
  2358 alignSelectionBottom
  2365 alignSelectionBottom
  2359     "align selection to the bottom of the first object in the selection; in case
  2366     "align selection to the bottom of the first object in the selection; in case
  2360      of one selection the object is aligned to the bottom of its superview
  2367      of one selection the object is aligned to the bottom of its superview
  2361     "
  2368     "
  2362     |bmost delta sel|
  2369     |bmost delta sel|
  2363 
  2370 
  2364     (sel := self moveableSelection) notNil ifTrue:[
  2371     (sel := self moveableSelection) notNil ifTrue:[
  2365 	self withSelectionHiddenDo:[
  2372         self withSelectionHiddenDo:[
  2366 	    self numberOfSelections > 1 ifTrue:[
  2373             self numberOfSelections > 1 ifTrue:[
  2367 		bmost := (sel first) computeCorner y.
  2374                 bmost := (sel first) computeCorner y.
  2368 
  2375 
  2369 		self transaction:#alignBottom selectionDo:[:v|
  2376                 self transaction:#alignBottom selectionDo:[:v|
  2370 		    (delta := bmost - (v computeCorner y)) ~~ 0 ifTrue:[
  2377                     (delta := bmost - (v computeCorner y)) ~~ 0 ifTrue:[
  2371 			self shiftLayout:v top:delta bottom:delta.
  2378                         self shiftLayout:v top:delta bottom:delta.
  2372 		    ]
  2379                     ]
  2373 		]
  2380                 ]
  2374 	    ] ifFalse:[
  2381             ] ifFalse:[
  2375 		self extentToFrame:#Bottom do:[:aLayout|
  2382                 self extentToFrame:#Bottom do:[:aLayout|
  2376 		    aLayout bottomOffset:0.
  2383                     aLayout bottomFraction:1.0 offset:0
  2377 		    aLayout bottomFraction:1.0
  2384                 ]
  2378 		]
  2385             ]
  2379 	    ]
  2386         ].
  2380 	].
  2387         self layoutChanged
  2381 	self layoutChanged
       
  2382     ]
  2388     ]
  2383 
  2389 
  2384 
  2390     "Modified: / 17-07-2019 / 10:28:49 / Claus Gittinger"
  2385 
       
  2386 !
  2391 !
  2387 
  2392 
  2388 alignSelectionCenterHor
  2393 alignSelectionCenterHor
  2389     "align selection to the center/horizontal of the first object in the selection; in case
  2394     "align selection to the center/horizontal of the first object in the selection; in case
  2390      of one selection the object is aligned to the center/horizontal of its superview
  2395      of one selection the object is aligned to the center/horizontal of its superview
  2561      of one selection the object is aligned to the top of its superview
  2566      of one selection the object is aligned to the top of its superview
  2562     "
  2567     "
  2563     |tmost delta sel|
  2568     |tmost delta sel|
  2564 
  2569 
  2565     (sel := self moveableSelection) notNil ifTrue:[
  2570     (sel := self moveableSelection) notNil ifTrue:[
  2566 	self withSelectionHiddenDo:[
  2571         self withSelectionHiddenDo:[
  2567 	    self numberOfSelections > 1 ifTrue:[
  2572             self numberOfSelections > 1 ifTrue:[
  2568 		tmost := (sel first) computeOrigin y.
  2573                 tmost := (sel first) computeOrigin y.
  2569 
  2574 
  2570 		self transaction:#alignTop selectionDo:[:v|
  2575                 self transaction:#alignTop selectionDo:[:v|
  2571 		    (delta := tmost - (v computeOrigin y)) ~~ 0 ifTrue:[
  2576                     (delta := tmost - (v computeOrigin y)) ~~ 0 ifTrue:[
  2572 			self shiftLayout:v top:delta bottom:delta
  2577                         self shiftLayout:v top:delta bottom:delta
  2573 		    ]
  2578                     ]
  2574 		]
  2579                 ]
  2575 	    ] ifFalse:[
  2580             ] ifFalse:[
  2576 		self extentToFrame:#Top do:[:aLayout|
  2581                 self extentToFrame:#Top do:[:aLayout|
  2577 		    aLayout topOffset:0.
  2582                     aLayout topFraction:0.0 offset:0.
  2578 		    aLayout topFraction:0.0.
  2583                 ]
  2579 		]
  2584             ]
  2580 	    ]
  2585         ].
  2581 	].
  2586         self layoutChanged
  2582 	self layoutChanged
       
  2583     ]
  2587     ]
  2584 
  2588 
       
  2589     "Modified: / 17-07-2019 / 10:23:29 / Claus Gittinger"
  2585 !
  2590 !
  2586 
  2591 
  2587 alignSelectionTopAndBottom
  2592 alignSelectionTopAndBottom
  2588     "align selection to the top/bottom of the first object in the selection; in case
  2593     "align selection to the top/bottom of the first object in the selection; in case
  2589      of one selection the object is aligned to the top/bottom of its superview
  2594      of one selection the object is aligned to the top/bottom of its superview
  2618                         ].
  2623                         ].
  2619                     ].
  2624                     ].
  2620                 ]
  2625                 ]
  2621             ] ifFalse:[
  2626             ] ifFalse:[
  2622                 self extentToFrame:#TopBottom do:[:aLayout|
  2627                 self extentToFrame:#TopBottom do:[:aLayout|
  2623                     aLayout topOffset:0.
  2628                     aLayout topFraction:0.0 offset:0.
  2624                     aLayout topFraction:0.0.
  2629                     aLayout bottomFraction:1.0 offset:0.
  2625                     aLayout bottomOffset:0.
       
  2626                     aLayout bottomFraction:1.0.
       
  2627                 ]
  2630                 ]
  2628             ]
  2631             ]
  2629         ].
  2632         ].
  2630         self layoutChanged
  2633         self layoutChanged
  2631     ]
  2634     ]
       
  2635 
       
  2636     "Modified: / 17-07-2019 / 10:24:00 / Claus Gittinger"
  2632 !
  2637 !
  2633 
  2638 
  2634 centerSelection:aOneArgBlockXorY orientation:orientation
  2639 centerSelection:aOneArgBlockXorY orientation:orientation
  2635     "center selection horizontally or vertically depending on the block result (x or y).
  2640     "center selection horizontally or vertically depending on the block result (x or y).
  2636      The argument to the block is the point.
  2641      The argument to the block is the point.