# HG changeset patch # User ca # Date 864211261 -7200 # Node ID c6699a14d3d979a046b910696410130ccf286977 # Parent a00f1446c10b8ed60c1edf377f20090545e1bcdf tools diff -r a00f1446c10b -r c6699a14d3d9 UIPainterView.st --- a/UIPainterView.st Wed May 21 12:40:05 1997 +0200 +++ b/UIPainterView.st Wed May 21 12:41:01 1997 +0200 @@ -11,7 +11,7 @@ " UIObjectView subclass:#UIPainterView - instanceVariableNames:'viewProperties superclassName className methodName categoryName' + instanceVariableNames:'listHolder superclassName className methodName categoryName' classVariableNames:'HandCursor' poolDictionaries:'' category:'Interface-UIPainter' @@ -31,6 +31,13 @@ privateIn:UIPainterView ! +MultiSelectionInList subclass:#ListHolder + instanceVariableNames:'painter propertyList masterElement disabledChanged' + classVariableNames:'' + poolDictionaries:'' + privateIn:UIPainterView +! + !UIPainterView class methodsFor:'documentation'! copyright @@ -63,6 +70,167 @@ ! ! +!UIPainterView class methodsFor:'menu specs'! + +menu + + ^ #(#Menu #( + #(#MenuItem + #'label:' 'copy' + #'nameKey:' #copySelection + #'shortcutKeyCharacter:' #Copy + ) + #(#MenuItem + #'label:' 'cut' + #'nameKey:' #deleteSelection + #'shortcutKeyCharacter:' #Cut + ) + #(#MenuItem + #'label:' 'paste' + #'nameKey:' #paste + #'submenu:' + #(#Menu #( + #(#MenuItem + #'label:' 'paste' + #'nameKey:' #pasteBuffer + #'shortcutKeyCharacter:' #Paste + ) + #(#MenuItem + #'label:' 'keep layout' + #'nameKey:' #pasteWithLayout + ) + ) + nil + nil + ) + ) + #(#MenuItem + #'label:' 'undo' + #'nameKey:' #undoLast) + #(#MenuItem + #'label:' 'arrange' + #'nameKey:' #arrange + #'submenu:' + #(#Menu #( + #(#MenuItem + #'label:' 'to front' + #'nameKey:' #raiseSelection + ) + #(#MenuItem + #'label:' 'to back' + #'nameKey:' #lowerSelection + ) + ) + nil + nil + ) + ) + #(#MenuItem + #'label:' 'dimension' + #'nameKey:' #dimension + #'submenu:' + #(#Menu #( + #(#MenuItem + #'label:' 'default extent' + #'nameKey:' #setToDefaultExtent + ) + #(#MenuItem + #'label:' 'default width' + #'nameKey:' #setToDefaultWidth + ) + #(#MenuItem + #'label:' 'default height' + #'nameKey:' #setToDefaultHeight + ) + #(#MenuItem + #'label:' 'copy extent' + #'nameKey:' #copyExtent + ) + #(#MenuItem + #'label:' 'paste extent' + #'nameKey:' #pasteExtent + ) + #(#MenuItem + #'label:' 'paste width' + #'nameKey:' #pasteWidth + ) + #(#MenuItem + #'label:' 'paste height' + #'nameKey:' #pasteHeight + ) + #(#MenuItem + #'label:' 'copy layout' + #'nameKey:' #copyLayout + ) + #(#MenuItem + #'label:' 'paste layout' + #'nameKey:' #pasteLayout + ) + ) + #(3 1 3) + nil + ) + ) + #(#MenuItem + #'label:' 'align' + #'nameKey:' #align + #'submenu:' + #(#Menu #( + #(#MenuItem + #'label:' 'align left' + #'nameKey:' #alignSelectionLeft + ) + #(#MenuItem + #'label:' 'align right' + #'nameKey:' #alignSelectionRight + ) + #(#MenuItem + #'label:' 'align left & right' + #'nameKey:' #alignSelectionLeftAndRight + ) + #(#MenuItem + #'label:' 'align top' + #'nameKey:' #alignSelectionTop + ) + #(#MenuItem + #'label:' 'align bottom' #'nameKey:' + #alignSelectionBottom + ) + #(#MenuItem + #'label:' 'align centered vertical' + #'nameKey:' #alignSelectionCenterHor + ) + #(#MenuItem + #'label:' 'align centered horizontal' + #'nameKey:' #alignSelectionCenterVer + ) + #(#MenuItem + #'label:' 'spread horizontal' + #'nameKey:' #spreadSelectionHor + ) + #(#MenuItem + #'label:' 'spread vertical' + #'nameKey:' #spreadSelectionVer + ) + #(#MenuItem + #'label:' 'center horizontal in frame' + #'nameKey:' #centerSelectionHor + ) + #(#MenuItem + #'label:' 'center vertical in frame' + #'nameKey:' #centerSelectionVer + ) + ) + #(7 2) + nil + ) + ) + ) + #(4) + nil + ) +! ! + !UIPainterView methodsFor:'accessing'! application @@ -95,6 +263,10 @@ ! +listHolder + ^ listHolder +! + methodName ^ methodName ! @@ -134,6 +306,55 @@ ! ! +!UIPainterView methodsFor:'change & update'! + +changed:aParameter + aParameter == #layout ifTrue:[ + listHolder removeDependent:self. + listHolder changed:aParameter. + listHolder addDependent:self. + ] ifFalse:[ + super changed:aParameter + ] +! + +selectionChanged + "selection has changed + " + |newSel| + + selection notNil ifTrue:[ + self selectionDo:[:aView||p| + (p := self propertyOfView:aView) notNil ifTrue:[ + newSel isNil ifTrue:[ + newSel := OrderedCollection new + ]. + newSel add:(listHolder indexOfName:(p name)) + ] + ] + ]. + listHolder removeDependent:self. + listHolder selectionIndex:newSel. + listHolder addDependent:self. +! + +update:what with:aParm from:aSender + |loIdx newSel| + + (what == #selectionIndex and:[aSender == listHolder]) ifFalse:[ + ^ self + ]. + loIdx := listHolder selectionIndex. + + loIdx size ~~ 0 ifTrue:[ + newSel := loIdx collect:[:i|(listHolder propertyAt:i) view] + ]. + self withSelectionHiddenDo:[ + selection := newSel + ]. + +! ! + !UIPainterView methodsFor:'copy & cut & paste'! copySelection @@ -161,21 +382,21 @@ coll := self minSetOfSuperViews:selection. coll notNil ifTrue:[ - self unselect. - specs := coll collect:[:aView| self fullSpecFor:aView ]. - text := self transactionTextFor:coll. + listHolder disableNotificationsWhileEvaluating:[ + self unselect. + specs := coll collect:[:aView| self fullSpecFor:aView ]. + text := self transactionTextFor:coll. - undoHistory transaction:#cut text:text do:[ - coll reverseDo:[:o||p| - (p := self propertyOfView:o) notNil ifTrue:[ - self undoRemove:(p identifier) - ]. - self remove:o - ] - ]. - - self setSelection:specs. - self changed:#tree. + undoHistory transaction:#cut text:text do:[ + coll reverseDo:[:o||p| + (p := self propertyOfView:o) notNil ifTrue:[ + self undoRemove:(p identifier) + ]. + self remove:o + ] + ]. + self setSelection:specs. + ] ] ! @@ -189,7 +410,7 @@ pasteSpecifications:aSpecificationOrList keepLayout:keepLayout "add the specs to the object view " - |paste frame pasteOrigin pasteOffset builder| + |paste frame pasteOrigin pasteOffset builder newSel| (self canPaste:aSpecificationOrList) ifFalse:[ ^ self @@ -206,8 +427,8 @@ ]. self unselect. - selection := OrderedCollection new. - builder := UIBuilder new. + newSel := OrderedCollection new. + builder := UIBuilder new. keepLayout ifFalse:[ pasteOffset := 0@0. @@ -215,36 +436,35 @@ pasteOrigin := device translatePoint:pasteOrigin from:device rootView id to:frame id. ]. - paste do:[:aSpec| - |view| + listHolder disableNotificationsWhileEvaluating:[ + paste do:[:aSpec| + |view| - view := self addSpec:aSpec builder:builder in:frame. + view := self addSpec:aSpec builder:builder in:frame. - keepLayout ifFalse:[ - (frame bounds containsPoint:pasteOrigin) ifFalse:[ - self moveObject:view to:pasteOffset. - ] ifTrue:[ - self moveObject:view to:pasteOrigin + pasteOffset. + keepLayout ifFalse:[ + (frame bounds containsPoint:pasteOrigin) ifFalse:[ + self moveObject:view to:pasteOffset. + ] ifTrue:[ + self moveObject:view to:pasteOrigin + pasteOffset. + ]. + pasteOffset := pasteOffset + 4 ]. - pasteOffset := pasteOffset + 4 + view realize. + newSel add:view. ]. - view realize. - selection add:view. ]. - self transaction:#paste selectionDo:[:v| + self transaction:#paste objects:newSel do:[:v| self undoCreate:((self propertyOfView:v) identifier) ]. - selection size == 1 ifTrue:[ - selection := selection at:1 + newSel size == 1 ifTrue:[ + newSel := newSel at:1 ]. - self showSelection. self realizeAllSubViews. inputView raise. + self select:newSel. self elementChangedSize:frame. - self changed:#tree - - "Modified: 8.4.1997 / 01:08:15 / cg" ! pasteWithLayout @@ -317,7 +537,7 @@ ]. cls := Smalltalk classNamed:className. - viewProperties do:[:aProp | + listHolder propertiesDo:[:aProp | |modelSelector menuSelector protoSpec thisCode| (modelSelector := aProp model) notNil ifTrue:[ @@ -340,7 +560,17 @@ thisCode := (self generateAspectMethodFor:menuSelector spec:protoSpec inClass:cls). code := code , thisCode ] - ] + ]. + + aProp spec aspectSelectors do:[:aSel| + (cls implements:aSel asSymbol) ifFalse:[ + protoSpec := aProp view specClass basicNew. + "/ kludge .. + thisCode := (self generateAspectMethodFor:aSel spec:protoSpec inClass:cls). + code := code , thisCode + ] + ]. + ]. ^ code @@ -421,7 +651,7 @@ "generate code for groups" - viewProperties do:[:props | + listHolder propertiesDo:[:props| g := props at:#group ifAbsent:[nil]. g notNil ifTrue:[ code := code , (self generateInitCodeForGroup:g) @@ -618,7 +848,7 @@ ! storeContentsOn:aStream - viewProperties do:[:p| p storeOn:aStream] + listHolder propertiesDo:[:p| p storeOn:aStream] ! subviewsOf:aView do:aBlock @@ -627,7 +857,7 @@ (subs := aView subViews) notNil ifTrue:[ subs do:[:v| (v ~~ inputView and:[v notNil]) ifTrue:[ - (viewProperties detect:[:p | p view == v] ifNone:nil) notNil ifTrue:[ + (listHolder detectProperty:[:p|p view == v]) notNil ifTrue:[ (v superView == aView) ifTrue:[ aBlock value:v ] @@ -653,13 +883,13 @@ self withSelectionHiddenDo:[ group := EnterFieldGroup new. props := GroupProperties new. - name := self uniqueNameFor:EnterFieldGroup. + name := self uniqueNameFor:(EnterFieldGroup className). props group:group. props name:name. group groupID:name asSymbol. objects := OrderedCollection new. props controlledObjects:objects. - viewProperties add:props. + listHolder add:props. self selectionDo:[:aView | objects add:aView. @@ -683,13 +913,13 @@ self withSelectionHiddenDo:[ group := RadioButtonGroup new. props := GroupProperties new. - name := self uniqueNameFor:RadioButtonGroup. + name := self uniqueNameFor:(RadioButtonGroup className). props group:group. props name:name. group groupID:name asSymbol. objects := OrderedCollection new. props controlledObjects:objects. - viewProperties add:props. + listHolder add:props. self selectionDo:[:aView | aView turnOff. @@ -712,10 +942,9 @@ className := 'NewApplication'. methodName := 'windowSpec'. categoryName := 'Applications'. - viewProperties := OrderedCollection new. + listHolder := ListHolder for:self. HandCursor := Cursor leftHand. - "Modified: 5.9.1995 / 19:58:06 / claus" ! initializeCreatedObject:anObject @@ -728,8 +957,8 @@ props := ViewProperty new. props view:anObject. props spec:spec. - props name:(self uniqueNameFor:cls). - viewProperties add:props. + props name:(self uniqueNameFor:spec). + listHolder add:props. ((spec respondsTo:#label:) and:[self supportsLabel:anObject]) ifTrue:[ anObject label:(props name). @@ -744,15 +973,15 @@ setupFromSpec:specOrSpecArray |spec builder| - self removeAll. - - spec := UISpecification from:specOrSpecArray. - builder := UIBuilder new. - spec window setupView:self topView for:builder. - self addSpec:(spec component) builder:builder in:self. - self realizeAllSubViews. - inputView raise. - self changed:#tree. + listHolder disableNotificationsWhileEvaluating:[ + self removeAll. + spec := UISpecification from:specOrSpecArray. + builder := UIBuilder new. + spec window setupView:self topView for:builder. + self addSpec:(spec component) builder:builder in:self. + self realizeAllSubViews. + inputView raise. + ] ! ! !UIPainterView methodsFor:'menus'! @@ -760,67 +989,25 @@ menu "returns middle-button menu dependent on the selection " - |menu canPaste undoIdx undoText| + |menu canPaste| testMode ifTrue:[^ nil ]. + menu := MenuPanel fromSpec:(self class menu) receiver:self. canPaste := self canPaste:(self getSelection). - undoText := undoHistory lastTypeAsString. selection isNil ifTrue:[ - undoIdx := 2. - - menu := PopUpMenu labels:( resources array:#('paste' 'undo') ) - selectors:#( #paste #undoLast ) - receiver:self - ] ifFalse:[ - undoIdx := 4. - - menu := PopUpMenu labels:( resources array:#( - 'copy' - 'cut' - 'paste' - 'undo' - '-' - 'arrange' - 'dimension' - 'align' - ) - ) - selectors:#( #copySelection - #deleteSelection - #paste - #undoLast - nil - #arrange - #dimension - #align - ) - accelerators:#(#Copy - #Cut - nil - nil - nil - nil - nil - nil - ) - receiver:self. - - canPaste := (canPaste and:[self canPasteInto:selection]). - menu subMenuAt:#arrange put:(self subMenuArrange). - menu subMenuAt:#dimension put:(self subMenuDimension). - menu subMenuAt:#align put:(self subMenuAlign). + menu disableAll + ] ifFalse:[ + canPaste := (canPaste and:[self canPasteInto:selection]) + ]. + menu enabledAt:#paste put:[|can| + can := self canPaste:(self getSelection). + selection isNil ifTrue:[can] + ifFalse:[(can and:[self canPasteInto:selection])] ]. - menu subMenuAt:#paste put:(self subMenuPaste). - canPaste ifFalse:[menu disable:#paste]. - - undoText notNil ifTrue:[ - menu labelAt:undoIdx put:((menu labels at:undoIdx), ': ', undoText) - ] ifFalse:[ - menu disable:#undoLast - ]. + menu enabledAt:#undoLast put:(undoHistory notEmpty). ^ menu @@ -843,154 +1030,6 @@ ] "Modified: 10.4.1997 / 10:06:15 / cg" -! - -subMenuAlign - "returns submenu alignment - " - |menu| - - menu := PopUpMenu labels:( - resources array:#( - 'align left' - 'align right' - 'align left & right' - 'align top' - 'align bottom' - 'align centered vertical' - 'align centered horizontal' - '-' - 'spread horizontal' - 'spread vertical' - '-' - 'center horizontal in frame' - 'center vertical in frame' - ) - ) - - selectors:#( - alignSelectionLeft - alignSelectionRight - alignSelectionLeftAndRight - alignSelectionTop - alignSelectionBottom - alignSelectionCenterHor - alignSelectionCenterVer - nil - spreadSelectionHor - spreadSelectionVer - nil - centerSelectionHor - centerSelectionVer - ) - receiver:self. - ^ menu - -! - -subMenuArrange - "returns submenu arrange - " - |menu| - - menu := PopUpMenu labels:( - resources array:#( - 'to front' - 'to back' - ) - ) - selectors:#( - raiseSelection - lowerSelection - ) - receiver:self. - ^ menu -! - -subMenuDimension - "returns submenu dimension - " - |menu| - - menu := PopUpMenu labels:( - resources array:#( - 'default extent' - 'default width' - 'default height' - '-' - 'copy extent' - '-' - 'paste extent' - 'paste width' - 'paste height' - '-' - 'copy layout' - 'paste layout' - ) - ) - selectors:#( - setToDefaultExtent - setToDefaultWidth - setToDefaultHeight - nil - copyExtent - nil - pasteExtent - pasteWidth - pasteHeight - nil - copyLayout - pasteLayout - ) - receiver:self. - ^ menu -! - -subMenuFont - "returns submenu dimension - " - |menu| - - menu := PopUpMenu labels:( - resources array:#( - 'larger' - 'smaller' - '-' - 'normal' - 'bold' - 'italic' - 'bold italic' - '-' - 'font panel' - ) - ) - selectors:#( - largerFont - smallerFont - nil - normalFont - boldFont - italicFont - boldItalicFont - nil - showFontPanel - ) - receiver:self. - ^ menu -! - -subMenuPaste - "returns submenu Paste - " - |menu| - - menu := PopUpMenu labels:( resources array:#('paste' 'keep layout') ) - selectors:#( #pasteBuffer #pasteWithLayout ) - accelerators:#( #Paste nil ) - receiver:self. - - ^ menu - ! ! !UIPainterView methodsFor:'misc'! @@ -1011,7 +1050,6 @@ self elementChangedSize:aView. ] ]. - self changed:#any. ] "Modified: 5.9.1995 / 12:13:27 / claus" @@ -1032,8 +1070,7 @@ aView font:f. self elementChangedSize:aView. ] - ]. - self changed:#any. + ] ] "Modified: 5.9.1995 / 12:13:27 / claus" @@ -1044,36 +1081,17 @@ remove:anObject "remove anObject from the contents do redraw " - |props| - - anObject notNil ifTrue:[ - (anObject subViews notNil) ifTrue:[ - anObject subViews copy do:[:sub | - self remove:sub - ] - ]. - (props := self propertyOfView:anObject) notNil ifTrue:[ - viewProperties remove:props ifAbsent:nil - ]. - anObject destroy - ] + listHolder remove:anObject. ! removeAll "remove all objects and properties " - self unselect. - viewProperties := OrderedCollection new. - - subViews notNil ifTrue:[ - subViews copy do:[:sub | - sub ~~ inputView ifTrue:[ - self remove:sub - ] - ] - ]. - undoHistory reinitialize. - self changed:#tree + listHolder disableNotificationsWhileEvaluating:[ + self unselect. + listHolder removeAll. + undoHistory reinitialize. + ] ! ! !UIPainterView methodsFor:'searching'! @@ -1127,14 +1145,14 @@ propertyOfGroup:aGroup "returns property assigned to group " - ^ viewProperties detect:[:p| p group == aGroup] ifNone:nil + ^ listHolder detectProperty:[:p| p group == aGroup ] ! propertyOfIdentifier:anId "returns property assigned to unique identifier " anId notNil ifTrue:[ - ^ viewProperties detect:[:p| p identifier == anId] ifNone:nil. + ^ listHolder detectProperty:[:p| p identifier == anId ] ]. ^ nil ! @@ -1142,8 +1160,14 @@ propertyOfName:aString "returns property assigned to name " - aString = 'self' ifFalse:[ - ^ viewProperties detect:[:p| p name = aString] ifNone:nil + |name| + + aString isNil ifFalse:[ + name := aString string withoutSeparators. + + name = 'self' ifFalse:[ + ^ listHolder detectProperty:[:p| p name = name ]. + ] ]. ^ nil ! @@ -1152,23 +1176,30 @@ "returns property assigned to view " (aView isNil or:[aView == self]) ifFalse:[ - ^ viewProperties detect:[:p| p view == aView] ifNone:nil + ^ listHolder detectProperty:[:p| p view == aView ] ]. ^ nil ! -uniqueNameFor:aClass +uniqueNameFor:aSpecOrString "generate and return an unique name for a class " |next name size| - next := 0. - name := aClass name asString copy. - size := name size + 1. + aSpecOrString isString ifFalse:[name := aSpecOrString className asString] + ifTrue:[name := aSpecOrString]. + (name endsWith:'Spec') ifTrue:[ + name := name copyFrom:1 to:(name size - 4). + ] ifFalse:[ + name := name copy + ]. name at:1 put:(name at:1) asLowercase. + size := name size + 1. + next := 0. - viewProperties do:[:p||n| + listHolder propertiesDo:[:p| + |n| n := p name. (n size >= size and:[n startsWith:name]) ifTrue:[ @@ -1184,19 +1215,15 @@ ! uniqueNameOf:aView - |name prop| + |prop| - aView notNil ifTrue:[ - prop := self propertyOfView:aView + (prop := self propertyOfView:aView) notNil ifTrue:[ + prop name isNil ifTrue:[ + prop name:(self uniqueNameFor:(prop spec)). + ]. + ^ prop name ]. - prop isNil ifTrue:[ - ^ 'self' - ]. - (name := prop name) isNil ifTrue:[ - name := self uniqueNameFor:(aView class). - prop name:name. - ]. - ^ name + ^ 'self' ! ! @@ -1241,7 +1268,7 @@ self withSelectionHiddenDo:[ selection := aCollection ]. - self changed:#selection + self selectionChanged ] ! ! @@ -1253,7 +1280,7 @@ " aBuilder applicationClass:(Smalltalk classNamed:className). - aBuilder componentCreationHook:[:aView :aSpec :aBdr||sv p s| + aBuilder componentCreationHook:[:aView :aSpec :aBdr||sv p s n| p := ViewProperty new. s := aSpec copy. p spec:s. @@ -1263,10 +1290,12 @@ s component:nil ]. - (self propertyOfName:(s name)) notNil ifTrue:[ - s name:(self uniqueNameFor:(aView class)) + n := s name. + + (n isNil or:[(self propertyOfName:n) notNil]) ifTrue:[ + s name:(self uniqueNameFor:s) ]. - viewProperties add:p + listHolder add:p ]. ^ aSpecification buildViewWithLayoutFor:aBuilder in:aFrame. @@ -1351,11 +1380,10 @@ aSpec setAttributesIn:aView with:builder. self elementChangedSize:aView. ]. - props spec:(aSpec copy). + listHolder propertyChanged:props. ] - ]. - self changed:#tree + ] ] ! ! @@ -1556,6 +1584,7 @@ spec setAttributesIn:view with:builder. self elementChangedSize:view. ]. + listHolder propertyChanged:props. ] ] ]. @@ -1696,6 +1725,342 @@ name := aName ! ! +!UIPainterView::ListHolder class methodsFor:'instance creation'! + +for:aPainter + ^ self new for:aPainter +! ! + +!UIPainterView::ListHolder methodsFor:'accessing'! + +canModify + ^ (painter notNil and:[painter testMode not]) +! + +painter + "returns painter + " + ^ painter +! + +propertyAt:anIndex + "returns property at an index + " + ^ propertyList at:anIndex +! ! + +!UIPainterView::ListHolder methodsFor:'adding & removing'! + +add:aProperty + "add property and update list + " + |idx list name last| + + list := self list. + idx := self findParentProperty:aProperty. + name := aProperty name. + + idx == 0 ifTrue:[ + last := list size + ] ifFalse:[ + last := self lastInGroupStartingAt:idx. + name := (String new:(4+((list at:idx) leftIndent))), name. + ]. + propertyList add:aProperty afterIndex:last. + list add:name afterIndex:last. + self changed:#size + + +! + +remove:aView + "remove all view relevant resources + " + |start| + + aView notNil ifTrue:[ + start := self findProperty:[:p| p view == aView ]. + + start ~~ 0 ifTrue:[ + self basicRemove:start. + self changed:#size. + ] + ] +! + +removeAll + masterElement := nil. + self selection:#(). + + [propertyList notEmpty] whileTrue:[ + self basicRemove:1 + ]. + self changed:#size. + +! ! + +!UIPainterView::ListHolder methodsFor:'change & update'! + +changed:aParameter + "notify all dependents that the receiver has changed somehow. + Each dependent gets a '#update:'-message with aParameter + as argument. In case of disabled no notifications are raised + " + disabledChanged ifFalse:[ + super changed:aParameter + ] +! + +disableNotificationsWhileEvaluating:aBlock + "perform block without notification; after evaluation of block, + a #size changed notification is raised + " + |oldState| + + oldState := disabledChanged. + disabledChanged := true. + aBlock value. + disabledChanged := oldState. + self changed:#size. +! + +propertyChanged:aProperty + "property list changed; update list names + " + |list idx oldName newName wspName view indent mid| + + view := aProperty view. + idx := self findProperty:[:p| p view == view ]. + + idx == 0 ifTrue:[ + ^ self error + ]. + + list := self list. + oldName := list at:idx. + wspName := oldName string withoutSeparators. + newName := aProperty name. + + wspName = newName ifFalse:[ + mid := self masterElement. + list at:idx put:((String new:(oldName leftIndent)), newName). + + idx == mid ifTrue:[ + masterElement := nil. + self masterElement:idx + ]. + ]. + self changed:#property + +! ! + +!UIPainterView::ListHolder methodsFor:'enumerating'! + +propertiesDo:aBlock + "evaluate a block for each property + " + propertyList do:aBlock +! ! + +!UIPainterView::ListHolder methodsFor:'initialization'! + +for:aPainter + "initialize for a painter + " + self list:(OrderedCollection new). + propertyList := OrderedCollection new. + self selection:#(). + disabledChanged := false. + painter := aPainter. + self addDependent:painter. + + +! ! + +!UIPainterView::ListHolder methodsFor:'private'! + +basicRemove:start + "remove all resources assigned to a group starting at start; + no notifications are raised + " + |end view superView| + + end := self lastInGroupStartingAt:start. + view := (propertyList at:start) view. + + view notNil ifTrue:[ + superView := view superView. + view destroy. + superView sizeChanged:nil. + ]. + + propertyList removeFromIndex:start toIndex:end. + self list removeFromIndex:start toIndex:end. +! + +masterElement + "returns index of master + " + ^ self indexOfName:masterElement. +! + +masterElement:newIndex + "change master of selection + " + |name list oldIdx| + + (oldIdx := self masterElement) ~~ newIndex ifTrue:[ + list := self list. + + oldIdx ~~ 0 ifTrue:[ + list at:oldIdx put:masterElement + ]. + newIndex ~~ 0 ifTrue:[ + masterElement := list at:newIndex. + name := Text string:masterElement. + name emphasizeFrom:(1+(name leftIndent)) with:#(#bold #underline). + list at:newIndex put:name. + ] ifFalse:[ + masterElement := nil + ]. + self changed:#list. + ] +! ! + +!UIPainterView::ListHolder methodsFor:'searching'! + +detectProperty:aBlock + "find the property, for which evaluation of the argument, aBlock + returns true; return the property or nil if none detected + " + |idx| + + idx := self findProperty:aBlock. + idx ~~ 0 ifTrue:[ ^ propertyList at:idx ]. + ^ nil +! + +findParentProperty:aChildProp + "returns index of parent or 0 + " + |view index| + + view := aChildProp view. + + view notNil ifTrue:[ + [ (view := view superView) notNil ] whileTrue:[ + index := self findProperty:[:aProp| aProp view == view ]. + index ~~ 0 ifTrue:[ + ^ index + ] + ] + ]. + ^ 0 + + +! + +findProperty:aBlock + "find the first property, for which evaluation of the argument, aBlock + returns true; return its index or 0 if none detected + " + ^ propertyList findFirst:aBlock +! + +indexOfName:aString + "returns index assigned to a string or 0 + " + |name list size| + + aString notNil ifTrue:[ + name := aString string withoutSeparators. + size := name size. + list := self list. + + list keysAndValuesDo:[:anIndex :aName| + |el| + + el := aName string. + (el endsWith:name) ifTrue:[ + (el size - el leftIndent) == name size ifTrue:[ + ^ anIndex + ] + ] + ] + ]. + ^ 0 + +! + +lastInGroupStartingAt:start + "returns last index of a group + " + |end list idt| + + list := self list. + + start < list size ifTrue:[ + idt := (list at:start) leftIndent. + end := list findFirst:[:el|(el leftIndent) <= idt] startingAt:(start+1). + end ~~ 0 ifTrue:[ + ^ end - 1 + ] + ]. + ^ list size +! ! + +!UIPainterView::ListHolder methodsFor:'selection'! + +selectGroup + "select all elements assigned to master + " + |start end sel size| + + self canModify ifTrue:[ + (start := self masterElement) ~~ 0 ifTrue:[ + end := self lastInGroupStartingAt:start. + size := end - start + 1. + sel := Array new:size. + + 1 to:size do:[:i| + sel at:i put:start. + start := start + 1 + ]. + self selectionIndex:sel. + ] ifFalse:[ + (self selectionIndex) size == 0 ifFalse:[ + self selectionIndex:#() + ]. + ] + ] +! + +selectedProperty + "returns current selected instance; in case of multiple selection + or no selection nil is returned + " + |selection| + selection := self selectionIndex. + + selection size == 1 ifTrue:[ + ^ propertyList at:(selection at:1) + ]. + ^ nil +! + +selectionIndex:aList + |masterIndex aSel| + + self canModify ifTrue:[aSel := aList] + ifFalse:[aSel := nil]. + + aSel size ~~ 0 ifTrue:[masterIndex := aSel at:1] + ifFalse:[masterIndex := 0]. + + self masterElement:masterIndex. + super selectionIndex:aSel +! ! + !UIPainterView class methodsFor:'documentation'! version diff -r a00f1446c10b -r c6699a14d3d9 UIPropertyView.st --- a/UIPropertyView.st Wed May 21 12:40:05 1997 +0200 +++ b/UIPropertyView.st Wed May 21 12:41:01 1997 +0200 @@ -1,30 +1,200 @@ ApplicationModel subclass:#UIPropertyView - instanceVariableNames:'builderView modified currentView shownSpec propertyAspects - layoutAspects layoutType specBeingEdited specChannel - propertySelection' + instanceVariableNames:'window specClass aspects modified modifiedHolder' classVariableNames:'' poolDictionaries:'' category:'Interface-UIPainter' ! +UIPropertyView subclass:#Dimension + instanceVariableNames:'noteBook forView selection layoutTypes' + classVariableNames:'' + poolDictionaries:'' + privateIn:UIPropertyView +! + +UIPropertyView subclass:#Specification + instanceVariableNames:'specEdited specChannel' + classVariableNames:'' + poolDictionaries:'' + privateIn:UIPropertyView +! + +!UIPropertyView class methodsFor:'documentation'! + +documentation +" + provides tools to the UIPainter accessing and manipulation + properties and/or layouts. +" + +! ! !UIPropertyView class methodsFor:'instance creation'! -in:aTopView builder:aBuilderView - |application| +for:aTool in:aTopview + |cls appl| + + cls := Smalltalk classNamed:(self name asString, '::', aTool asString). + appl := cls new. + appl origin:0.0@0.0 corner:1.0@1.0 in:aTopview. + ^ appl +! + +in:aTopview + |appl| + + appl := self new. + appl origin:0.0@0.0 corner:1.0@1.0 in:aTopview. + ^ appl +! ! + +!UIPropertyView methodsFor:'accessing'! + +buildFromSpec:aSpec + |state subViews backGroundColor| + + aSpec ~= specClass ifTrue:[ + window destroySubViews. + + aSpec notNil ifTrue:[ + builder buildFromSpec:aSpec in:window. + window allViewBackground:(self viewBackground). + window realizeAllSubViews + ] + ]. + specClass := aSpec. + self modified:false + +! - application := self new. - application in:aTopView builder:aBuilderView. - ^ application +modified + "returns modifying state + " + ^ modified +! + +modified:aState + "set modifying state + " + modified := aState. + + modifiedHolder notNil ifTrue:[ + modifiedHolder value ~~ modified ifTrue:[ + modifiedHolder value:modified + ] + ] +! + +modifiedHolder + "returns the value holder set to true in case of modifying attributes + " + ^ modifiedHolder +! + +modifiedHolder:aValueHolder + "set the value holder set to true in case of modifying attributes + " + modifiedHolder notNil ifTrue:[ + modifiedHolder removeDependent:self. + ]. + + (modifiedHolder := aValueHolder) notNil ifTrue:[ + modifiedHolder addDependent:self. + modifiedHolder setValue:modified. + ]. ! ! -!UIPropertyView class methodsFor:'constants'! +!UIPropertyView methodsFor:'accessing hierarchy'! + +lower + "bring window to back + " + self window back +! -titleOfLayoutMenu - ^ 'Dimension' +raise + "bring window to front + " + self window raise +! + +viewBackground + ^ window viewBackground +! + +viewBackground:aColor + window viewBackground:aColor +! + +window + "returns window application is running in + " + ^ window ! ! -!UIPropertyView class methodsFor:'interface specs'! +!UIPropertyView methodsFor:'bindings'! + +aspectFor:aKey + "returns aspect for a key or nil + " + aspects notNil ifTrue:[ + ^ aspects at:aKey ifAbsent:nil + ]. + ^ super aspectFor:aKey + +! + +aspects + "returned monitored aspects + " + ^ aspects +! + +aspects:aListOfAspects + "set aspects to be monitored + " + (aspects := aListOfAspects) notNil ifTrue:[ + aspects do:[:el | el addDependent:self ]. + ]. + self modified:false. +! ! + +!UIPropertyView methodsFor:'change & update'! + +update:something with:someArgument from:someone + "any attribute changed its state in the current specification + " + someone == modifiedHolder ifTrue:[ + modified := modifiedHolder value + ] ifFalse:[ + self modified:true + ] +! ! + +!UIPropertyView methodsFor:'initialization'! + +closeRequest + modifiedHolder notNil ifTrue:[ + modifiedHolder removeDependent:self. + modifiedHolder := nil. + ]. + + super closeRequest + + +! + +initialize + super initialize. + modified := false. +! + +origin:anOrigin corner:aCorner in:aTopview + window := SimpleView origin:anOrigin corner:aCorner in:aTopview + +! ! + +!UIPropertyView::Dimension class methodsFor:'interface specs'! specificationAlignmentOrigin "this window spec was automatically generated by the ST/X UIPainter" @@ -33,14 +203,14 @@ handle the specification if its corrupted." " - UIPainter new openOnClass:UIPropertyView andSelector:#specificationAlignmentOrigin - UIPropertyView new openInterface:#specificationAlignmentOrigin + UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationAlignmentOrigin + UIPropertyView::Dimension new openInterface:#specificationAlignmentOrigin " ^ - + #(#FullSpec #'window:' #(#WindowSpec @@ -54,81 +224,52 @@ #'collection:' #( #(#LabelSpec - #'name:' 'label9' - #'layout:' #(#AlignmentOrigin 76 0 7 0 1 0) - #'label:' 'Layout:' - #'initiallyInvisible:' false - #'translateLabel:' false - #'level:' 0 - #'adjust:' #center - #'hasCharacterOrientedLabel:' true - ) - #(#PopUpListSpec - #'name:' 'popUpList1' - #'layout:' #(#LayoutFrame 79 0.0 7 0 -6 1.0 30 0) - #'label:' 'popup' - #'initiallyInvisible:' false - #'translateLabel:' false - #'model:' #layoutType - #'menu:' #layoutTypeList - ) - #(#LabelSpec #'name:' 'label2' - #'layout:' #(#AlignmentOrigin 49 0 103 0 1 0) + #'layout:' #(#AlignmentOrigin 49 0 68 0 1 0) #'label:' 'top' - #'initiallyInvisible:' false - #'translateLabel:' false #'level:' 0 #'adjust:' #right #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label3' - #'layout:' #(#Point 58 48) + #'layout:' #(#Point 58 13) #'label:' 'relative' - #'initiallyInvisible:' false - #'translateLabel:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label4' - #'layout:' #(#Point 154 49) + #'layout:' #(#Point 154 14) #'label:' 'offset' - #'initiallyInvisible:' false - #'translateLabel:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label5' - #'layout:' #(#AlignmentOrigin 63 0 175 0 1 0) + #'layout:' #(#AlignmentOrigin 63 0 140 0 1 0) #'label:' 'align H' - #'initiallyInvisible:' false - #'translateLabel:' false #'level:' 0 #'adjust:' #right #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label6' - #'layout:' #(#AlignmentOrigin 63 0 201 0 1 0) + #'layout:' #(#AlignmentOrigin 63 0 166 0 1 0) #'label:' 'align V' - #'initiallyInvisible:' false - #'translateLabel:' false #'level:' 0 #'adjust:' #right #'hasCharacterOrientedLabel:' true ) #(#InputFieldSpec #'name:' 'editField1' - #'layout:' #(#LayoutFrame 58 0 76 0 115 0 94 0) + #'layout:' #(#LayoutFrame 58 0 41 0 115 0 59 0) #'model:' #leftFraction #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -137,11 +278,11 @@ ) #(#InputFieldSpec #'name:' 'editField2' - #'layout:' #(#LayoutFrame 58 0 103 0 115 0 121 0) + #'layout:' #(#LayoutFrame 58 0 68 0 115 0 86 0) #'model:' #topFraction #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -150,11 +291,11 @@ ) #(#InputFieldSpec #'name:' 'editField5' - #'layout:' #(#LayoutFrame 68 0 175 0 125 0 193 0) + #'layout:' #(#LayoutFrame 68 0 140 0 125 0 158 0) #'model:' #leftAlignmentFraction #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -163,11 +304,11 @@ ) #(#InputFieldSpec #'name:' 'editField6' - #'layout:' #(#LayoutFrame 68 0 201 0 125 0 219 0) + #'layout:' #(#LayoutFrame 68 0 166 0 125 0 184 0) #'model:' #topAlignmentFraction #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -176,11 +317,11 @@ ) #(#InputFieldSpec #'name:' 'editField3' - #'layout:' #(#LayoutFrame 154 0 76 0 212 0 94 0) + #'layout:' #(#LayoutFrame 154 0 41 0 212 0 59 0) #'model:' #leftOffset #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -189,11 +330,11 @@ ) #(#InputFieldSpec #'name:' 'editField4' - #'layout:' #(#LayoutFrame 154 0 103 0 212 0 121 0) + #'layout:' #(#LayoutFrame 154 0 68 0 212 0 86 0) #'model:' #topOffset #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -202,167 +343,165 @@ ) #(#ActionButtonSpec #'name:' 'button1' - #'layout:' #(#LayoutFrame 119 0 76 0 138 0 94 0) + #'layout:' #(#LayoutFrame 119 0 41 0 138 0 59 0) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeRelativeLeft + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'button2' - #'layout:' #(#LayoutFrame 119 0 103 0 138 0 121 0) + #'layout:' #(#LayoutFrame 119 0 68 0 138 0 86 0) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeRelativeTop + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'button3' - #'layout:' #(#LayoutFrame 217 0 76 0 236 0 94 0) + #'layout:' #(#LayoutFrame 217 0 41 0 236 0 59 0) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeOffsetLeft + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'button4' - #'layout:' #(#LayoutFrame 217 0 103 0 236 0 121 0) + #'layout:' #(#LayoutFrame 217 0 68 0 236 0 86 0) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeOffsetTop + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'button8' - #'layout:' #(#LayoutFrame 119 0 137 0 138 0 155 0) + #'layout:' #(#LayoutFrame 119 0 102 0 138 0 120 0) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeRelativeLeftTop + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'button9' - #'layout:' #(#LayoutFrame 217 0 137 0 236 0 155 0) + #'layout:' #(#LayoutFrame 217 0 102 0 236 0 120 0) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeOffsetLeftTop + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#LabelSpec #'name:' 'label7' - #'layout:' #(#AlignmentOrigin 49 0 137 0 1 0) + #'layout:' #(#AlignmentOrigin 49 0 102 0 1 0) #'label:' 'all' - #'initiallyInvisible:' false - #'translateLabel:' false #'level:' 0 #'adjust:' #right #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label1' - #'layout:' #(#AlignmentOrigin 49 0 76 0 1 0) + #'layout:' #(#AlignmentOrigin 49 0 41 0 1 0) #'label:' 'left' - #'initiallyInvisible:' false - #'translateLabel:' false #'level:' 0 #'adjust:' #right #'hasCharacterOrientedLabel:' true ) #(#DividerSpec #'name:' 'separator1' - #'layout:' #(#Rectangle 154 177 203 188) + #'layout:' #(#Rectangle 154 142 203 153) #'orientation:' #horizontal ) #(#DividerSpec #'name:' 'separator2' - #'layout:' #(#Rectangle 154 208 203 219) + #'layout:' #(#Rectangle 154 173 203 184) #'orientation:' #horizontal ) #(#DividerSpec #'name:' 'separator3' - #'layout:' #(#Rectangle 145 187 155 208) + #'layout:' #(#Rectangle 145 152 155 173) #'orientation:' #vertical ) #(#DividerSpec #'name:' 'separator4' - #'layout:' #(#Rectangle 203 187 213 208) + #'layout:' #(#Rectangle 203 152 213 173) #'orientation:' #vertical ) #(#ActionButtonSpec #'name:' 'alignBR' - #'layout:' #(#Rectangle 201 207 213 219) + #'layout:' #(#Rectangle 201 172 213 184) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeAlignBottomRight + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'alignTL' - #'layout:' #(#Rectangle 145 176 157 188) + #'layout:' #(#Rectangle 145 141 157 153) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeAlignTopLeft + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'alignTR' - #'layout:' #(#Rectangle 201 176 213 188) + #'layout:' #(#Rectangle 201 141 213 153) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeAlignTopRight + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'alignBL' - #'layout:' #(#Rectangle 145 206 157 218) + #'layout:' #(#Rectangle 145 171 157 183) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeAlignBottomLeft + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'alignTC' - #'layout:' #(#Rectangle 173 176 185 188) + #'layout:' #(#Rectangle 173 141 185 153) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeAlignTopCenter + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'alignBC' - #'layout:' #(#Rectangle 173 207 185 219) + #'layout:' #(#Rectangle 173 172 185 184) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeAlignBottomCenter + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'alignLC' - #'layout:' #(#Rectangle 145 191 157 203) + #'layout:' #(#Rectangle 145 156 157 168) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeAlignLeftCenter + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'alignRC' - #'layout:' #(#Rectangle 201 191 213 203) + #'layout:' #(#Rectangle 201 156 213 168) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeAlignRightCenter + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'alignC' - #'layout:' #(#Rectangle 173 191 185 203) + #'layout:' #(#Rectangle 173 156 185 168) #'label:' '' - #'translateLabel:' false - #'tabable:' false #'model:' #makeAlignCenter + #'isTriggerOnDown:' false + #'autoRepeat:' false ) ) ) ) + + ! specificationExtent @@ -372,74 +511,51 @@ handle the specification if its corrupted." " - UIPainter new openOnClass:UIPropertyView andSelector:#specificationExtent - UIPropertyView new openInterface:#specificationExtent + UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationExtent + UIPropertyView::Dimension new openInterface:#specificationExtent " ^ - + #(#FullSpec - #'name:' 'uIPainterView' - #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) #'window:' #(#WindowSpec #'name:' 'uIPainterView' #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) #'label:' 'unnamed' - #'bounds:' #(#Rectangle 0 0 238 303) + #'bounds:' #(#Rectangle 0 0 224 251) ) #'component:' #(#SpecCollection #'collection:' #( #(#LabelSpec - #'name:' 'label0' - #'layout:' #(#AlignmentOrigin 71 0 7 0 1 0) - #'label:' 'Layout:' - #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false - #'level:' 0 - #'adjust:' #center - #'hasCharacterOrientedLabel:' true - ) - #(#PopUpListSpec - #'name:' 'popUpList1' - #'layout:' #(#LayoutFrame 74 0.0 7 0 -4 1.0 30 0) - #'label:' 'popup' - #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false - #'model:' #layoutType - #'menu:' #layoutTypeList - ) - #(#LabelSpec #'name:' 'label1' - #'layout:' #(#AlignmentOrigin 99 0 62 0 1 0) + #'layout:' #(#AlignmentOrigin 99 0 45 0 1 0) #'label:' 'horizontal:' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #left #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label2' - #'layout:' #(#AlignmentOrigin 99 0 89 0 1 0) + #'layout:' #(#AlignmentOrigin 99 0 72 0 1 0) #'label:' 'vertical:' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #left #'hasCharacterOrientedLabel:' true ) #(#InputFieldSpec #'name:' 'editField1' - #'layout:' #(#LayoutFrame 104 0 62 0 197 0 80 0) + #'layout:' #(#LayoutFrame 104 0 45 0 197 0 63 0) #'model:' #leftOffset #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -448,32 +564,29 @@ ) #(#InputFieldSpec #'name:' 'editField2' - #'layout:' #(#LayoutFrame 104 0 89 0 197 0 107 0) + #'layout:' #(#LayoutFrame 104 0 72 0 197 0 90 0) #'model:' #rightOffset #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true #'acceptOnLostFocus:' true #'hasBorder:' false ) -"/ #(#LabelSpec -"/ #'name:' 'label0' -"/ #'layout:' #(#Point 16 15) -"/ #'label:' 'Extent:' -"/ #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) -"/ #'initiallyInvisible:' false -"/ #'level:' 0 -"/ #'adjust:' #left -"/ #'hasCharacterOrientedLabel:' true -"/ ) + #(#LabelSpec + #'name:' 'extentLabel' + #'layout:' #(#LayoutFrame 9 0 20 0 63 0 37 0) + #'label:' 'Extent:' + #'level:' 0 + #'adjust:' #center + #'hasCharacterOrientedLabel:' true + ) ) ) ) - "Modified: 28.3.1997 / 19:46:27 / cg" ! specificationLayoutFrame @@ -483,17 +596,15 @@ handle the specification if its corrupted." " - UIPainter new openOnClass:UIPropertyView andSelector:#specificationLayoutFrame - UIPropertyView new openInterface:#specificationLayoutFrame + UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationLayoutFrame + UIPropertyView::Dimension new openInterface:#specificationLayoutFrame " ^ - + #(#FullSpec - #'name:' 'uIPainterView' - #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) #'window:' #(#WindowSpec #'name:' 'uIPainterView' @@ -506,101 +617,74 @@ #'collection:' #( #(#LabelSpec - #'name:' 'label0' - #'layout:' #(#AlignmentOrigin 71 0 7 0 1 0) - #'label:' 'Layout:' - #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false - #'level:' 0 - #'adjust:' #center - #'hasCharacterOrientedLabel:' true - ) - #(#PopUpListSpec - #'name:' 'popUpList1' - #'layout:' #(#LayoutFrame 74 0.0 7 0 -4 1.0 30 0) - #'label:' 'popup' - #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false - #'model:' #layoutType - #'menu:' #layoutTypeList - ) - #(#LabelSpec #'name:' 'label left' - #'layout:' #(#AlignmentOrigin 60 0 79 0 1 0) + #'layout:' #(#AlignmentOrigin 60 0 43 0 1 0) #'label:' 'left' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label top' - #'layout:' #(#AlignmentOrigin 60 0 107 0 1 0) + #'layout:' #(#AlignmentOrigin 60 0 71 0 1 0) #'label:' 'top' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label right' - #'layout:' #(#AlignmentOrigin 60 0 135 0 1 0) + #'layout:' #(#AlignmentOrigin 60 0 99 0 1 0) #'label:' 'right' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label bottom' - #'layout:' #(#AlignmentOrigin 60 0 163 0 1 0) + #'layout:' #(#AlignmentOrigin 60 0 127 0 1 0) #'label:' 'bottom' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label relative' - #'layout:' #(#Point 65 50) + #'layout:' #(#Point 65 14) #'label:' 'relative' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label offset' - #'layout:' #(#Point 159 50) + #'layout:' #(#Point 159 14) #'label:' 'offset' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label all relative' - #'layout:' #(#AlignmentOrigin 60 0 197 0 1 0) + #'layout:' #(#AlignmentOrigin 60 0 161 0 1 0) #'label:' 'all' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#InputFieldSpec #'name:' 'relative E1' - #'layout:' #(#LayoutFrame 65 0 79 0 113 0 97 0) + #'layout:' #(#LayoutFrame 65 0 43 0 113 0 61 0) #'model:' #leftFraction - #'tabable:' false #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -609,11 +693,10 @@ ) #(#InputFieldSpec #'name:' 'relative E2' - #'layout:' #(#LayoutFrame 65 0 107 0 113 0 125 0) + #'layout:' #(#LayoutFrame 65 0 71 0 113 0 89 0) #'model:' #topFraction - #'tabable:' false #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -622,11 +705,10 @@ ) #(#InputFieldSpec #'name:' 'relative E3' - #'layout:' #(#LayoutFrame 65 0 135 0 113 0 153 0) + #'layout:' #(#LayoutFrame 65 0 99 0 113 0 117 0) #'model:' #rightFraction - #'tabable:' false #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -635,11 +717,10 @@ ) #(#InputFieldSpec #'name:' 'relative E4' - #'layout:' #(#LayoutFrame 65 0 163 0 113 0 181 0) + #'layout:' #(#LayoutFrame 65 0 127 0 113 0 145 0) #'model:' #bottomFraction - #'tabable:' false #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -648,11 +729,10 @@ ) #(#InputFieldSpec #'name:' 'offset E1' - #'layout:' #(#LayoutFrame 159 0 79 0 210 0 97 0) + #'layout:' #(#LayoutFrame 159 0 43 0 210 0 61 0) #'model:' #leftOffset - #'tabable:' false #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -661,11 +741,10 @@ ) #(#InputFieldSpec #'name:' 'offset E2' - #'layout:' #(#LayoutFrame 159 0 107 0 210 0 125 0) + #'layout:' #(#LayoutFrame 159 0 71 0 210 0 89 0) #'model:' #topOffset - #'tabable:' false #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -674,11 +753,10 @@ ) #(#InputFieldSpec #'name:' 'offset E3' - #'layout:' #(#LayoutFrame 159 0 135 0 210 0 153 0) + #'layout:' #(#LayoutFrame 159 0 99 0 210 0 117 0) #'model:' #rightOffset - #'tabable:' false #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -687,11 +765,10 @@ ) #(#InputFieldSpec #'name:' 'offset E4' - #'layout:' #(#LayoutFrame 159 0 163 0 210 0 181 0) + #'layout:' #(#LayoutFrame 159 0 127 0 210 0 145 0) #'model:' #bottomOffset - #'tabable:' false #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -700,89 +777,98 @@ ) #(#ActionButtonSpec #'name:' 'relative B1' - #'layout:' #(#LayoutFrame 117 0 79 0 136 0 97 0) + #'layout:' #(#LayoutFrame 117 0 43 0 136 0 61 0) #'label:' ' ' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeRelativeLeft + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'relative B2' - #'layout:' #(#LayoutFrame 117 0 107 0 136 0 125 0) + #'layout:' #(#LayoutFrame 117 0 71 0 136 0 89 0) #'label:' ' ' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeRelativeTop + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'relative B3' - #'layout:' #(#LayoutFrame 117 0 135 0 136 0 153 0) + #'layout:' #(#LayoutFrame 117 0 99 0 136 0 117 0) #'label:' ' ' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeRelativeRight + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'relative B4' - #'layout:' #(#LayoutFrame 117 0 163 0 136 0 181 0) + #'layout:' #(#LayoutFrame 117 0 127 0 136 0 145 0) #'label:' ' ' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeRelativeBottom + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'relative BAll' - #'layout:' #(#LayoutFrame 117 0 197 0 136 0 215 0) + #'layout:' #(#LayoutFrame 117 0 161 0 136 0 179 0) #'label:' ' ' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeRelativeAll + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'offset B1' - #'layout:' #(#LayoutFrame 214 0 79 0 233 0 97 0) + #'layout:' #(#LayoutFrame 214 0 43 0 233 0 61 0) #'label:' '' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeOffsetLeft + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'offset B2' - #'layout:' #(#LayoutFrame 214 0 107 0 233 0 125 0) + #'layout:' #(#LayoutFrame 214 0 71 0 233 0 89 0) #'label:' '' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeOffsetTop + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'offset B3' - #'layout:' #(#LayoutFrame 214 0 135 0 233 0 153 0) + #'layout:' #(#LayoutFrame 214 0 99 0 233 0 117 0) #'label:' '' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeOffsetRight + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'offset B4' - #'layout:' #(#LayoutFrame 214 0 163 0 233 0 181 0) + #'layout:' #(#LayoutFrame 214 0 127 0 233 0 145 0) #'label:' '' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeOffsetBottom + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'offset BAll' - #'layout:' #(#LayoutFrame 214 0 197 0 233 0 215 0) + #'layout:' #(#LayoutFrame 214 0 161 0 233 0 179 0) #'label:' ' ' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeOffsetAll + #'isTriggerOnDown:' false + #'autoRepeat:' false ) ) ) ) - "Modified: 28.2.1997 / 13:19:49 / cg" ! specificationLayoutOrigin @@ -792,17 +878,15 @@ handle the specification if its corrupted." " - UIPainter new openOnClass:UIPropertyView andSelector:#specificationLayoutOrigin - UIPropertyView new openInterface:#specificationLayoutOrigin + UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationLayoutOrigin + UIPropertyView::Dimension new openInterface:#specificationLayoutOrigin " ^ - + #(#FullSpec - #'name:' 'uIPainterView' - #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) #'window:' #(#WindowSpec #'name:' 'uIPainterView' @@ -815,71 +899,48 @@ #'collection:' #( #(#LabelSpec - #'name:' 'label0' - #'layout:' #(#AlignmentOrigin 71 0 7 0 1 0) - #'label:' 'Layout:' - #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false - #'level:' 0 - #'adjust:' #center - #'hasCharacterOrientedLabel:' true - ) - #(#PopUpListSpec - #'name:' 'popUpList1' - #'layout:' #(#LayoutFrame 75 0.0 9 0 -5 1.0 32 0) - #'label:' 'popup' - #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false - #'model:' #layoutType - #'menu:' #layoutTypeList - ) - #(#LabelSpec #'name:' 'label1' - #'layout:' #(#AlignmentOrigin 52 0 82 0 1 0) + #'layout:' #(#AlignmentOrigin 52 0 44 0 1 0) #'label:' 'left' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label2' - #'layout:' #(#AlignmentOrigin 52 0 109 0 1 0) + #'layout:' #(#AlignmentOrigin 52 0 71 0 1 0) #'label:' 'top' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label3' - #'layout:' #(#Point 57 50) + #'layout:' #(#Point 57 12) #'label:' 'relative' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label4' - #'layout:' #(#Point 154 51) + #'layout:' #(#Point 154 13) #'label:' 'offset' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#InputFieldSpec #'name:' 'editField1' - #'layout:' #(#LayoutFrame 57 0 82 0 114 0 100 0) + #'layout:' #(#LayoutFrame 57 0 44 0 114 0 62 0) #'model:' #leftFraction #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -888,11 +949,11 @@ ) #(#InputFieldSpec #'name:' 'editField2' - #'layout:' #(#LayoutFrame 57 0 109 0 114 0 127 0) + #'layout:' #(#LayoutFrame 57 0 71 0 114 0 89 0) #'model:' #topFraction #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -901,11 +962,11 @@ ) #(#InputFieldSpec #'name:' 'editField3' - #'layout:' #(#LayoutFrame 154 0 82 0 212 0 100 0) + #'layout:' #(#LayoutFrame 154 0 44 0 212 0 62 0) #'model:' #leftOffset #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -914,11 +975,11 @@ ) #(#InputFieldSpec #'name:' 'editField4' - #'layout:' #(#LayoutFrame 154 0 109 0 212 0 127 0) + #'layout:' #(#LayoutFrame 154 0 71 0 212 0 89 0) #'model:' #topOffset #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -927,58 +988,63 @@ ) #(#ActionButtonSpec #'name:' 'button1' - #'layout:' #(#LayoutFrame 119 0 82 0 138 0 100 0) + #'layout:' #(#LayoutFrame 119 0 44 0 138 0 62 0) #'label:' '' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeRelativeLeft + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'button2' - #'layout:' #(#LayoutFrame 119 0 109 0 138 0 127 0) + #'layout:' #(#LayoutFrame 119 0 71 0 138 0 89 0) #'label:' '' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeRelativeTop + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'button3' - #'layout:' #(#LayoutFrame 216 0 82 0 235 0 100 0) + #'layout:' #(#LayoutFrame 216 0 44 0 235 0 62 0) #'label:' '' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeOffsetLeft + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'button4' - #'layout:' #(#LayoutFrame 216 0 109 0 235 0 127 0) + #'layout:' #(#LayoutFrame 216 0 71 0 235 0 89 0) #'label:' '' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeOffsetTop + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'button8' - #'layout:' #(#LayoutFrame 119 0 141 0 138 0 159 0) + #'layout:' #(#LayoutFrame 119 0 103 0 138 0 121 0) #'label:' '' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeRelativeLeftTop + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'button9' - #'layout:' #(#LayoutFrame 216 0 141 0 235 0 159 0) + #'layout:' #(#LayoutFrame 216 0 103 0 235 0 121 0) #'label:' '' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'tabable:' false #'model:' #makeOffsetLeftTop + #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#LabelSpec #'name:' 'label5' - #'layout:' #(#AlignmentOrigin 52 0 141 0 1 0) + #'layout:' #(#AlignmentOrigin 52 0 103 0 1 0) #'label:' 'all' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true @@ -986,6 +1052,7 @@ ) ) ) + ! specificationPoint @@ -995,17 +1062,15 @@ handle the specification if its corrupted." " - UIPainter new openOnClass:UIPropertyView andSelector:#specificationPoint - UIPropertyView new openInterface:#specificationPoint + UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationPoint + UIPropertyView::Dimension new openInterface:#specificationPoint " ^ - + #(#FullSpec - #'name:' 'uIPainterView' - #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) #'window:' #(#WindowSpec #'name:' 'uIPainterView' @@ -1018,51 +1083,30 @@ #'collection:' #( #(#LabelSpec - #'name:' 'label0' - #'layout:' #(#AlignmentOrigin 84 0 7 0 1 0) - #'label:' 'Layout:' - #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false - #'level:' 0 - #'adjust:' #center - #'hasCharacterOrientedLabel:' true - ) - #(#PopUpListSpec - #'name:' 'popUpList1' - #'layout:' #(#LayoutFrame 93 0.0 7 0 -4 1.0 30 0) - #'label:' 'popup' - #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false - #'model:' #layoutType - #'menu:' #layoutTypeList - ) - #(#LabelSpec #'name:' 'label1' - #'layout:' #(#AlignmentOrigin 75 0 62 0 1 0) + #'layout:' #(#AlignmentOrigin 75 0 19 0 1 0) #'label:' 'origin x:' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label2' - #'layout:' #(#AlignmentOrigin 75 0 89 0 1 0) + #'layout:' #(#AlignmentOrigin 75 0 46 0 1 0) #'label:' 'origin y:' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #center #'hasCharacterOrientedLabel:' true ) #(#InputFieldSpec #'name:' 'editField1' - #'layout:' #(#LayoutFrame 77 0 62 0 170 0 80 0) + #'layout:' #(#LayoutFrame 77 0 19 0 170 0 37 0) #'model:' #absLeft #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -1071,11 +1115,11 @@ ) #(#InputFieldSpec #'name:' 'editField2' - #'layout:' #(#LayoutFrame 77 0 89 0 170 0 107 0) + #'layout:' #(#LayoutFrame 77 0 46 0 170 0 64 0) #'model:' #absTop #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -1086,7 +1130,6 @@ ) ) - "Modified: 28.2.1997 / 13:22:31 / cg" ! specificationRectangle @@ -1096,17 +1139,15 @@ handle the specification if its corrupted." " - UIPainter new openOnClass:UIPropertyView andSelector:#specificationRectangle - UIPropertyView new openInterface:#specificationRectangle + UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationRectangle + UIPropertyView::Dimension new openInterface:#specificationRectangle " ^ - + #(#FullSpec - #'name:' 'uIPainterView' - #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) #'window:' #(#WindowSpec #'name:' 'uIPainterView' @@ -1119,51 +1160,30 @@ #'collection:' #( #(#LabelSpec - #'name:' 'label0' - #'layout:' #(#AlignmentOrigin 90 0 7 0 1 0) - #'label:' 'Layout:' - #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false - #'level:' 0 - #'adjust:' #center - #'hasCharacterOrientedLabel:' true - ) - #(#PopUpListSpec - #'name:' 'popUpList1' - #'layout:' #(#LayoutFrame 95 0.0 7 0 -6 1.0 30 0) - #'label:' 'popup' - #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false - #'model:' #layoutType - #'menu:' #layoutTypeList - ) - #(#LabelSpec #'name:' 'label1' - #'layout:' #(#AlignmentOrigin 80 0 62 0 1 0) + #'layout:' #(#AlignmentOrigin 80 0 19 0 1 0) #'label:' 'origin x:' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #left #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label2' - #'layout:' #(#AlignmentOrigin 80 0 89 0 1 0) + #'layout:' #(#AlignmentOrigin 80 0 46 0 1 0) #'label:' 'origin y:' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #left #'hasCharacterOrientedLabel:' true ) #(#InputFieldSpec #'name:' 'editField1' - #'layout:' #(#LayoutFrame 81 0 62 0 174 0 80 0) + #'layout:' #(#LayoutFrame 81 0 19 0 174 0 37 0) #'model:' #leftOffset #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -1172,11 +1192,11 @@ ) #(#InputFieldSpec #'name:' 'editField2' - #'layout:' #(#LayoutFrame 81 0 89 0 174 0 107 0) + #'layout:' #(#LayoutFrame 81 0 46 0 174 0 64 0) #'model:' #topOffset #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -1185,31 +1205,29 @@ ) #(#LabelSpec #'name:' 'label4' - #'layout:' #(#AlignmentOrigin 80 0 117 0 1 0) + #'layout:' #(#AlignmentOrigin 80 0 74 0 1 0) #'label:' 'corner x:' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #left #'hasCharacterOrientedLabel:' true ) #(#LabelSpec #'name:' 'label5' - #'layout:' #(#AlignmentOrigin 80 0 144 0 1 0) + #'layout:' #(#AlignmentOrigin 80 0 101 0 1 0) #'label:' 'corner y:' #'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) - #'initiallyInvisible:' false #'level:' 0 #'adjust:' #left #'hasCharacterOrientedLabel:' true ) #(#InputFieldSpec #'name:' 'editField3' - #'layout:' #(#LayoutFrame 81 0 117 0 174 0 135 0) + #'layout:' #(#LayoutFrame 81 0 74 0 174 0 92 0) #'model:' #rightOffset #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -1218,11 +1236,11 @@ ) #(#InputFieldSpec #'name:' 'editField4' - #'layout:' #(#LayoutFrame 81 0 144 0 174 0 162 0) + #'layout:' #(#LayoutFrame 81 0 101 0 174 0 119 0) #'model:' #bottomOffset #'tabable:' true #'type:' #numberOrNil - #'immediateAccept:' false + #'immediateAccept:' true #'acceptOnLeave:' true #'acceptOnReturn:' true #'acceptOnTab:' true @@ -1233,156 +1251,54 @@ ) ) - "Modified: 28.2.1997 / 13:23:57 / cg" ! ! -!UIPropertyView methodsFor:'event handling'! - -builderViewChanged:what - "something changed in the builder view - " - |slices list prevSpecClass| - - (what == #selection or:[what == #tree]) ifFalse:[ - what == #layout ifTrue:[ - self updateLayout - ]. - ^ self - ]. - currentView := builderView singleSelection. - - currentView isNil ifTrue:[ - propertyAspects := nil. - specChannel := nil. - ^ self propertyList:nil - ]. - - prevSpecClass := specBeingEdited class. - specBeingEdited := builderView specFor:currentView. +!UIPropertyView::Dimension methodsFor:'accessing'! - ( (specBeingEdited class == prevSpecClass) - and:[specChannel notNil] - ) ifTrue:[ - "can keep current specifications plus current property selection - " - ^ self reload. - ]. - - propertyAspects := IdentityDictionary new. - slices := specBeingEdited class slices. - - list := slices collect:[:slice| - slice first asString - ]. - list := list, (Array with:(self class titleOfLayoutMenu)). - - specChannel := specBeingEdited asValue. - specBeingEdited class addBindingsTo:propertyAspects - for:specBeingEdited - channel:specChannel. - propertyAspects do:[:anAspect | anAspect addDependent:self ]. - self propertyList:list. - +forView:aView + "set the view the layout derives from + " + forView := aView. + selection := nil. + self selection:(UIPainterView layoutType:forView) ! -modified:aState - "change state of modification flag - " - aState ~~ modified ifTrue:[ - (modified := aState) ifTrue:[ - (builder componentAt:#cancelButton) enable. - (builder componentAt:#applyButton) enable. - ] ifFalse:[ - (builder componentAt:#cancelButton) disable. - (builder componentAt:#applyButton) disable. - ]. - ] +layout + "returns current layout + " + |layout| + + selection notNil ifTrue:[ + layout := self perform:(('get', selection asString) asSymbol). + ]. + ^ layout ! -propertySelectionChanged - "property selection changed; switch to new property selection +layoutType + "returns current layoutType " - |plist specClass| - - self modified:false. - - specClass := specBeingEdited class. - plist := self propertyList. + ^ selection +! ! - (plist selection isNil) ifTrue:[ - ^ self showSpec:nil - ]. - propertySelection := plist selection. +!UIPropertyView::Dimension methodsFor:'accessing hierarchy'! - specClass slices do:[:slice| - slice first = propertySelection ifTrue:[ - ^ self showSpec:(specClass perform:(slice last)) - ] - ]. - ^ self showAndFetchLayout "/ layout specifications -! - -update:something with:someArgument from:someone - "any attribute changed its state in the current specification - " - self modified:true +window + ^ noteBook ! ! -!UIPropertyView methodsFor:'initialization'! +!UIPropertyView::Dimension methodsFor:'initialization'! -in:aTopView builder:aBuilderView - "setup property view in topview and that the builder view +initialize + "initialize channels " - |menu y cancelButton applyButton panel propertyFrame propertyList| + |layoutAspects| super initialize. - self initializeLayoutAspects. - builderView := aBuilderView. - - menu := PopUpList label:'properties' in:aTopView. - menu defaultLabel:'properties'. - propertyFrame := View in:aTopView. - panel := HorizontalPanelView in:aTopView. - panel horizontalLayout:#fitSpace. - - cancelButton := Button abortButtonIn:panel. - applyButton := Button okButtonIn:panel. - - propertyList := SelectionInList new. - propertyList list:#( ). - propertyList selectionIndexHolder onChangeSend:#propertySelectionChanged - to:self. - menu model:propertyList. - - y := menu preferredExtent y. - menu origin:0.0@0.0 corner:1.0@y. - propertyFrame origin:0.0@y corner:1.0@1.0. - panel origin:0.0@1.0 corner:1.0@1.0. - - y := panel preferredExtent y. - propertyFrame bottomInset:y. - panel topInset:(y negated). - - builder componentAt:#propertyFrame put:propertyFrame. - builder componentAt:#cancelButton put:cancelButton. - builder componentAt:#applyButton put:applyButton. - builder componentAt:#propertyList put:propertyList. - - cancelButton action:[ self cancel ]. - applyButton action:[ self apply ]. - - modified := true. - self modified:false. -! - -initializeLayoutAspects - "initialize all layout aspects - " layoutAspects := IdentityDictionary new. #( bottomFraction bottomOffset @@ -1392,129 +1308,151 @@ leftAlignmentFraction topAlignmentFraction absLeft absTop ) - do:[:aChannel| - layoutAspects at:aChannel put:(ValueHolder new). + do:[:aKey| + layoutAspects at:aKey put:(ValueHolder new) ]. - - layoutAspects do:[:anAspect | anAspect addDependent:self ]. - - layoutAspects at:#layoutType put:( - AspectAdaptor new - subject:self; - accessWith:#layoutType - assignWith:#layoutType: - ). - - "Modified: 28.2.1997 / 12:57:51 / cg" -! ! - -!UIPropertyView methodsFor:'layout'! + self aspects:layoutAspects. -layoutType - ^ layoutType -! - -layoutType:something - |spec| - - layoutType ~~ something ifTrue:[ - layoutType := something. - - layoutType notNil ifTrue:[ - self modified:true. - self perform:(('fetch', layoutType asString) asSymbol). - spec := ('specification', layoutType asString) asSymbol. - spec := self class perform:spec. - ]. - self showSpec:spec. - self changed:#layoutType. - ]. -! - -layoutTypeList - ^ #( #LayoutFrame #AlignmentOrigin #LayoutOrigin #Point #Rectangle ) ! -showAndFetchLayout - "fetch and show layout specification assigned to current view +origin:anOrigin corner:aCorner in:aTopView + "set dimensions " - |type spec| + noteBook := NoteBookView origin:anOrigin corner:aCorner in:aTopView. + window := noteBook canvas. - self modified:false. - modified := true. - type := builderView class layoutType:currentView. + noteBook direction:#bottom. + noteBook useIndex:true. + layoutTypes := #( #LayoutFrame #AlignmentOrigin #LayoutOrigin #Point #Rectangle ). + noteBook list:#( 'Frame' 'Alig.Origin' 'LayoutOrigin' 'Point' 'Rectangle' ). - type notNil ifTrue:[ - self perform:(('fetch', type asString) asSymbol). - spec := self class perform:(('specification', type asString) asSymbol). + noteBook action:[:anIndex| + anIndex notNil ifTrue:[self selection:(layoutTypes at:anIndex)]. ]. - type ~~ layoutType ifTrue:[ - layoutType := type. - self changed:#layoutType - ]. - self showSpec:spec. - modified := false. +! ! + +!UIPropertyView::Dimension methodsFor:'layout access'! + +getAlignmentOrigin + "returns current layout as alignmentOrigin + " + |layout| + + layout := AlignmentOrigin new. - "Modified: 28.3.1997 / 19:46:32 / cg" + layout leftOffset:((aspects at:#leftOffset) value) ? 0. + layout topOffset:((aspects at:#topOffset) value) ? 0. + layout leftFraction:((aspects at:#leftFraction) value) ? 0. + layout topFraction:((aspects at:#topFraction) value) ? 0. + + layout leftAlignmentFraction:((aspects at:#leftAlignmentFraction) value) ? 0. + layout topAlignmentFraction:((aspects at:#topAlignmentFraction) value) ? 0. + + ^ layout +! + +getExtent + "returns current extent + " + ^ Point x:(((aspects at:#leftOffset) value) ? 0) + y:(((aspects at:#rightOffset) value) ? 0) ! -updateLayout - "layout changed but not selection +getLayoutFrame + "returns current layout as layoutFrame + " + |layout| + + layout := LayoutFrame new. + + layout leftOffset:((aspects at:#leftOffset) value) ? 0. + layout rightOffset:((aspects at:#rightOffset) value) ? 0. + layout topOffset:((aspects at:#topOffset) value) ? 0. + layout bottomOffset:((aspects at:#bottomOffset) value) ? 0. + layout leftFraction:((aspects at:#leftFraction) value) ? 0. + layout rightFraction:((aspects at:#rightFraction) value) ? 0. + layout topFraction:((aspects at:#topFraction) value) ? 0. + layout bottomFraction:((aspects at:#bottomFraction) value) ? 0. + + ^ layout +! + +getLayoutOrigin + "returns current layout as layoutOrigin " - (modified not and:[self isLayoutSpec]) ifTrue:[ - (builderView class layoutType:currentView) == layoutType ifTrue:[ - modified := true. - self perform:(('fetch', layoutType asString) asSymbol). - modified := false. - ] ifFalse:[ - self showAndFetchLayout - ] - ] + |layout| + + layout := LayoutOrigin new. + + layout leftOffset:((aspects at:#leftOffset) value) ? 0. + layout topOffset:((aspects at:#topOffset) value) ? 0. + layout leftFraction:((aspects at:#leftFraction) value) ? 0. + layout topFraction:((aspects at:#topFraction) value) ? 0. + + ^ layout +! + +getPoint + "returns current layout as point + " + ^ Point x:(((aspects at:#absLeft) value) ? 0) + y:(((aspects at:#absTop) value) ? 0) +! + +getRectangle + "returns current layout as rectangle + " + ^ Rectangle left:(((aspects at:#leftOffset) value) ? 0) + top:(((aspects at:#topOffset) value) ? 0) + right:(((aspects at:#rightOffset) value) ? 0) + bottom:(((aspects at:#bottomOffset) value) ? 0) ! ! -!UIPropertyView methodsFor:'layout fetch/write'! +!UIPropertyView::Dimension methodsFor:'layout fetch'! fetchAlignmentOrigin "fetch alignmentOrigin " |layout type extent| - type := builderView class layoutType:currentView. - layout := currentView geometryLayout. + type := UIPainterView layoutType:forView. + layout := forView geometryLayout. layout isLayout ifTrue:[ - (layoutAspects at:#leftOffset) value:(layout leftOffset). - (layoutAspects at:#leftFraction) value:(layout leftFraction). - (layoutAspects at:#topOffset) value:(layout topOffset). - (layoutAspects at:#topFraction) value:(layout topFraction). + (aspects at:#leftOffset) value:(layout leftOffset). + (aspects at:#leftFraction) value:(layout leftFraction). + (aspects at:#topOffset) value:(layout topOffset). + (aspects at:#topFraction) value:(layout topFraction). type == #AlignmentOrigin ifTrue:[ - (layoutAspects at:#leftAlignmentFraction) value:(layout leftAlignmentFraction). - (layoutAspects at:#topAlignmentFraction) value:(layout topAlignmentFraction). + (aspects at:#leftAlignmentFraction) value:(layout leftAlignmentFraction). + (aspects at:#topAlignmentFraction) value:(layout topAlignmentFraction). ^ self ] ] ifFalse:[ - layout := currentView computeOrigin. + layout := forView computeOrigin. - (layoutAspects at:#leftOffset) value:(layout x). - (layoutAspects at:#leftFraction) value:0. - (layoutAspects at:#topOffset) value:(layout y). - (layoutAspects at:#topFraction) value:0. + (aspects at:#leftOffset) value:(layout x). + (aspects at:#leftFraction) value:0. + (aspects at:#topOffset) value:(layout y). + (aspects at:#topFraction) value:0. ]. - (layoutAspects at:#leftAlignmentFraction) value:0. - (layoutAspects at:#topAlignmentFraction) value:0. - - + (aspects at:#leftAlignmentFraction) value:0. + (aspects at:#topAlignmentFraction) value:0. ! fetchExtent + "fetch extent + " |extent| - extent := currentView computeExtent. - (layoutAspects at:#leftOffset) value:(extent x). - (layoutAspects at:#rightOffset) value:(extent y). + extent := forView computeExtent. + + (aspects at:#leftOffset) value:(extent x). + (aspects at:#rightOffset) value:(extent y). + ! fetchLayoutFrame @@ -1522,16 +1460,16 @@ " |layout| - layout := builderView class asLayoutFrameFromView:currentView. + layout := UIPainterView asLayoutFrameFromView:forView. - (layoutAspects at:#leftOffset) value:(layout leftOffset). - (layoutAspects at:#leftFraction) value:(layout leftFraction). - (layoutAspects at:#topOffset) value:(layout topOffset). - (layoutAspects at:#topFraction) value:(layout topFraction). - (layoutAspects at:#rightOffset) value:(layout rightOffset). - (layoutAspects at:#bottomOffset) value:(layout bottomOffset). - (layoutAspects at:#rightFraction) value:(layout rightFraction). - (layoutAspects at:#bottomFraction) value:(layout bottomFraction). + (aspects at:#leftOffset) value:(layout leftOffset). + (aspects at:#leftFraction) value:(layout leftFraction). + (aspects at:#topOffset) value:(layout topOffset). + (aspects at:#topFraction) value:(layout topFraction). + (aspects at:#rightOffset) value:(layout rightOffset). + (aspects at:#bottomOffset) value:(layout bottomOffset). + (aspects at:#rightFraction) value:(layout rightFraction). + (aspects at:#bottomFraction) value:(layout bottomFraction). ! fetchLayoutOrigin @@ -1539,13 +1477,12 @@ " |layout| - layout := builderView class asLayoutFrameFromView:currentView. + layout := UIPainterView asLayoutFrameFromView:forView. - (layoutAspects at:#leftOffset) value:(layout leftOffset). - (layoutAspects at:#leftFraction) value:(layout leftFraction). - (layoutAspects at:#topOffset) value:(layout topOffset). - (layoutAspects at:#topFraction) value:(layout topFraction). - + (aspects at:#leftOffset) value:(layout leftOffset). + (aspects at:#leftFraction) value:(layout leftFraction). + (aspects at:#topOffset) value:(layout topOffset). + (aspects at:#topFraction) value:(layout topFraction). ! fetchPoint @@ -1553,9 +1490,11 @@ " |origin| - origin := currentView computeOrigin. - (layoutAspects at:#absLeft) value:(origin x). - (layoutAspects at:#absTop) value:(origin y). + origin := forView computeOrigin. + + (aspects at:#absLeft) value:(origin x). + (aspects at:#absTop) value:(origin y). + ! fetchRectangle @@ -1563,121 +1502,34 @@ " |origin corner| - origin := currentView computeOrigin. - corner := currentView computeCorner. - - (layoutAspects at:#leftOffset) value:(origin x). - (layoutAspects at:#rightOffset) value:(corner x). - (layoutAspects at:#topOffset) value:(origin y). - (layoutAspects at:#bottomOffset) value:(corner y). -! - -writeAlignmentOrigin - "write back as alignmentOrigin - " - |layout| - - layout := AlignmentOrigin new. - - layout leftOffset:((layoutAspects at:#leftOffset) value) ? 0. - layout topOffset:((layoutAspects at:#topOffset) value) ? 0. - layout leftFraction:((layoutAspects at:#leftFraction) value) ? 0. - layout topFraction:((layoutAspects at:#topFraction) value) ? 0. - - layout leftAlignmentFraction:((layoutAspects at:#leftAlignmentFraction) value) ? 0. - layout topAlignmentFraction:((layoutAspects at:#topAlignmentFraction) value) ? 0. - - builderView setDimension:layout. -! - -writeExtent - |extent| - - extent := Point x:(((layoutAspects at:#leftOffset) value) ? 0) - y:(((layoutAspects at:#rightOffset) value) ? 0). - - builderView setExtent:extent -! - -writeLayoutFrame - "write back as layoutFrame - " - |layout| - - layout := LayoutFrame new. + origin := forView computeOrigin. + corner := forView computeCorner. - layout leftOffset:((layoutAspects at:#leftOffset) value) ? 0. - layout rightOffset:((layoutAspects at:#rightOffset) value) ? 0. - layout topOffset:((layoutAspects at:#topOffset) value) ? 0. - layout bottomOffset:((layoutAspects at:#bottomOffset) value) ? 0. - layout leftFraction:((layoutAspects at:#leftFraction) value) ? 0. - layout rightFraction:((layoutAspects at:#rightFraction) value) ? 0. - layout topFraction:((layoutAspects at:#topFraction) value) ? 0. - layout bottomFraction:((layoutAspects at:#bottomFraction) value) ? 0. - - builderView setDimension:layout -! - -writeLayoutOrigin - "write back as layoutOrigin - " - |layout| - - layout := LayoutOrigin new. - - layout leftOffset:((layoutAspects at:#leftOffset) value) ? 0. - layout topOffset:((layoutAspects at:#topOffset) value) ? 0. - layout leftFraction:((layoutAspects at:#leftFraction) value) ? 0. - layout topFraction:((layoutAspects at:#topFraction) value) ? 0. - - builderView setDimension:layout. - -! + (aspects at:#leftOffset) value:(origin x). + (aspects at:#rightOffset) value:(corner x). + (aspects at:#topOffset) value:(origin y). + (aspects at:#bottomOffset) value:(corner y). -writePoint - "write back as point - " - |point| - -"/ point := Point x:(((layoutAspects at:#leftOffset) value) ? 0) -"/ y:(((layoutAspects at:#topOffset) value) ? 0). - - point := Point x:(((layoutAspects at:#absLeft) value) ? 0) - y:(((layoutAspects at:#absTop) value) ? 0). - - builderView setDimension:point - - "Modified: 28.2.1997 / 13:00:03 / cg" -! - -writeRectangle - "write back as rectangle - " - |rectangle| - - rectangle := Rectangle left:(((layoutAspects at:#leftOffset) value) ? 0) - top:(((layoutAspects at:#topOffset) value) ? 0) - right:(((layoutAspects at:#rightOffset) value) ? 0) - bottom:(((layoutAspects at:#bottomOffset) value) ? 0). - - builderView setDimension:rectangle ! ! -!UIPropertyView methodsFor:'layout relative/absolut'! +!UIPropertyView::Dimension methodsFor:'layout make align'! makeAlignBottomCenter self makeAlignLeft:0.5 top:1 + ! makeAlignBottomLeft self makeAlignLeft:0 top:1 + ! makeAlignBottomRight self makeAlignLeft:1 top:1 + ! makeAlignCenter @@ -1688,21 +1540,21 @@ makeAlignLeft:leftAlignmentFraction top:topAlignmentFraction |lAF tAF lO tO ext| - lAF := (layoutAspects at:#leftAlignmentFraction) value ? 0. - tAF := (layoutAspects at:#topAlignmentFraction) value ? 0. - ext := currentView computeExtent. + lAF := (aspects at:#leftAlignmentFraction) value ? 0. + tAF := (aspects at:#topAlignmentFraction) value ? 0. + ext := forView computeExtent. - (layoutAspects at:#leftAlignmentFraction) value:leftAlignmentFraction. - (layoutAspects at:#topAlignmentFraction) value:topAlignmentFraction. + (aspects at:#leftAlignmentFraction) value:leftAlignmentFraction. + (aspects at:#topAlignmentFraction) value:topAlignmentFraction. - lO := (layoutAspects at:#leftOffset) value ? 0. - tO := (layoutAspects at:#topOffset) value ? 0. + lO := (aspects at:#leftOffset) value ? 0. + tO := (aspects at:#topOffset) value ? 0. lO := lO + (ext x * (leftAlignmentFraction - lAF)). tO := tO + (ext y * (topAlignmentFraction - tAF)). - (layoutAspects at:#leftOffset) value:(lO rounded). - (layoutAspects at:#topOffset) value:(tO rounded). + (aspects at:#leftOffset) value:(lO rounded). + (aspects at:#topOffset) value:(tO rounded). ! makeAlignLeftCenter @@ -1728,17 +1580,20 @@ makeAlignTopRight self makeAlignLeft:1 top:0 -! + +! ! + +!UIPropertyView::Dimension methodsFor:'layout make relative/absolute'! makeLayout:what xOrY:xOrY offset:aBool |extent fraction offset fractSymb offsetSymb| - extent := (currentView superView computeExtent) perform:xOrY. + extent := (forView superView computeExtent) perform:xOrY. fractSymb := (what, 'Fraction') asSymbol. offsetSymb := (what, 'Offset') asSymbol. - fraction := (layoutAspects at:fractSymb) value. - offset := (layoutAspects at:offsetSymb) value. + fraction := (aspects at:fractSymb) value. + offset := (aspects at:offsetSymb) value. aBool ifTrue:[ offset := offset + ((fraction * extent) asInteger). @@ -1750,10 +1605,8 @@ (fraction < 0.0) ifTrue:[ fraction := 0 ]. offset := 0. ]. - (layoutAspects at:offsetSymb) value:offset. - (layoutAspects at:fractSymb) value:fraction. - - + (aspects at:offsetSymb) value:offset. + (aspects at:fractSymb) value:fraction. ! makeOffsetAll @@ -1762,11 +1615,13 @@ self makeOffsetRight. self makeOffsetBottom. + ! makeOffsetBottom self makeLayout:'bottom' xOrY:#y offset:true. + ! makeOffsetLeft @@ -1777,6 +1632,7 @@ makeOffsetLeftTop self makeOffsetLeft. self makeOffsetTop. + ! makeOffsetRight @@ -1795,11 +1651,13 @@ self makeRelativeRight. self makeRelativeBottom. + ! makeRelativeBottom self makeLayout:'bottom' xOrY:#y offset:false. + ! makeRelativeLeft @@ -1810,6 +1668,7 @@ makeRelativeLeftTop self makeRelativeLeft. self makeRelativeTop. + ! makeRelativeRight @@ -1822,137 +1681,82 @@ ! ! -!UIPropertyView methodsFor:'private'! +!UIPropertyView::Dimension methodsFor:'selection'! + +selection + ^ selection -apply - "apply current changes and write back to current view - " - modified ifTrue:[ - self modified:false. +! + +selection:aLayoutType + |spec idx| - self isSingleSelection ifTrue:[ - self isLayoutSpec ifFalse:[ - builderView updateFromSpec:specBeingEdited - ] ifTrue:[ - layoutType notNil ifTrue:[ - self perform:(('write', layoutType asString) asSymbol) - ] - ] - ] - ] + selection == aLayoutType ifFalse:[ + (selection := aLayoutType) notNil ifTrue:[ + self perform:(('fetch', selection asString) asSymbol). + spec := ('specification', selection asString) asSymbol. + spec := self class perform:spec. + ]. + self buildFromSpec:spec. + ]. + idx := layoutTypes findFirst:[:type| type == aLayoutType ]. + noteBook setSelection:idx. +! ! + +!UIPropertyView::Specification methodsFor:'accessing'! + +specEdited + "gets current edit specification + " + ^ specEdited + ! -aspectFor:aKey - "returns aspect for a key - " - |aspect| - - propertyAspects notNil ifTrue:[ - aspect := propertyAspects at:aKey ifAbsent:nil. - aspect notNil ifTrue:[ - ^ aspect - ] - ]. - - ^ layoutAspects at:aKey ifAbsent:[super aspectFor:aKey] -! - -cancel - "cancel all changes and read back attributes from current view +specEdited:aSpec + "sets current edit specification " - modified ifTrue:[ - specBeingEdited := builderView specFor:currentView. - self reload - ]. -! - -propertyList - "returns property list - " - ^ builder componentAt:#propertyList -! + |aspects| -propertyList:aList - "property list changed - " - |sel list plist| - - aList notNil ifTrue:[ - sel := propertySelection. - list := aList - ] ifFalse:[ - list := #() - ]. - - plist := self propertyList. - plist list:list. - plist selection:sel. self modified:false. -! + aSpec isNil ifTrue:[ + specChannel := nil. + specEdited := nil. + ] ifFalse:[ + specEdited class == aSpec class ifTrue:[ + specEdited := aSpec. + specChannel value:specEdited. + ^ self modified:false. + ]. + specEdited := aSpec. + aspects := IdentityDictionary new. + specChannel := specEdited asValue. + specEdited class addBindingsTo:aspects for:specEdited channel:specChannel + ]. + self aspects:aspects. + self buildFromSpec:nil. + + +! ! + +!UIPropertyView::Specification methodsFor:'action'! reload - "relaod all attributes from current specification and update values + "reload specification " - self modified:false. - - self isSingleSelection ifTrue:[ - modified := true. "/ disable notifications" - specChannel value:specBeingEdited. - - self isLayoutSpec ifTrue:[ - self showAndFetchLayout. - ]. - modified := false. "/ enable notifications - ]. - -! - -showSpec:aSpec - "switch to specification - " - |frame| - - shownSpec ~= aSpec ifTrue:[ - frame := builder componentAt:#propertyFrame. - frame destroySubViews. + specChannel notNil ifTrue:[ + specChannel value:specEdited. + self modified:false. + ] - aSpec notNil ifTrue:[ - builder buildFromSpec:aSpec in:frame. - frame realizeAllSubViews - ] - ]. - shownSpec := aSpec. -! ! -!UIPropertyView methodsFor:'queries'! - -isLayoutSpec - "returns true if current menu is a layout specification - " - |selection| - - self isSingleSelection ifTrue:[ - ^ propertySelection == self class titleOfLayoutMenu - ]. - ^ false -! - -isMultiSelection - "returns true in case of a multiple selection - " - ^ (currentView isNil and:[builderView numberOfSelections > 1]) -! - -isSingleSelection - "returns true in case of a single selection - " - ^ currentView notNil ! ! !UIPropertyView class methodsFor:'documentation'! version ^ '$Header$' + + ! !