support of TabItemEditor
authorca
Thu, 29 Jan 1998 10:09:23 +0100
changeset 513 a0d00fecb49a
parent 512 1648b541aab5
child 514 5ac07e96e448
support of TabItemEditor
UIPainter.st
--- a/UIPainter.st	Wed Jan 28 23:06:10 1998 +0100
+++ b/UIPainter.st	Thu Jan 29 10:09:23 1998 +0100
@@ -1500,114 +1500,6 @@
     "
     self painter moveSelectionUp
 
-!
-
-openDataSetColumnEditor
-    "opens a column editor
-    "
-    |cls aspect editor columns|
-
-    cls := self resolveName:specClass.
-
-    cls isNil ifTrue:[
-        ^ self information:'No application class defined yet!!'
-    ].
-    aspect := self specTool specification columns.
-    editor := DataSetBuilder new.
-    editor masterApplication:self.
-    editor columns:aspect fromView:(self layoutTool layoutView).
-    editor rowClassName:(self specTool specification rowClassName).
-    editor openModal.
-
-    editor hasChanged ifTrue:[
-        self specTool specification columns:(editor columns).
-        self specTool specification rowClassName:(editor rowClassName).
-        self modifiedChannel value:true.
-    ].
-!
-
-openEditMenu
-    "opens a menu editor on current widget
-    "
-    |cls aspect editor|
-
-    cls := self resolveName:specClass.
-
-    cls isNil ifTrue:[
-        ^ self information:'No application class defined yet!!'
-    ].
-
-    cls notNil ifTrue:[
-        (aspect := self specTool specification menuSelector) notNil ifTrue:[
-            aspect := aspect asSymbol
-        ] ifFalse:[
-            "/ cg: q&d hack ...
-
-            aspect := treeView propertySelected.
-            aspect notNil ifTrue:[
-                Object errorSignal handle:[:ex |
-                    aspect := nil.
-                ] do:[
-                    aspect := aspect view asMenu.
-                ]
-            ].
-        ].
-        
-        editor := MenuEditor new.
-        editor masterApplication:self.
-        editor useHelpDictionary:(self helpTool dictionary).
-        editor openModalOnClass:cls andSelector:aspect.
-        self helpTool updateList.
-
-        editor selectorName ~= aspect ifTrue:[
-            editor didInstall ifTrue:[
-                self specTool specification menuSelector:editor selectorName asSymbol.
-                self modifiedChannel value:true.
-                self accept
-            ]
-        ].
-    ]
-
-    "Modified: 31.7.1997 / 14:26:13 / cg"
-!
-
-openHierarchicalListEditor
-    "opens a hierarchical list editor editor on current widget
-    "
-    |cls aspect editor|
-
-    cls := self resolveName:specClass.
-
-    cls isNil ifTrue:[
-        ^ self information:'No application class defined yet!!'
-    ].
-
-    (aspect := self specTool specification hierarchicalList) notNil ifTrue:[
-        aspect := aspect asSymbol
-    ] ifFalse:[
-        "/ cg: q&d hack ...
-
-        aspect := treeView propertySelected.
-        aspect notNil ifTrue:[
-            Object errorSignal handle:[:ex |
-                aspect := nil.
-            ] do:[
-                aspect := aspect view asMenu.
-            ]
-        ].
-    ].
-    
-    editor := HierarchicalListEditor new.
-    editor masterApplication:self.
-    editor openModalOnClass:cls andSelector:aspect.
-
-    editor selectorName ~= aspect ifTrue:[
-        editor didInstall ifTrue:[
-            self specTool specification hierarchicalList:editor selectorName asSymbol.
-            self modifiedChannel value:true.
-            self accept
-        ]
-    ]
 ! !
 
 !UIPainter methodsFor:'active help'!
@@ -1779,6 +1671,141 @@
   ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
 ! !
 
