UIPainterView.st
changeset 2265 f6fbbcdd3764
parent 2257 badd429a2a2a
child 2276 485bda17023f
equal deleted inserted replaced
2264:26ee5a23ae95 2265:f6fbbcdd3764
   531 "/    p := self propertyOfView:aView)
   531 "/    p := self propertyOfView:aView)
   532 "/
   532 "/
   533 "/    builder := UIBuilder new isEditing:true.
   533 "/    builder := UIBuilder new isEditing:true.
   534 "/    newView := aNewSpec buildViewWithLayoutFor:builder in:(container contents view).
   534 "/    newView := aNewSpec buildViewWithLayoutFor:builder in:(container contents view).
   535 self halt.
   535 self halt.
   536 ^self.
   536 "/ ^self.
   537     self deleteSelectionBuffered:false.
   537     self deleteSelectionBuffered:false.
   538     widgets := self pasteSpecifications:(Array with:aNewSpec) keepLayout:false.
   538     widgets := self pasteSpecifications:(Array with:aNewSpec) keepLayout:false.
   539     self select:widgets.
   539     self select:widgets.
   540     ^ widgets.
   540     ^ widgets.
   541 
   541 
   634     "return true, if I can paste into a view"
   634     "return true, if I can paste into a view"
   635 
   635 
   636     |prop|
   636     |prop|
   637 
   637 
   638     aView isNil ifTrue:[ ^ false ].
   638     aView isNil ifTrue:[ ^ false ].
       
   639     aView == self ifTrue:[ ^ true ].
   639 
   640 
   640     (prop := self propertyOfView:aView) notNil ifTrue:[
   641     (prop := self propertyOfView:aView) notNil ifTrue:[
   641         ^ prop spec class supportsSubComponents
   642         ^ prop spec class supportsSubComponents
   642     ].
   643     ].
   643     ^ aView specClass supportsSubComponents.
   644     ^ aView specClass supportsSubComponents.
  1611 
  1612 
  1612     aspects := IdentitySet new.
  1613     aspects := IdentitySet new.
  1613 
  1614 
  1614     cls := self targetClass.
  1615     cls := self targetClass.
  1615     cls notNil ifTrue:[
  1616     cls notNil ifTrue:[
  1616         cls methodsDo:[:m |
  1617         cls withAllSuperclassesDo:[:cls |
  1617             ((m resources ? #()) includesAny:#(uiAspect)) ifTrue:[
  1618             cls methodsDo:[:m |
  1618                 aspects add:m selector
  1619                 ((m resources ? #()) includesAny:#(uiAspect)) ifTrue:[
  1619             ].                  
  1620                     aspects add:m selector
       
  1621                 ].                  
       
  1622             ]
  1620         ]
  1623         ]
  1621     ].
  1624     ].
  1622 
  1625 
  1623     treeView propertiesDo:[:aProp|
  1626     treeView propertiesDo:[:aProp|
  1624         |modelSelector|
  1627         |modelSelector|
  2309         "/ TODO:
  2312         "/ TODO:
  2310         "/ go through subviews and let them resize to their default/preferred
  2313         "/ go through subviews and let them resize to their default/preferred
  2311         "/ needed if we change a containers layout from fit to non-fit.
  2314         "/ needed if we change a containers layout from fit to non-fit.
  2312 
  2315 
  2313         (aView subViews ? #()) do:[:aSubView |
  2316         (aView subViews ? #()) do:[:aSubView |
  2314             |fix spec prop|
  2317             |fix spec prop container|
  2315 
  2318 
  2316             (prop := self propertyOfView:aSubView) notNil ifTrue:[
  2319             (prop := self propertyOfView:aSubView) notNil ifTrue:[
  2317                 spec := prop spec.
  2320                 spec := prop spec.
  2318 
  2321 
  2319                 spec useDefaultExtent ifTrue:[
  2322                 spec useDefaultExtent ifTrue:[
  2320                     fix := aSubView sizeFixed:false.
  2323                     fix := aSubView sizeFixed:false.
  2321                     aSubView extent:aSubView preferredExtent.
  2324                     aView class == VerticalPanelView ifTrue:[
       
  2325                         aSubView height:aSubView preferredExtent y.
       
  2326                     ] ifFalse:[
       
  2327                         aView class == HorizontalPanelView ifTrue:[
       
  2328                             aSubView width:aSubView preferredExtent x.
       
  2329                         ] ifFalse:[
       
  2330                             aSubView extent:aSubView preferredExtent.
       
  2331                         ].
       
  2332                     ].
  2322                     aSubView sizeFixed:fix
  2333                     aSubView sizeFixed:fix
  2323                 ]
  2334                 ]
  2324             ]
  2335             ]
  2325         ].
  2336         ].
  2326     ].
  2337     ].