#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Tue, 27 Mar 2018 17:20:51 +0200
changeset 355194a23bbd725b
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
     1.1 --- a/Tools__ViewTreeApplication.st	Tue Mar 27 13:42:15 2018 +0200
     1.2 +++ b/Tools__ViewTreeApplication.st	Tue Mar 27 17:20:51 2018 +0200
     1.3 @@ -1,5 +1,3 @@
     1.4 -"{ Encoding: utf8 }"
     1.5 -
     1.6  "
     1.7   COPYRIGHT (c) 2007 by eXept Software AG
     1.8  	      All Rights Reserved
     1.9 @@ -1556,18 +1554,20 @@
    1.10  !ViewTreeInspectorApplication methodsFor:'menu specs'!
    1.11  
    1.12  middleButtonMenu
    1.13 -    "returns the middleButton menu for the single selected item or nil"
    1.14 +    "returns the middleButton menu for the single selected view tree item or nil"
    1.15  
    1.16      ^ [
    1.17 -	model selectedItem notNil ifTrue:[
    1.18 -	    model selectedItem isView ifTrue:[
    1.19 -		self class middleButtonMenu
    1.20 -	    ] ifFalse:[
    1.21 -		self class middleButtonMenuForMenuItems
    1.22 -	    ].
    1.23 -	] ifFalse:[
    1.24 -	    nil
    1.25 -	]
    1.26 +        |viewTreeItem|
    1.27 +
    1.28 +        (viewTreeItem := model selectedItem) notNil ifTrue:[
    1.29 +            viewTreeItem isView ifTrue:[
    1.30 +                self class middleButtonMenu
    1.31 +            ] ifFalse:[
    1.32 +                self class middleButtonMenuForMenuItems
    1.33 +            ].
    1.34 +        ] ifFalse:[
    1.35 +            nil
    1.36 +        ]
    1.37        ]
    1.38  
    1.39      "Modified: / 16-08-2017 / 13:48:31 / cg"
    1.40 @@ -2618,6 +2618,10 @@
    1.41      isDrawnShown := aBoolean.
    1.42  !
    1.43  
    1.44 +isMenuItem
    1.45 +    ^ menuItem notNil
    1.46 +!
    1.47 +
    1.48  menuItem
    1.49      ^ menuItem
    1.50  !
    1.51 @@ -3309,11 +3313,12 @@
    1.52  isApplicationClass
    1.53      |cls|
    1.54  
    1.55 +    widget isNil ifTrue:[^ false].
    1.56      cls := widget class.
    1.57  
    1.58      ^ (    cls == ApplicationSubView
    1.59 -	or:[cls == ApplicationWindow
    1.60 -	or:[cls == SubCanvas]]
    1.61 +        or:[cls == ApplicationWindow
    1.62 +        or:[cls == SubCanvas]]
    1.63        )
    1.64  !
    1.65  
    1.66 @@ -3325,6 +3330,10 @@
    1.67      ^ false
    1.68  !
    1.69  
    1.70 +isView
    1.71 +    ^ widget notNil
    1.72 +!
    1.73 +
    1.74  supportsSubComponents
    1.75      "returns true if the widget supports sub components
    1.76      "