style option: submenu pops up everywhere in item or
(if menu.subMenuPopInRightHalfOnly is true) only if pointer
is in right half.
--- a/MenuView.st Wed Jul 29 18:00:06 1998 +0200
+++ b/MenuView.st Thu Jul 30 11:18:04 1998 +0200
@@ -2184,56 +2184,59 @@
"select whatever is under x/y coordinate - if there is
a subMenu, show it"
+ <resource: #style (#'menu.subMenuPopInRightHalfOnly')>
+
|newSelection subMenu|
(x < 0
or:[x >= width
or:[y < 0
or:[y >= height]]]) ifTrue:[
- "
- moved outside submenu, but not within self
- "
- subMenuShown notNil ifTrue:[
- ^ self
- ].
- superMenu notNil ifTrue:[
- superMenu regainControl
- ].
+ "
+ moved outside submenu, but not within self
+ "
+ subMenuShown notNil ifTrue:[
+ ^ self
+ ].
+ superMenu notNil ifTrue:[
+ superMenu regainControl
+ ].
].
newSelection := self positionToSelectionX:x y:y.
newSelection ~= selection ifTrue:[
- newSelection notNil ifTrue:[
- (enableFlags at:newSelection) ifFalse:[
- newSelection := nil
- ]
- ].
-
- subMenuShown notNil ifTrue:[
- self hideSubmenu.
- ].
-
- self setSelection:newSelection.
+ newSelection notNil ifTrue:[
+ (enableFlags at:newSelection) ifFalse:[
+ newSelection := nil
+ ]
+ ].
+
+ subMenuShown notNil ifTrue:[
+ self hideSubmenu.
+ ].
+
+ self setSelection:newSelection.
].
subMenu := nil.
selection notNil ifTrue:[
- subMenus notNil ifTrue:[
- x > (width // 2) ifTrue:[
- subMenu := (subMenus at:selection)
- ]
- ]
+ subMenus notNil ifTrue:[
+ ((styleSheet at:'menu.subMenuPopInRightHalfOnly' default:false) not
+ or:[x > (width // 2)]) ifTrue:[
+ subMenu := (subMenus at:selection)
+ ]
+ ]
].
subMenu notNil ifTrue:[
- self showSubmenu:selection.
+ self showSubmenu:selection.
] ifFalse:[
- subMenuShown notNil ifTrue:[
- self hideSubmenu.
- ].
- subMenuShown := nil
+ subMenuShown notNil ifTrue:[
+ self hideSubmenu.
+ ].
+ subMenuShown := nil
]
- "Modified: 25.5.1996 / 12:27:37 / cg"
+ "Modified: / 29.7.1998 / 23:36:25 / cg"
!
showSubmenu:index
@@ -2699,5 +2702,5 @@
!MenuView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/MenuView.st,v 1.113 1998-05-19 20:19:17 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/MenuView.st,v 1.114 1998-07-30 09:18:04 cg Exp $'
! !