UIPainterView.st
changeset 75 c9779da5ce4e
parent 71 407d25aca670
child 78 a0a00603a8b6
equal deleted inserted replaced
74:dfa8644e0287 75:c9779da5ce4e
  1778 !
  1778 !
  1779 
  1779 
  1780 undoSpecModify:aViewId
  1780 undoSpecModify:aViewId
  1781     "undo method when changing the specification for an object
  1781     "undo method when changing the specification for an object
  1782     "
  1782     "
  1783     |builder view spec|
  1783     |builder view spec v|
  1784 
  1784 
  1785     undoHistory isTransactionOpen ifFalse:[^ self].
  1785     undoHistory isTransactionOpen ifFalse:[^ self].
  1786 
  1786 
  1787     (view := self findViewWithId:aViewId) notNil ifTrue:[
  1787     (view := self findViewWithId:aViewId) notNil ifTrue:[
  1788         spec := (self generateSpecFor:view) first.
  1788         spec := (self generateSpecFor:view) first.
  1789         view := nil.
  1789         view := nil.
  1790 
  1790 
  1791         undoHistory addUndoBlock:[
  1791         undoHistory addUndoBlock:[
  1792             (view := self findViewWithId:aViewId) notNil ifTrue:[
  1792             (view := self findViewWithId:aViewId) notNil ifTrue:[
  1793                 builder := UIBuilder new.
  1793                 builder := UIBuilder new.
  1794                 spec setAttributesIn:view with:builder.
  1794                 spec needsRebuildForAttributes ifTrue:[
  1795                 self elementChangedSize:view.
  1795                     v := spec buildViewWithLayoutFor:builder in:view superView.
       
  1796                     v realize.    
       
  1797                     view destroy.
       
  1798                     view become:v.    
       
  1799                 ] ifFalse:[
       
  1800                     spec setAttributesIn:view with:builder.
       
  1801                     self elementChangedSize:view.
       
  1802                 ].
  1796             ]
  1803             ]
  1797         ]
  1804         ]
  1798     ].
  1805     ].
  1799 
  1806 
  1800 
  1807 
  1804 !UIPainterView methodsFor:'update from Specification'!
  1811 !UIPainterView methodsFor:'update from Specification'!
  1805 
  1812 
  1806 updateFromSpec:aSpec
  1813 updateFromSpec:aSpec
  1807     "update current selected view from specification
  1814     "update current selected view from specification
  1808     "
  1815     "
  1809     |props name builder|
  1816     |props name builder v|
  1810 
  1817 
  1811     self singleSelection notNil ifTrue:[
  1818     self singleSelection notNil ifTrue:[
  1812         self withSelectionHiddenDo:[
  1819         self withSelectionHiddenDo:[
  1813             self transaction:#specification selectionDo:[:aView|
  1820             self transaction:#specification selectionDo:[:aView|
  1814                 builder := UIBuilder new.
  1821                 builder := UIBuilder new.
  1828                     name isNil ifTrue:[
  1835                     name isNil ifTrue:[
  1829                         aSpec name:(aView name).
  1836                         aSpec name:(aView name).
  1830                     ]
  1837                     ]
  1831                 ].
  1838                 ].
  1832 
  1839 
  1833                 aSpec setAttributesIn:aView with:builder.
  1840                 aSpec needsRebuildForAttributes ifTrue:[
  1834                 self elementChangedSize:aView.
  1841                     v := aSpec buildViewWithLayoutFor:builder in:aView superView.
       
  1842                     v realize.    
       
  1843                     aView destroy.
       
  1844                     device sync. device flush.
       
  1845                     aView becomeSameAs:v.
       
  1846                     inputView raise.
       
  1847                 ] ifFalse:[
       
  1848                     aSpec setAttributesIn:aView with:builder.
       
  1849                     self elementChangedSize:aView.
       
  1850                 ].
  1835 
  1851 
  1836                 props tabable:aSpec tabable.
  1852                 props tabable:aSpec tabable.
  1837                 props defaultable:aSpec defaultable.
  1853                 props defaultable:aSpec defaultable.
  1838                 props initiallyInvisible:aSpec initiallyInvisible.
  1854                 props initiallyInvisible:aSpec initiallyInvisible.
  1839                 props aspectSelector:aSpec modelSelector.
  1855                 props aspectSelector:aSpec modelSelector.
  1843             ]
  1859             ]
  1844         ].
  1860         ].
  1845         self changed:#tree
  1861         self changed:#tree
  1846     ].
  1862     ].
  1847 
  1863 
       
  1864     "Modified: 1.3.1997 / 01:39:53 / cg"
  1848 ! !
  1865 ! !
  1849 
  1866 
  1850 !UIPainterView::ViewProperty class methodsFor:'documentation'!
  1867 !UIPainterView::ViewProperty class methodsFor:'documentation'!
  1851 
  1868 
  1852 version
  1869 version