UIObjectView.st
changeset 2349 6fdcf778c5ab
parent 2267 f93749e64030
child 2356 bb961692c387
equal deleted inserted replaced
2348:a9c60093561a 2349:6fdcf778c5ab
  2575 
  2575 
  2576 openUndoMenu
  2576 openUndoMenu
  2577     |list tabs top slv hzp inset selection okButton|
  2577     |list tabs top slv hzp inset selection okButton|
  2578 
  2578 
  2579     history isEmpty ifTrue:[
  2579     history isEmpty ifTrue:[
  2580 	^ self
  2580         ^ self
  2581     ].
  2581     ].
  2582 
  2582 
  2583     top  := StandardSystemView new label:'undo history'; extent:250@350.
  2583     top  := StandardSystemView new label:'undo history'; extent:250@350.
  2584     slv  := ScrollableView for:SelectionInListView origin:0.0@0.0 corner:1.0@1.0 in:top.
  2584     slv  := ScrollableView for:SelectionInListView origin:0.0@0.0 corner:1.0@1.0 in:top.
  2585     hzp  := HorizontalPanelView origin:0.0@1.0 corner:1.0@1.0 in:top.
  2585     hzp  := HorizontalPanelView origin:0.0@1.0 corner:1.0@1.0 in:top.
  2588     (Button abortButtonIn:hzp) action:[ selection := nil. top destroy ].
  2588     (Button abortButtonIn:hzp) action:[ selection := nil. top destroy ].
  2589     okButton := Button okButtonIn:hzp.
  2589     okButton := Button okButtonIn:hzp.
  2590     okButton label:'undo to end'.
  2590     okButton label:'undo to end'.
  2591     okButton action:[ top destroy ].
  2591     okButton action:[ top destroy ].
  2592 
  2592 
  2593     inset := hzp preferredExtent y.
  2593     inset := hzp preferredHeight.
  2594     hzp topInset:(inset negated).
  2594     hzp topInset:(inset negated).
  2595     slv   bottomInset:inset.
  2595     slv   bottomInset:inset.
  2596     slv := slv scrolledView.
  2596     slv := slv scrolledView.
  2597 
  2597 
  2598     tabs := TabulatorSpecification new.
  2598     tabs := TabulatorSpecification new.
  2599     tabs unit:#cm.
  2599     tabs unit:#cm.
  2600     tabs positions:#(0 5).
  2600     tabs positions:#(0 5).
  2601     tabs align:#(#left #left).
  2601     tabs align:#(#left #left).
  2602 
  2602 
  2603     list := history collect:[:aTrans||e|
  2603     list := history collect:[:aTrans||e|
  2604 	e := MultiColListEntry new.
  2604         e := MultiColListEntry new.
  2605 	e colAt:1 put:(aTrans typeAsString).
  2605         e colAt:1 put:(aTrans typeAsString).
  2606 	e colAt:2 put:(aTrans text ? '').
  2606         e colAt:2 put:(aTrans text ? '').
  2607 	e tabulatorSpecification:tabs.
  2607         e tabulatorSpecification:tabs.
  2608 	e
  2608         e
  2609     ].
  2609     ].
  2610 
  2610 
  2611     slv list:list.
  2611     slv list:list.
  2612     slv action:[:index | selection := index ].
  2612     slv action:[:index | selection := index ].
  2613     top openModal.
  2613     top openModal.
  2614 
  2614 
  2615     selection notNil ifTrue:[
  2615     selection notNil ifTrue:[
  2616 	self undoLast:(history size - selection + 1).
  2616         self undoLast:(history size - selection + 1).
  2617     ]
  2617     ]
  2618 ! !
  2618 ! !
  2619 
  2619 
  2620 !UIObjectView::UndoHistory methodsFor:'testing'!
  2620 !UIObjectView::UndoHistory methodsFor:'testing'!
  2621 
  2621