+!UIPainter methodsFor:'buildin editors'!
+
+openDataSetColumnEditor
+    "opens a column editor
+    "
+    |cls aspect editor columns|
+
+    cls := self resolveName:specClass.
+
+    cls isNil ifTrue:[
+        ^ self information:'No application class defined yet!!'
+    ].
+    aspect := self specTool specification columns.
+    editor := DataSetBuilder new.
+    editor masterApplication:self.
+    editor columns:aspect fromView:(self layoutTool layoutView).
+    editor rowClassName:(self specTool specification rowClassName).
+    editor openModal.
+
+    editor hasChanged ifTrue:[
+        self specTool specification columns:(editor columns).
+        self specTool specification rowClassName:(editor rowClassName).
+        self modifiedChannel value:true.
+    ].
+!
+
+openEditMenu
+    "opens a menu editor on current widget
+    "
+    |cls aspect editor|
+
+    cls := self resolveName:specClass.
+
+    cls isNil ifTrue:[
+        ^ self information:'No application class defined yet!!'
+    ].
+
+    cls notNil ifTrue:[
+        (aspect := self specTool specification menuSelector) notNil ifTrue:[
+            aspect := aspect asSymbol
+        ] ifFalse:[
+            "/ cg: q&d hack ...
+
+            aspect := treeView propertySelected.
+            aspect notNil ifTrue:[
+                Object errorSignal handle:[:ex |
+                    aspect := nil.
+                ] do:[
+                    aspect := aspect view asMenu.
+                ]
+            ].
+        ].
+        
+        editor := MenuEditor new.
+        editor masterApplication:self.
+        editor useHelpDictionary:(self helpTool dictionary).
+        editor openModalOnClass:cls andSelector:aspect.
+        self helpTool updateList.
+
+        editor selectorName ~= aspect ifTrue:[
+            editor didInstall ifTrue:[
+                self specTool specification menuSelector:editor selectorName asSymbol.
+                self modifiedChannel value:true.
+                self accept
+            ]
+        ].
+    ]
+
+    "Modified: 31.7.1997 / 14:26:13 / cg"
+!
+
+openHierarchicalListEditor
+    "opens a hierarchical list editor editor on current widget
+    "
+    |cls aspect editor|
+
+    cls := self resolveName:specClass.
+
+    cls isNil ifTrue:[
+        ^ self information:'No application class defined yet!!'
+    ].
+
+    (aspect := self specTool specification hierarchicalList) notNil ifTrue:[
+        aspect := aspect asSymbol
+    ] ifFalse:[
+        "/ cg: q&d hack ...
+
+        aspect := treeView propertySelected.
+        aspect notNil ifTrue:[
+            Object errorSignal handle:[:ex |
+                aspect := nil.
+            ] do:[
+                aspect := aspect view asMenu.
+            ]
+        ].
+    ].
+    
+    editor := HierarchicalListEditor new.
+    editor masterApplication:self.
+    editor openModalOnClass:cls andSelector:aspect.
+
+    editor selectorName ~= aspect ifTrue:[
+        editor didInstall ifTrue:[
+            self specTool specification hierarchicalList:editor selectorName asSymbol.
+            self modifiedChannel value:true.
+            self accept
+        ]
+    ]
+!
+
+openTabItemEditor
+    "opens a column editor
+    "
+    |cls aspect editor columns|
+
+    cls := self resolveName:specClass.
+
+    cls isNil ifTrue:[
+        ^ self information:'no application class defined yet'
+    ].
+    aspect := self specTool specification listSelector.
+    editor := TabItemEditor new.
+    editor masterApplication:self.
+
+    editor openModalOnClass:cls andSelector:aspect.
+
+    editor selector ~= aspect ifTrue:[
+        editor didInstall ifTrue:[
+            self specTool specification listSelector:(editor selector).
+            self modifiedChannel value:true.
+            self accept.
+        ]
+    ]
+! !
+
 !UIPainter methodsFor:'change & update'!
 
 layoutChanged
@@ -2176,7 +2203,11 @@
         aTopView = selectionPanel window ifTrue:[
             self galleryShown value:false
         ] ifFalse:[
-            self painterShown value:false
+            aTopView == (self painter topView) ifTrue:[
+                self painterShown value:false
+            ] ifFalse:[
+                aTopView closeRequest
+            ]
         ].
         topView raise.
     ].