diff -r bc196200ea8b -r 39acd704ad51 UIPainterView.st --- a/UIPainterView.st Fri May 23 16:06:33 1997 +0200 +++ b/UIPainterView.st Fri May 23 16:07:52 1997 +0200 @@ -17,6 +17,13 @@ category:'Interface-UIPainter' ! +MultiSelectionInList subclass:#ListHolder + instanceVariableNames:'painter propertyList masterElement disabledChanged' + classVariableNames:'' + poolDictionaries:'' + privateIn:UIPainterView +! + Object subclass:#ViewProperty instanceVariableNames:'view spec identifier' classVariableNames:'Identifier' @@ -31,13 +38,6 @@ privateIn:UIPainterView ! -MultiSelectionInList subclass:#ListHolder - instanceVariableNames:'painter propertyList masterElement disabledChanged' - classVariableNames:'' - poolDictionaries:'' - privateIn:UIPainterView -! - !UIPainterView class methodsFor:'documentation'! copyright @@ -179,32 +179,36 @@ #'submenu:' #(#Menu #( #(#MenuItem - #'label:' 'align left' #'value:' #alignSelectionLeft + #'labelImage:' #( ResourceRetriever UIPainter iconAlignL 'align left' ) ) #(#MenuItem - #'label:' 'align right' #'value:' #alignSelectionRight + #'labelImage:' #( ResourceRetriever UIPainter iconAlignR 'align right' ) ) #(#MenuItem - #'label:' 'align left & right' #'value:' #alignSelectionLeftAndRight + #'labelImage:' #( ResourceRetriever UIPainter iconAlignLR 'align left & right' ) ) #(#MenuItem - #'label:' 'align top' #'value:' #alignSelectionTop + #'labelImage:' #( ResourceRetriever UIPainter iconAlignT 'align top' ) + ) + #(#MenuItem + #'value:' #alignSelectionBottom + #'labelImage:' #( ResourceRetriever UIPainter iconAlignB 'align bottom' ) ) #(#MenuItem - #'label:' 'align bottom' #'value:' - #alignSelectionBottom + #'value:' #alignSelectionTopAndBottom + #'labelImage:' #( ResourceRetriever UIPainter iconAlignTB 'align top & bottom' ) ) #(#MenuItem - #'label:' 'align centered vertical' #'value:' #alignSelectionCenterHor + #'labelImage:' #( ResourceRetriever UIPainter iconAlignCenterH 'align centered horizontal' ) ) #(#MenuItem - #'label:' 'align centered horizontal' #'value:' #alignSelectionCenterVer + #'labelImage:' #( ResourceRetriever UIPainter iconAlignCenterV 'align centered vertical' ) ) #(#MenuItem #'label:' 'spread horizontal' @@ -223,7 +227,7 @@ #'value:' #centerSelectionVer ) ) - #(7 2) + #(8 2) nil ) ) @@ -482,7 +486,7 @@ canDrop:anObjectOrCollection |spec| - testMode ifFalse:[ + self enabled ifTrue:[ anObjectOrCollection size == 1 ifTrue:[ spec := (anObjectOrCollection at:1) theObject. ^ (spec isKindOf:UISpecification) @@ -993,7 +997,7 @@ " |menu canPaste| - testMode ifTrue:[^ nil ]. + self enabled ifFalse:[^ nil ]. menu := MenuPanel fromSpec:(self class menu) receiver:self. canPaste := self canPaste:(self getSelection). @@ -1595,138 +1599,6 @@ ! ! -!UIPainterView::ViewProperty class methodsFor:'documentation'! - -version - ^ '$Header$' -! ! - -!UIPainterView::ViewProperty class methodsFor:'instance creation'! - -new - Identifier notNil ifTrue:[Identifier := Identifier + 1] - ifFalse:[Identifier := 1]. - - ^ self basicNew initialize -! ! - -!UIPainterView::ViewProperty methodsFor:'accessing'! - -group - ^ nil -! - -identifier - "return the unique identifier assigned to property - " - ^ identifier -! - -spec - "return the value of the instance variable 'spec' (automatically generated)" - - ^ spec! - -spec:something - "set the value of the instance variable 'spec' (automatically generated)" - - spec := something.! - -view - "return the value of the instance variable 'view' (automatically generated)" - - ^ view! - -view:something - "set the value of the instance variable 'view' (automatically generated)" - - view := something.! ! - -!UIPainterView::ViewProperty methodsFor:'initialization'! - -initialize - super initialize. - identifier := Identifier -! ! - -!UIPainterView::ViewProperty methodsFor:'misc'! - -extractNumberStartingAt:anIndex - "return the number from the name starting at anIndex or 0. - " - |val| - - val := 0. - - self name from:anIndex do:[:c| - c isDigit ifTrue:[val := val * 10 + c digitValue] - ifFalse:[^ 0] - ]. - ^ val - -! ! - -!UIPainterView::ViewProperty methodsFor:'spec messages'! - -doesNotUnderstand:aMessage - spec notNil ifTrue:[ - (spec respondsTo:(aMessage selector)) ifTrue:[^ aMessage sendTo:spec] - ]. - ^ nil -! - -layout - spec layout -! - -layout:aLayout - spec layout:aLayout -! - -name - ^ spec name -! - -name:aName - spec name:aName -! ! - -!UIPainterView::GroupProperties methodsFor:'accessing'! - -controlledObjects - "return the value of the instance variable 'controlledObjects' (automatically generated)" - - ^ controlledObjects! - -controlledObjects:something - "set the value of the instance variable 'controlledObjects' (automatically generated)" - - controlledObjects := something.! - -group - "return the value of the instance variable 'group' - " - ^ group -! - -group:something - "set the value of the instance variable 'group' - " - group := something. -! - -name - "return the value of the group name - " - ^ name -! - -name:aName - "set the value of the group name - " - name := aName -! ! - !UIPainterView::ListHolder class methodsFor:'instance creation'! for:aPainter @@ -1735,10 +1607,6 @@ !UIPainterView::ListHolder methodsFor:'accessing'! -canModify - ^ (painter notNil and:[painter testMode not]) -! - painter "returns painter " @@ -1869,6 +1737,7 @@ for:aPainter "initialize for a painter " + painter := aPainter. self list:(OrderedCollection new). propertyList := OrderedCollection new. self selection:#(). @@ -2017,7 +1886,7 @@ " |start end sel size| - self canModify ifTrue:[ + painter enabled ifTrue:[ (start := self masterElement) ~~ 0 ifTrue:[ end := self lastInGroupStartingAt:start. size := end - start + 1. @@ -2052,8 +1921,8 @@ selectionIndex:aList |masterIndex aSel| - self canModify ifTrue:[aSel := aList] - ifFalse:[aSel := nil]. + painter enabled ifTrue:[aSel := aList] + ifFalse:[aSel := nil]. aSel size ~~ 0 ifTrue:[masterIndex := aSel at:1] ifFalse:[masterIndex := 0]. @@ -2062,6 +1931,138 @@ super selectionIndex:aSel ! ! +!UIPainterView::ViewProperty class methodsFor:'documentation'! + +version + ^ '$Header$' +! ! + +!UIPainterView::ViewProperty class methodsFor:'instance creation'! + +new + Identifier notNil ifTrue:[Identifier := Identifier + 1] + ifFalse:[Identifier := 1]. + + ^ self basicNew initialize +! ! + +!UIPainterView::ViewProperty methodsFor:'accessing'! + +group + ^ nil +! + +identifier + "return the unique identifier assigned to property + " + ^ identifier +! + +spec + "return the value of the instance variable 'spec' (automatically generated)" + + ^ spec! + +spec:something + "set the value of the instance variable 'spec' (automatically generated)" + + spec := something.! + +view + "return the value of the instance variable 'view' (automatically generated)" + + ^ view! + +view:something + "set the value of the instance variable 'view' (automatically generated)" + + view := something.! ! + +!UIPainterView::ViewProperty methodsFor:'initialization'! + +initialize + super initialize. + identifier := Identifier +! ! + +!UIPainterView::ViewProperty methodsFor:'misc'! + +extractNumberStartingAt:anIndex + "return the number from the name starting at anIndex or 0. + " + |val| + + val := 0. + + self name from:anIndex do:[:c| + c isDigit ifTrue:[val := val * 10 + c digitValue] + ifFalse:[^ 0] + ]. + ^ val + +! ! + +!UIPainterView::ViewProperty methodsFor:'spec messages'! + +doesNotUnderstand:aMessage + spec notNil ifTrue:[ + (spec respondsTo:(aMessage selector)) ifTrue:[^ aMessage sendTo:spec] + ]. + ^ nil +! + +layout + spec layout +! + +layout:aLayout + spec layout:aLayout +! + +name + ^ spec name +! + +name:aName + spec name:aName +! ! + +!UIPainterView::GroupProperties methodsFor:'accessing'! + +controlledObjects + "return the value of the instance variable 'controlledObjects' (automatically generated)" + + ^ controlledObjects! + +controlledObjects:something + "set the value of the instance variable 'controlledObjects' (automatically generated)" + + controlledObjects := something.! + +group + "return the value of the instance variable 'group' + " + ^ group +! + +group:something + "set the value of the instance variable 'group' + " + group := something. +! + +name + "return the value of the group name + " + ^ name +! + +name:aName + "set the value of the group name + " + name := aName +! ! + !UIPainterView class methodsFor:'documentation'! version