add isEditing; set to true if running UIPainter
authorca
Mon, 05 Jan 1998 16:46:07 +0100
changeset 751 56a83a3b210c
parent 750 b5fc6db78fea
child 752 93690dcd1b75
add isEditing; set to true if running UIPainter
UIBuilder.st
--- a/UIBuilder.st	Mon Dec 22 21:24:11 1997 +0100
+++ b/UIBuilder.st	Mon Jan 05 16:46:07 1998 +0100
@@ -12,7 +12,7 @@
 
 WindowBuilder subclass:#UIBuilder
 	instanceVariableNames:'view currentMenuSelector spec specStack composite lastComponent
-		compositeView menuBar'
+		compositeView menuBar isEditing'
 	classVariableNames:'Verbose'
 	poolDictionaries:''
 	category:'Interface-Support-UI'
@@ -82,6 +82,20 @@
 
 !UIBuilder methodsFor:'accessing'!
 
+isEditing
+    "true if build from a GUI builder resource ( UIPainter, ... ); if true, no
+     models or actions should be set (no application is running)
+    "
+    ^ isEditing ? false
+!
+
+isEditing:aState
+    "true if build from a GUI builder resource ( UIPainter, ... ); if true, no
+     models or actions should be set (no application is running)
+    "
+    isEditing := aState
+!
+
 menuAt:aKey
     "Find a binding for the menu named aKey, either in the bindings 
      or from the source"
@@ -170,9 +184,11 @@
     |builder|
 
     builder := UIBuilder new.
+
+    builder isEditing:isEditing.
     builder bindings:(self bindings).
     builder application:(self application).
-    ^ builder
+  ^ builder
 ! !
 
 !UIBuilder methodsFor:'building - programatically'!
@@ -322,6 +338,6 @@
 !UIBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.29 1997-11-02 18:34:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.30 1998-01-05 15:46:07 ca Exp $'
 ! !
 UIBuilder initialize!