embedding as special editors
authorClaus Gittinger <cg@exept.de>
Fri, 17 Feb 2006 13:06:22 +0100
changeset 2007 77cf7ecc9ecf
parent 2006 ae6fe65e9f33
child 2008 a2906aabdbb1
embedding as special editors
UIPainter.st
--- a/UIPainter.st	Fri Feb 17 13:05:33 2006 +0100
+++ b/UIPainter.st	Fri Feb 17 13:06:22 2006 +0100
@@ -13,9 +13,9 @@
 
 "{ Package: 'stx:libtool2' }"
 
-ToolApplicationModel subclass:#UIPainter
-	instanceVariableNames:'specClassName specSelector specSuperclassName aspects treeView
-		selectionPanel tabSelection modified specTool layoutTool helpTool'
+ResourceSpecEditor subclass:#UIPainter
+	instanceVariableNames:'specSuperclassName treeView selectionPanel specTool layoutTool
+		helpTool'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-UIPainter'
@@ -2996,7 +2996,7 @@
             yesText:(resources string:'Discard Changes and Exit');
             showAtPointer;
             accepted) ifFalse: [^false].
-        modified := false.
+        self clearModified.
         painter resetModification
     ].
     ^true
@@ -3465,18 +3465,18 @@
 
     self askForModification ifFalse:[^self].
 
+    super closeRequest.
+
     treeView model removeDependent:self.
-    self painter release.
+    "/ self painter release.
 
     selectionPanel notNil ifTrue:[
-	selectionPanel masterApplication:nil.
-	selectionPanel closeRequest
+        selectionPanel masterApplication:nil.
+        selectionPanel closeRequest
     ].
     selectionPanel := nil.
     treeView       := nil.
 
-    super closeRequest.
-
 !
 
 closeRequestFor:aTopView
@@ -3696,15 +3696,20 @@
     [selectionPanel isNil] whileTrue:[
         Delay waitForSeconds:0.1.
     ].
+
     galleryWindow := selectionPanel window.
 
     myOrg := myWindow origin.
     myCorner := myWindow corner.
 
     "/ try to lay out things non-overlapping
+    true
+
     "/ but only, if the window manager placed all windows
     "/ on top of each other
-    myOrg = canvasWindow origin ifTrue:[
+    "/ myOrg = canvasWindow origin 
+
+    ifTrue:[
 
         canvasOrg := 10@20.
 "/        myOrg := (device width - myWindow width - 20) @ 20.
@@ -3795,7 +3800,7 @@
         painter updateFromSpec:spec
     ].
 
-    modified := false.
+    self clearModified
 !
 
 addWidget: aSpecClass
@@ -3858,7 +3863,7 @@
             ]
         ].        
         self clearModifiedFlag.
-        modified := false.
+        self clearModified.
     ]
 !
 
@@ -4280,7 +4285,7 @@
     self doGenerateAspectSelectorsMethod.
     self helpTool doSave.
     self updateInfoLabel.
-    modified := false.
+    self clearModified.
     painter resetModification.
     (specClass respondsTo:specSelector) ifTrue:[
         self addHistoryEntryForClass:specClass selector:specSelector.
@@ -4304,7 +4309,7 @@
 
     classAndSelector isNil ifTrue:[^ false].
 
-    modified := false.
+    self clearModified.
     self painter resetModification.
 
     specClassName := classAndSelector methodClass.