support autoSelect of first item (motif style)
authorClaus Gittinger <cg@exept.de>
Sun, 12 May 1996 16:39:02 +0200
changeset 631 3b50fb0a505e
parent 630 ed57feb12f92
child 632 5af2c22002e4
support autoSelect of first item (motif style)
PullDMenu.st
PullDownMenu.st
--- a/PullDMenu.st	Sun May 12 16:33:36 1996 +0200
+++ b/PullDMenu.st	Sun May 12 16:39:02 1996 +0200
@@ -1091,32 +1091,38 @@
     subMenu := menus at:aNumber.
 
     raiseTopWhenActivated ifTrue:[
-	self topView raise.
+        self topView raise.
     ].
 
     (activeMenuNumber notNil 
     and:[
-	 subMenu notNil
-	 or:[selectors notNil and:[(selectors at:activeMenuNumber) notNil]]]) ifTrue:[
-	    self highlightActiveTitle.
-	 ].
+         subMenu notNil
+         or:[selectors notNil and:[(selectors at:activeMenuNumber) notNil]]]) ifTrue:[
+            self highlightActiveTitle.
+         ].
 
     subMenu notNil ifTrue:[
-	subMenu origin:((left + (self titleLenUpTo:aNumber)) 
-		       @
-		       (posY := height + subMenu borderWidth)).
-	subMenu hiddenOnRealize:false.
-	subMenu deselect.
-	subMenu create.
-	subMenu saveUnder:true.
-	subMenu superMenu:self.
+        subMenu origin:((left + (self titleLenUpTo:aNumber)) 
+                       @
+                       (posY := height + subMenu borderWidth)).
+        subMenu hiddenOnRealize:false.
+        subMenu deselect.
+        subMenu create.
+        subMenu saveUnder:true.
+        subMenu superMenu:self.
 
-	subMenu right > (r := self right) ifTrue:[
-	    subMenu origin:((r - subMenu width) @ posY).
-	].
-	subMenu raise show.
+        subMenu right > (r := self right) ifTrue:[
+            subMenu origin:((r - subMenu width) @ posY).
+        ].
+        subMenu raise show.
+
+        (styleSheet at:#pullDownMenuAutoselectFirst) == true ifTrue:[
+            subMenu selection:1
+        ]
     ].
     ^ subMenu
+
+    "Modified: 12.5.1996 / 16:38:10 / cg"
 !
 
 regainControl
@@ -1509,5 +1515,5 @@
 !PullDownMenu class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/PullDMenu.st,v 1.52 1996-05-08 23:21:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/PullDMenu.st,v 1.53 1996-05-12 14:39:02 cg Exp $'
 ! !
--- a/PullDownMenu.st	Sun May 12 16:33:36 1996 +0200
+++ b/PullDownMenu.st	Sun May 12 16:39:02 1996 +0200
@@ -1091,32 +1091,38 @@
     subMenu := menus at:aNumber.
 
     raiseTopWhenActivated ifTrue:[
-	self topView raise.
+        self topView raise.
     ].
 
     (activeMenuNumber notNil 
     and:[
-	 subMenu notNil
-	 or:[selectors notNil and:[(selectors at:activeMenuNumber) notNil]]]) ifTrue:[
-	    self highlightActiveTitle.
-	 ].
+         subMenu notNil
+         or:[selectors notNil and:[(selectors at:activeMenuNumber) notNil]]]) ifTrue:[
+            self highlightActiveTitle.
+         ].
 
     subMenu notNil ifTrue:[
-	subMenu origin:((left + (self titleLenUpTo:aNumber)) 
-		       @
-		       (posY := height + subMenu borderWidth)).
-	subMenu hiddenOnRealize:false.
-	subMenu deselect.
-	subMenu create.
-	subMenu saveUnder:true.
-	subMenu superMenu:self.
+        subMenu origin:((left + (self titleLenUpTo:aNumber)) 
+                       @
+                       (posY := height + subMenu borderWidth)).
+        subMenu hiddenOnRealize:false.
+        subMenu deselect.
+        subMenu create.
+        subMenu saveUnder:true.
+        subMenu superMenu:self.
 
-	subMenu right > (r := self right) ifTrue:[
-	    subMenu origin:((r - subMenu width) @ posY).
-	].
-	subMenu raise show.
+        subMenu right > (r := self right) ifTrue:[
+            subMenu origin:((r - subMenu width) @ posY).
+        ].
+        subMenu raise show.
+
+        (styleSheet at:#pullDownMenuAutoselectFirst) == true ifTrue:[
+            subMenu selection:1
+        ]
     ].
     ^ subMenu
+
+    "Modified: 12.5.1996 / 16:38:10 / cg"
 !
 
 regainControl
@@ -1509,5 +1515,5 @@
 !PullDownMenu class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/PullDownMenu.st,v 1.52 1996-05-08 23:21:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/PullDownMenu.st,v 1.53 1996-05-12 14:39:02 cg Exp $'
 ! !