--- a/UIPainter.st Tue Feb 26 19:10:46 2008 +0100
+++ b/UIPainter.st Tue Feb 26 19:13:21 2008 +0100
@@ -2495,15 +2495,19 @@
^ builder booleanValueAspectFor:#canMoveSelectionOutOfContainer
!
-canPasteKeepingLayoutHolder
+canPasteHolder
|holder|
- (holder := builder bindingAt:#valueOfCanPasteWithKeepingLayout) isNil ifTrue:[
- builder aspectAt:#valueOfCanPasteWithKeepingLayout put:(holder := false asValue).
+ (holder := builder bindingAt:#canPasteHolder) isNil ifTrue:[
+ holder := [ self canPaste ].
].
^ holder
!
+canPasteKeepingLayoutHolder
+ ^ self canPasteHolder
+!
+
canReplaceSelection
treeView isCanvasSelected ifTrue:[^ false].
^ true
@@ -2907,7 +2911,7 @@
updateChannels
"updates the channels"
- |canCutOrCopy canPaste clipboard sel treeSelection|
+ |canCutOrCopy|
self canMoveOrAlignSelection value:(treeView canMoveOrAlignSelection).
self canExchangeSelectionLayouts value:(treeView canExchangeSelectionLayouts).
@@ -2916,26 +2920,11 @@
self canMoveSelectionOutOfContainer value:(treeView canMoveSelectionOutOfContainer).
self hasOneSelectionOtherThanCanvas value:(treeView hasOneSelectionOtherThanCanvas).
- painterView notNil ifTrue:[
- treeSelection := treeView selection.
- "/ the top-node cannot be cut, copied or pasted.
- canCutOrCopy := treeSelection size >= 1 and:[treeSelection first ~~ 1].
- clipboard := painterView getClipboardObject.
-
- clipboard notEmptyOrNil
- ifTrue:[sel := clipboard first]
- ifFalse:[sel := clipboard].
-
- canPaste := (sel isKindOf:UISpecification)
-"/ and:[treeSelection size = 1
-"/ and:[treeSelection first == 1
-"/ or: [self canPasteInto: treeView selectedNode contents view]]]
- ].
+ "/ the top-node cannot be cut, copied or pasted.
+ canCutOrCopy := treeView selection notEmptyOrNil and:[treeView selection first ~~ 1].
self canCutHolder value: canCutOrCopy.
self canCopyHolder value: canCutOrCopy.
- self canPasteHolder value: canPaste.
- self canPasteKeepingLayoutHolder value: (canPaste "& self canKeepLayoutInSelection").
"/ self modifiedChannel value: false.
@@ -3451,6 +3440,21 @@
!UIPainter methodsFor:'queries'!
+canPaste
+ |clipboard sel|
+
+ clipboard := painterView getClipboardObject.
+
+ clipboard notEmptyOrNil
+ ifTrue:[sel := clipboard first]
+ ifFalse:[sel := clipboard].
+
+ ^ (sel isKindOf:UISpecification)
+"/ and:[treeSelection size = 1
+"/ and:[treeSelection first == 1
+"/ or: [self canPasteInto: treeView selectedNode contents view]]]
+!
+
hasSpecClass
"answers whether an application class is defined"