actionFor:aKey withValue:aValue
authorca
Thu, 23 Oct 1997 15:36:34 +0200
changeset 716 a23d48401446
parent 715 bedd651e731c
child 717 b89142a61d05
actionFor:aKey withValue:aValue allow argument for an action
WinBuilder.st
WindowBuilder.st
--- a/WinBuilder.st	Thu Oct 23 15:35:57 1997 +0200
+++ b/WinBuilder.st	Thu Oct 23 15:36:34 1997 +0200
@@ -445,6 +445,39 @@
     "Created: 17.1.1997 / 21:08:22 / cg"
 !
 
+actionFor:aKey withValue:aValue
+    "return an action for aKey/value combonation. 
+     This is invoked during window building
+     (by the builder) to ask for an ActionButtons actionBlock if that button
+     specified an action with an argument value.
+     Here, first the local bindings are searched, then the application and
+     finally the applications class is asked for a corresponding action.
+     The returned object is typically a block."
+
+    |b|
+
+    bindings notNil ifTrue:[
+        b := bindings at:aKey ifAbsent:nil.
+        b notNil ifTrue:[^ b].
+    ].
+
+    application notNil ifTrue:[
+        Object messageNotUnderstoodSignal handle:[:ex |
+            Transcript showCR:'not understood: ' , aKey.
+        ] do:[
+            ^ application actionFor:aKey withValue:aValue
+        ]
+    ].
+    applicationClass notNil ifTrue:[
+        (applicationClass respondsTo:#actionFor:withValue:) ifTrue:[
+            ^ applicationClass actionFor:aKey  withValue:aValue
+        ]
+    ].
+    ^ [:dummy | ]
+
+    "Created: 17.1.1997 / 21:08:22 / cg"
+!
+
 aspectFor:aKey
     "return a model for aKey. This is invoked during window building
      (by the builder) to ask for an Editfields, a Toggles etc. model.
@@ -754,5 +787,5 @@
 !WindowBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/Attic/WinBuilder.st,v 1.50 1997-10-15 10:55:40 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/Attic/WinBuilder.st,v 1.51 1997-10-23 13:36:34 ca Exp $'
 ! !
--- a/WindowBuilder.st	Thu Oct 23 15:35:57 1997 +0200
+++ b/WindowBuilder.st	Thu Oct 23 15:36:34 1997 +0200
@@ -445,6 +445,39 @@
     "Created: 17.1.1997 / 21:08:22 / cg"
 !
 
+actionFor:aKey withValue:aValue
+    "return an action for aKey/value combonation. 
+     This is invoked during window building
+     (by the builder) to ask for an ActionButtons actionBlock if that button
+     specified an action with an argument value.
+     Here, first the local bindings are searched, then the application and
+     finally the applications class is asked for a corresponding action.
+     The returned object is typically a block."
+
+    |b|
+
+    bindings notNil ifTrue:[
+        b := bindings at:aKey ifAbsent:nil.
+        b notNil ifTrue:[^ b].
+    ].
+
+    application notNil ifTrue:[
+        Object messageNotUnderstoodSignal handle:[:ex |
+            Transcript showCR:'not understood: ' , aKey.
+        ] do:[
+            ^ application actionFor:aKey withValue:aValue
+        ]
+    ].
+    applicationClass notNil ifTrue:[
+        (applicationClass respondsTo:#actionFor:withValue:) ifTrue:[
+            ^ applicationClass actionFor:aKey  withValue:aValue
+        ]
+    ].
+    ^ [:dummy | ]
+
+    "Created: 17.1.1997 / 21:08:22 / cg"
+!
+
 aspectFor:aKey
     "return a model for aKey. This is invoked during window building
      (by the builder) to ask for an Editfields, a Toggles etc. model.
@@ -754,5 +787,5 @@
 !WindowBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.50 1997-10-15 10:55:40 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.51 1997-10-23 13:36:34 ca Exp $'
 ! !