UIPainterView.st
changeset 1671 493e0430518e
parent 1664 782f3bda3c88
child 1683 f95658463570
equal deleted inserted replaced
1670:72af7609bb08 1671:493e0430518e
   145 className:aClassName superclassName:aSuperclassName selector:aSelector
   145 className:aClassName superclassName:aSuperclassName selector:aSelector
   146     className      := aClassName.
   146     className      := aClassName.
   147     superclassName := aSuperclassName.
   147     superclassName := aSuperclassName.
   148     methodName     := aSelector.
   148     methodName     := aSelector.
   149 
   149 
   150 !
       
   151 
       
   152 findInputViewIn:aSuperView
       
   153     "returns index of input view into superview or nil
       
   154     "
       
   155     aSuperView == self ifTrue:[
       
   156         ^ self subViews findFirst:[:v| v == inputView ]
       
   157     ].
       
   158   ^ 0
       
   159 !
       
   160 
       
   161 inputView
       
   162     ^ inputView
       
   163 !
   150 !
   164 
   151 
   165 methodName
   152 methodName
   166     ^ methodName
   153     ^ methodName
   167 !
   154 !
   451                            withArgs:(newSel collect:[:v|(self propertyOfView:v) identifier])
   438                            withArgs:(newSel collect:[:v|(self propertyOfView:v) identifier])
   452     ].
   439     ].
   453 
   440 
   454     self realizeAllSubViews.
   441     self realizeAllSubViews.
   455     newSel do:[:v| v raise].
   442     newSel do:[:v| v raise].
   456     inputView raise.
       
   457     self elementChangedSize:frame.
   443     self elementChangedSize:frame.
   458 
   444 
   459     newSel size == 1 ifTrue:[newSel := newSel at:1].
   445     newSel size == 1 ifTrue:[newSel := newSel at:1].
   460     ^ newSel
   446     ^ newSel
   461 
   447 
  1335     spec := OrderedCollection new.
  1321     spec := OrderedCollection new.
  1336 
  1322 
  1337     self subViews do:[:aView|
  1323     self subViews do:[:aView|
  1338         |vSpec|
  1324         |vSpec|
  1339 
  1325 
  1340         aView ~~ inputView ifTrue:[
  1326         "/ care for wrapped views ...
  1341             "/ care for wrapped views ...
  1327         vSpec := self fullSpecFor:aView.
  1342             vSpec := self fullSpecFor:aView.
  1328         vSpec isNil ifTrue:[
  1343             vSpec isNil ifTrue:[
  1329             aView subViews size == 1 ifTrue:[
  1344                 aView subViews size == 1 ifTrue:[
  1330                 vSpec := self fullSpecFor:(aView subViews first).
  1345                     vSpec := self fullSpecFor:(aView subViews first).
  1331             ]
  1346                 ]
  1332         ].
  1347             ].
  1333         vSpec isNil ifTrue:[
  1348             vSpec isNil ifTrue:[
  1334             self warn:'Oops - could not create spec for some view'
  1349                 self warn:'Oops - could not create spec for some view'
  1335         ].
  1350             ].
  1336         spec add:vSpec
  1351             spec add:vSpec
       
  1352         ]
       
  1353     ].
  1337     ].
  1354 
  1338 
  1355     spec := treeView generateFullSpecForComponents:spec named:methodName.
  1339     spec := treeView generateFullSpecForComponents:spec named:methodName.
  1356     str  := WriteStream on:String new.
  1340     str  := WriteStream on:String new.
  1357     UISpecification prettyPrintSpecArray:spec on:str indent:5.
  1341     UISpecification prettyPrintSpecArray:spec on:str indent:5.
  1484         spec notNil ifTrue:[
  1468         spec notNil ifTrue:[
  1485             spec window setupView:self topView for:builder.
  1469             spec window setupView:self topView for:builder.
  1486             self addSpec:(spec component) builder:builder in:self.
  1470             self addSpec:(spec component) builder:builder in:self.
  1487         ].
  1471         ].
  1488         self realizeAllSubViews.
  1472         self realizeAllSubViews.
  1489         inputView raise.
       
  1490         spec notNil ifTrue:[
  1473         spec notNil ifTrue:[
  1491             treeView setAttributesFromWindowSpec:(spec window)
  1474             treeView setAttributesFromWindowSpec:(spec window)
  1492         ]
  1475         ].
  1493     ]
  1476     ].
  1494 
       
  1495 !
  1477 !
  1496 
  1478 
  1497 treeView:aTreeView
  1479 treeView:aTreeView
  1498     treeView := aTreeView.
  1480     treeView := aTreeView.
  1499 
  1481 
  1858         (n isNil or:[(self propertyOfName:n) notNil]) ifTrue:[
  1840         (n isNil or:[(self propertyOfName:n) notNil]) ifTrue:[
  1859             s name:(self uniqueNameFor:s)
  1841             s name:(self uniqueNameFor:s)
  1860         ].
  1842         ].
  1861         treeView addProperty:p.
  1843         treeView addProperty:p.
  1862     ].
  1844     ].
  1863 
       
  1864     ^ aSpecification buildViewWithLayoutFor:aBuilder in:aFrame.
  1845     ^ aSpecification buildViewWithLayoutFor:aBuilder in:aFrame.
  1865 
  1846 
  1866     "Modified: 4.7.1997 / 23:48:55 / cg"
  1847     "Modified: 4.7.1997 / 23:48:55 / cg"
  1867 !
  1848 !
  1868 
  1849 
  1934         v := aSpec buildViewWithLayoutFor:builder in:(self findContainerOfView:aView).
  1915         v := aSpec buildViewWithLayoutFor:builder in:(self findContainerOfView:aView).
  1935         v realize.    
  1916         v realize.    
  1936         aView destroy.
  1917         aView destroy.
  1937         device flush  "sync" .
  1918         device flush  "sync" .
  1938         aView becomeSameAs:v.
  1919         aView becomeSameAs:v.
  1939         inputView raise.
       
  1940     ] ifFalse:[
  1920     ] ifFalse:[
  1941         aSpec setAttributesIn:aView with:builder.
  1921         aSpec setAttributesIn:aView with:builder.
  1942         self elementChangedSize:aView.
  1922         self elementChangedSize:aView.
  1943     ].
  1923     ].
  1944 !
  1924 !
  2180     frame isNil ifTrue:[
  2160     frame isNil ifTrue:[
  2181         frame := self
  2161         frame := self
  2182     ].
  2162     ].
  2183     view := self addSpec:(args at:1) builder:(UIBuilder new isEditing:true) in:frame.
  2163     view := self addSpec:(args at:1) builder:(UIBuilder new isEditing:true) in:frame.
  2184     view realize.
  2164     view realize.
  2185     inputView raise.
       
  2186 
  2165 
  2187     prop := self propertyOfView:view.
  2166     prop := self propertyOfView:view.
  2188     prop identifier:(args at:2).
  2167     prop identifier:(args at:2).
  2189 
       
  2190 !
  2168 !
  2191 
  2169 
  2192 undoSpecModify:args
  2170 undoSpecModify:args
  2193     "undo method when changing a spec; see 'createUndoSpecModify:'
  2171     "undo method when changing a spec; see 'createUndoSpecModify:'
  2194     "
  2172     "