UIPainter.st
changeset 1103 ecc91379704b
parent 1071 560a9eb1a5d8
child 1115 1d0ff67419fc
equal deleted inserted replaced
1102:abcdd3d5a67b 1103:ecc91379704b
  1953     "opens a Table Column Editor on current widget"
  1953     "opens a Table Column Editor on current widget"
  1954 
  1954 
  1955     |cls loadedFromClass loadedFromSpec editor tableColumnsOrSelector|
  1955     |cls loadedFromClass loadedFromSpec editor tableColumnsOrSelector|
  1956 
  1956 
  1957     (cls := self resolveName:specClass) isNil ifTrue:[
  1957     (cls := self resolveName:specClass) isNil ifTrue:[
  1958 	self askForSaving ifFalse: [^self].
  1958         self askForSaving ifFalse: [^self].
  1959 	cls := self resolveName:specClass.
  1959         cls := self resolveName:specClass.
       
  1960     ].
       
  1961     self modifiedChannel value ifTrue:[
       
  1962         (self confirm:'Accept changes made to spec ?') ifTrue:[
       
  1963             self accept
       
  1964         ]
  1960     ].
  1965     ].
  1961 
  1966 
  1962     loadedFromSpec := loadedFromClass := false.
  1967     loadedFromSpec := loadedFromClass := false.
  1963     editor := DataSetBuilder new.
  1968     editor := DataSetBuilder new.
  1964     editor masterApplication:self.
  1969     editor masterApplication:self.
  1965     editor specClass: cls.
  1970     editor specClass: cls.
  1966     editor rowClassName:(self specTool specification rowClassName).
  1971     editor rowClassName:(self specTool specification rowClassName).
  1967     ((tableColumnsOrSelector := self specTool specification columnHolder) notNil and: 
  1972     ((tableColumnsOrSelector := self specTool specification columnHolder) notNil and: 
  1968     [cls class implements: tableColumnsOrSelector]) ifTrue: [
  1973     [cls class implements: tableColumnsOrSelector]) ifTrue: [
  1969 	editor openModalOnClass: cls andSelector: tableColumnsOrSelector.
  1974         editor openModalOnClass: cls andSelector: tableColumnsOrSelector.
  1970 	loadedFromClass := true.
  1975         loadedFromClass := true.
  1971     ] ifFalse: [       
  1976     ] ifFalse: [       
  1972 	(tableColumnsOrSelector := self specTool specification columns) isNil ifTrue: [
  1977         (tableColumnsOrSelector := self specTool specification columns) isNil ifTrue: [
  1973 	    editor openModal
  1978             editor openModal
  1974 	] ifFalse: [         
  1979         ] ifFalse: [         
  1975 	    editor openModalOnResourceSpec:tableColumnsOrSelector.
  1980             editor openModalOnResourceSpec:tableColumnsOrSelector.
  1976 	    loadedFromSpec := true
  1981             loadedFromSpec := true
  1977 	].
  1982         ].
  1978     ].
  1983     ].
  1979 
  1984 
  1980     loadedFromClass ifTrue: [
  1985     loadedFromClass ifTrue: [
  1981 	self specTool specification columns:nil.
  1986         self specTool specification columns:nil.
  1982 	self specTool specification rowClassName:nil.
  1987         self specTool specification rowClassName:nil.
  1983 	self modifiedChannel value:true.
  1988         self modifiedChannel value:true.
  1984 	self accept.
  1989         self accept.
  1985     ].
  1990     ].
  1986 
  1991 
  1987     (loadedFromSpec not and: [editor hasSaved and:[editor specSelector ~= tableColumnsOrSelector]]) ifTrue:[
  1992     (loadedFromSpec not and: [editor hasSaved and:[editor specSelector ~= tableColumnsOrSelector]]) ifTrue:[
  1988 	self specTool specification columnHolder:editor specSelector.
  1993         self specTool specification columnHolder:editor specSelector.
  1989 	self modifiedChannel value:true.
  1994         self modifiedChannel value:true.
  1990 	self accept.
  1995         self accept.
  1991 	^self
  1996         ^self
  1992     ].
  1997     ].
  1993     loadedFromClass ifFalse: [
  1998     loadedFromClass ifFalse: [
  1994 	self specTool specification columns:(editor columns).
  1999         self specTool specification columns:(editor columns).
  1995 	self specTool specification rowClassName:(editor rowClassName).
  2000         self specTool specification rowClassName:(editor rowClassName).
  1996 	self modifiedChannel value: editor modified.
  2001         self modifiedChannel value: editor modified.
  1997     ].
  2002     ].
  1998 
  2003 
  1999 
  2004 
  2000 !
  2005 !
  2001 
  2006 
  2009         cls := self resolveName:specClass.
  2014         cls := self resolveName:specClass.
  2010     ].
  2015     ].
  2011 
  2016 
  2012     cls notNil ifTrue:[
  2017     cls notNil ifTrue:[
  2013         spec := self specTool specification.
  2018         spec := self specTool specification.
       
  2019 
       
  2020         self modifiedChannel value ifTrue:[
       
  2021             (self confirm:'Accept changes made to spec ?') ifTrue:[
       
  2022                 self accept
       
  2023             ]
       
  2024         ].
       
  2025 
  2014         (selectorOrMenu := spec menuSelector) notNil ifTrue:[
  2026         (selectorOrMenu := spec menuSelector) notNil ifTrue:[
  2015             selectorOrMenu := selectorOrMenu asSymbol
  2027             selectorOrMenu := selectorOrMenu asSymbol
  2016         ] ifFalse:[
  2028         ] ifFalse:[
  2017             "/ cg: q&d hack ...
  2029             "/ cg: q&d hack ...
  2018 
  2030 
  2168     "catches change notifications"
  2180     "catches change notifications"
  2169 
  2181 
  2170     |window|
  2182     |window|
  2171 
  2183 
  2172     someObject == treeView model ifTrue:[
  2184     someObject == treeView model ifTrue:[
  2173 	(something == #selection
  2185         (something == #selection
  2174 	or:[something == #selectionIndex]) ifTrue:[self treeSelection].
  2186         or:[something == #selectionIndex]) ifTrue:[self treeSelection].
  2175       ^ self
  2187       ^ self
  2176     ].
  2188     ].
  2177 
  2189 
  2178     someObject == self galleryShown ifTrue:[
  2190     someObject == self galleryShown ifTrue:[
  2179 	"/ galleryShown toggle changed
  2191         "/ galleryShown toggle changed
  2180 	window := selectionPanel window.
  2192         window := selectionPanel window.
  2181 	(someObject value) ifTrue:[
  2193         (someObject value) ifTrue:[
  2182 	    self raiseUIView:window
  2194             self raiseUIView:window
  2183 	] ifFalse:[
  2195         ] ifFalse:[
  2184 	    self hideUIView:window
  2196             self hideUIView:window
  2185 	].
  2197         ].
  2186       ^ self
  2198       ^ self
  2187     ].
  2199     ].
  2188 
  2200 
  2189     someObject == self painterShown ifTrue:[
  2201     someObject == self painterShown ifTrue:[
  2190 	"/ canvasShown toggle changed
  2202         "/ canvasShown toggle changed
  2191 	window := self painter topView.
  2203         window := self painter topView.
  2192 	(someObject value) ifTrue:[
  2204         (someObject value) ifTrue:[
  2193 	    self raiseUIView:window
  2205             self raiseUIView:window
  2194 	] ifFalse:[
  2206         ] ifFalse:[
  2195 	    self hideUIView:window
  2207             self hideUIView:window
  2196 	].
  2208         ].
  2197       ^ self
  2209       ^ self
  2198     ].
  2210     ].
  2199 
  2211 
  2200     "Modified: / 16.7.1998 / 19:09:57 / cg"
  2212     "Modified: / 16.7.1998 / 19:09:57 / cg"
  2201 !
  2213 !