#BUGFIX by cg draft
authorClaus Gittinger <cg@exept.de>
Tue, 27 Mar 2018 17:20:51 +0200
changeset 3551 94a23bbd725b
parent 3550 b31b44c04a3e
child 3552 2a1e3a914c9a
#BUGFIX by cg class: Tools::ViewTreeInspectorApplication changed: #middleButtonMenu always treated items like views. class: Tools::ViewTreeInspectorApplication::ViewTreeItem added: #isMenuItem #isView changed: #isApplicationClass
Tools__ViewTreeApplication.st
--- a/Tools__ViewTreeApplication.st	Tue Mar 27 13:42:15 2018 +0200
+++ b/Tools__ViewTreeApplication.st	Tue Mar 27 17:20:51 2018 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 2007 by eXept Software AG
 	      All Rights Reserved
@@ -1556,18 +1554,20 @@
 !ViewTreeInspectorApplication methodsFor:'menu specs'!
 
 middleButtonMenu
-    "returns the middleButton menu for the single selected item or nil"
+    "returns the middleButton menu for the single selected view tree item or nil"
 
     ^ [
-	model selectedItem notNil ifTrue:[
-	    model selectedItem isView ifTrue:[
-		self class middleButtonMenu
-	    ] ifFalse:[
-		self class middleButtonMenuForMenuItems
-	    ].
-	] ifFalse:[
-	    nil
-	]
+        |viewTreeItem|
+
+        (viewTreeItem := model selectedItem) notNil ifTrue:[
+            viewTreeItem isView ifTrue:[
+                self class middleButtonMenu
+            ] ifFalse:[
+                self class middleButtonMenuForMenuItems
+            ].
+        ] ifFalse:[
+            nil
+        ]
       ]
 
     "Modified: / 16-08-2017 / 13:48:31 / cg"
@@ -2618,6 +2618,10 @@
     isDrawnShown := aBoolean.
 !
 
+isMenuItem
+    ^ menuItem notNil
+!
+
 menuItem
     ^ menuItem
 !
@@ -3309,11 +3313,12 @@
 isApplicationClass
     |cls|
 
+    widget isNil ifTrue:[^ false].
     cls := widget class.
 
     ^ (    cls == ApplicationSubView
-	or:[cls == ApplicationWindow
-	or:[cls == SubCanvas]]
+        or:[cls == ApplicationWindow
+        or:[cls == SubCanvas]]
       )
 !
 
@@ -3325,6 +3330,10 @@
     ^ false
 !
 
+isView
+    ^ widget notNil
+!
+
 supportsSubComponents
     "returns true if the widget supports sub components
     "