UIObjectView.st
changeset 1437 daaf701ab6a2
parent 1427 85b9b5da0b8d
child 1438 9255d2e6226b
equal deleted inserted replaced
1436:180804d7c28f 1437:daaf701ab6a2
    21 	classVariableNames:''
    21 	classVariableNames:''
    22 	poolDictionaries:''
    22 	poolDictionaries:''
    23 	category:'Interface-UIPainter'
    23 	category:'Interface-UIPainter'
    24 !
    24 !
    25 
    25 
       
    26 Object subclass:#ResizeData
       
    27 	instanceVariableNames:'object selector delta'
       
    28 	classVariableNames:''
       
    29 	poolDictionaries:''
       
    30 	privateIn:UIObjectView
       
    31 !
       
    32 
    26 Object subclass:#UndoHistory
    33 Object subclass:#UndoHistory
    27 	instanceVariableNames:'startIdentifier identifier painter history transaction enabled'
    34 	instanceVariableNames:'startIdentifier identifier painter history transaction enabled'
    28 	classVariableNames:''
    35 	classVariableNames:''
    29 	poolDictionaries:''
    36 	poolDictionaries:''
    30 	privateIn:UIObjectView
    37 	privateIn:UIObjectView
    33 Object subclass:#Transaction
    40 Object subclass:#Transaction
    34 	instanceVariableNames:'identifier type text actions'
    41 	instanceVariableNames:'identifier type text actions'
    35 	classVariableNames:''
    42 	classVariableNames:''
    36 	poolDictionaries:''
    43 	poolDictionaries:''
    37 	privateIn:UIObjectView::UndoHistory
    44 	privateIn:UIObjectView::UndoHistory
    38 !
       
    39 
       
    40 Object subclass:#ResizeData
       
    41 	instanceVariableNames:'object selector delta'
       
    42 	classVariableNames:''
       
    43 	poolDictionaries:''
       
    44 	privateIn:UIObjectView
       
    45 !
    45 !
    46 
    46 
    47 !UIObjectView class methodsFor:'documentation'!
    47 !UIObjectView class methodsFor:'documentation'!
    48 
    48 
    49 copyright
    49 copyright
  1321      height     "{ Class:SmallInteger }"
  1321      height     "{ Class:SmallInteger }"
  1322      size       "{ Class:SmallInteger }"
  1322      size       "{ Class:SmallInteger }"
  1323     |
  1323     |
  1324     aView isInputOnly ifTrue:[^ self].
  1324     aView isInputOnly ifTrue:[^ self].
  1325 
  1325 
  1326     (aView shown and:[theDamages notEmpty]) ifFalse:[ ^ theDamages ].
  1326     (aView shown and:[theDamages notEmpty]) ifFalse:[ ^ self ].
  1327 
  1327 
  1328     aView subViews notNil ifTrue:[
  1328     aView subViews notNil ifTrue:[
  1329         aView subViews reverseDo:[:v| self recursiveRepair:theDamages startIn:v ].
  1329         aView subViews reverseDo:[:v| self recursiveRepair:theDamages startIn:v ].
  1330         theDamages isEmpty ifTrue:[ ^ self ].
  1330         theDamages isEmpty ifTrue:[ ^ self ].
  1331     ].
  1331     ].
  1372 
  1372 
  1373                 (w > 0 and:[h > 0])  ifFalse:[w := 0].
  1373                 (w > 0 and:[h > 0])  ifFalse:[w := 0].
  1374             ].
  1374             ].
  1375 
  1375 
  1376             w > 0 ifTrue:[
  1376             w > 0 ifTrue:[
  1377 "/                    aView clearRectangleX:x y:y width:w height:h.
  1377                 aView clearRectangleX:x y:y width:w height:h.
  1378                 aView exposeX:x y:y width:w height:h
  1378                 aView exposeX:x y:y width:w height:h
  1379             ].
  1379             ].
  1380         ] ifFalse:[
  1380             isRepaired ifTrue:[ theDamages removeIndex:anIndex ].
  1381             isRepaired := false
  1381         ]
  1382         ].
       
  1383         isRepaired ifTrue:[ theDamages removeIndex:anIndex ].
       
  1384     ].
  1382     ].
  1385 !
  1383 !
  1386 
  1384 
  1387 selection
  1385 selection
  1388     "returns the current selection
  1386     "returns the current selection
  1418     (selectionHiddenLevel ~~ 0 or:[something isNil]) ifTrue:[
  1416     (selectionHiddenLevel ~~ 0 or:[something isNil]) ifTrue:[
  1419         ^ self
  1417         ^ self
  1420     ].
  1418     ].
  1421     damages := OrderedCollection new.
  1419     damages := OrderedCollection new.
  1422 
  1420 
  1423     (oldClipped := clipChildren) ifTrue:[
  1421     (oldClipped := clipChildren) ifFalse:[
  1424         self clippedByChildren:(clipChildren := false)
  1422         self clippedByChildren:(clipChildren := true)
  1425     ].
  1423     ].
  1426 
  1424 
  1427     self forEach:something do:[:v|
  1425     self forEach:something do:[:v|
  1428         self handlesOf:v do:[:rec :wht|
  1426         self handlesOf:v do:[:aDamage :wht|
  1429             self clearRectangle:rec.
  1427             damages reverseDo:[:el|
  1430             damages add:rec
  1428                 (el intersects:aDamage) ifTrue:[
       
  1429                     damages removeIdentical:el.
       
  1430 
       
  1431                     aDamage left:(aDamage left   min:el left)
       
  1432                            right:(aDamage right  max:el right)
       
  1433                              top:(aDamage top    min:el top)
       
  1434                           bottom:(aDamage bottom max:el bottom)
       
  1435                 ]
       
  1436             ].                        
       
  1437             damages add:aDamage
  1431         ]
  1438         ]
  1432     ].
  1439     ].
  1433 
  1440     self recursiveRepair:damages startIn:self.
  1434     subViews notNil ifTrue:[
  1441 
  1435         self clippedByChildren:(clipChildren := true).
       
  1436         subViews reverseDo:[:v| self recursiveRepair:damages startIn:v ].
       
  1437     ].
       
  1438     oldClipped ~~ clipChildren ifTrue:[
  1442     oldClipped ~~ clipChildren ifTrue:[
  1439         self clippedByChildren:(clipChildren := oldClipped).
  1443         self clippedByChildren:(clipChildren := oldClipped).
  1440     ].
  1444     ].
  1441 ! !
  1445 ! !
  1442 
  1446 
  2325 	    self select:newSel.
  2329 	    self select:newSel.
  2326 	]
  2330 	]
  2327     ].
  2331     ].
  2328 ! !
  2332 ! !
  2329 
  2333 
       
  2334 !UIObjectView::ResizeData methodsFor:'accessing'!
       
  2335 
       
  2336 delta
       
  2337     ^ delta
       
  2338 
       
  2339     "Created: / 2.2.1998 / 13:40:32 / cg"
       
  2340 !
       
  2341 
       
  2342 object
       
  2343     ^ object
       
  2344 
       
  2345     "Created: / 2.2.1998 / 13:40:24 / cg"
       
  2346 !
       
  2347 
       
  2348 object:anObject selector:aSymbol delta:anInteger
       
  2349     object := anObject.
       
  2350     selector := aSymbol.
       
  2351     delta := anInteger.
       
  2352 
       
  2353     "Created: / 2.2.1998 / 13:39:22 / cg"
       
  2354 !
       
  2355 
       
  2356 selector
       
  2357     ^ selector
       
  2358 
       
  2359     "Created: / 2.2.1998 / 13:40:42 / cg"
       
  2360 ! !
       
  2361 
  2330 !UIObjectView::UndoHistory class methodsFor:'constants'!
  2362 !UIObjectView::UndoHistory class methodsFor:'constants'!
  2331 
  2363 
  2332 maxHistorySize
  2364 maxHistorySize
  2333     "returns maximum size of history before removing oldest
  2365     "returns maximum size of history before removing oldest
  2334      record
  2366      record
  2667     "returns true if no undo action is registered
  2699     "returns true if no undo action is registered
  2668     "
  2700     "
  2669     ^ actions isNil
  2701     ^ actions isNil
  2670 ! !
  2702 ! !
  2671 
  2703 
  2672 !UIObjectView::ResizeData methodsFor:'accessing'!
       
  2673 
       
  2674 delta
       
  2675     ^ delta
       
  2676 
       
  2677     "Created: / 2.2.1998 / 13:40:32 / cg"
       
  2678 !
       
  2679 
       
  2680 object
       
  2681     ^ object
       
  2682 
       
  2683     "Created: / 2.2.1998 / 13:40:24 / cg"
       
  2684 !
       
  2685 
       
  2686 object:anObject selector:aSymbol delta:anInteger
       
  2687     object := anObject.
       
  2688     selector := aSymbol.
       
  2689     delta := anInteger.
       
  2690 
       
  2691     "Created: / 2.2.1998 / 13:39:22 / cg"
       
  2692 !
       
  2693 
       
  2694 selector
       
  2695     ^ selector
       
  2696 
       
  2697     "Created: / 2.2.1998 / 13:40:42 / cg"
       
  2698 ! !
       
  2699 
       
  2700 !UIObjectView class methodsFor:'documentation'!
  2704 !UIObjectView class methodsFor:'documentation'!
  2701 
  2705 
  2702 version
  2706 version
  2703     ^ '$Header$'
  2707     ^ '$Header$'
  2704 ! !
  2708 ! !