class: PullDownMenu stable
authorClaus Gittinger <cg@exept.de>
Mon, 26 Aug 2013 15:13:01 +0200
changeset 4678 7b9d701d947b
parent 4677 67285ce170f9
child 4679 3ee68f0d9e4e
class: PullDownMenu comment/format in: #documentation changed: #add:selector:after: #add:selector:before:
PullDownMenu.st
--- a/PullDownMenu.st	Mon Aug 26 11:24:53 2013 +0200
+++ b/PullDownMenu.st	Mon Aug 26 15:13:01 2013 +0200
@@ -44,9 +44,9 @@
 
 documentation
 "
-    Notice: this class is obsolete now - please use a MenuPanel
-    in new applications, which provides all of this functionality,
-    plus more.
+    Notice: this class is obsolete now 
+    - please use a MenuPanel in new applications, 
+    which provides all of this functionality, plus more and a nicer look.
 
     PullDown menu provides the top (always visible) part of these menus. 
     It controls display of its menus, which become visible when one of the 
@@ -449,23 +449,23 @@
     |idx|
 
     indexOrString isNil ifTrue:[
-	idx := titles size
+        idx := titles size
     ] ifFalse:[
-	idx := self indexOf:indexOrString.
+        idx := self indexOf:indexOrString.
     ].
 
     titles isNil ifTrue:[
-	menus := Array with:nil.
-	titles := Array with:label.
-	selectors := Array with:selector.
+        menus := Array with:nil.
+        titles := Array with:label.
+        selectors := Array with:selector.
     ] ifFalse:[
-	menus := (menus copyTo:idx) , #(nil) , (menus copyFrom:idx+1).
-	titles := ((titles copyTo:idx) copyWith:label) , (titles copyFrom:idx+1).
-	selectors := ((selectors copyTo:idx) copyWith:selector) , (selectors copyFrom:idx+1).
+        menus := menus copyWith:nil insertedAfterIndex:idx.
+        titles := titles copyWith:label insertedAfterIndex:idx.
+        selectors := selectors copyWith:selector insertedAfterIndex:idx.
     ].
 
     shown ifTrue:[
-	self redraw
+        self redraw
     ]
 
     "
@@ -478,8 +478,8 @@
 
      m add:'help' selector:#help after:#file.
      m at:#help putMenu:(MenuView labels:#('foo' 'bar')
-			       selectors:#(foo bar)
-				receiver:nil).
+                               selectors:#(foo bar)
+                                receiver:nil).
 
      top open
     "
@@ -496,23 +496,23 @@
     |idx|
 
     indexOrString isNil ifTrue:[
-	idx := 1
+        idx := 1
     ] ifFalse:[
-	idx := self indexOf:indexOrString.
+        idx := self indexOf:indexOrString.
     ].
 
     titles isNil ifTrue:[
-	menus := Array with:nil.
-	titles := Array with:label.
-	selectors := Array with:selector.
+        menus := Array with:nil.
+        titles := Array with:label.
+        selectors := Array with:selector.
     ] ifFalse:[
-	menus := (menus copyTo:idx-1) , #(nil) , (menus copyFrom:idx).
-	titles := ((titles copyTo:idx-1) copyWith:label) , (titles copyFrom:idx).
-	selectors := ((selectors copyTo:idx-1) copyWith:selector) , (selectors copyFrom:idx).
+        menus := menus copyWith:nil insertedAfterIndex:idx-1.
+        titles := titles copyWith:label insertedAfterIndex:idx-1.
+        selectors := selectors copyWith:selector insertedAfterIndex:idx-1.
     ].
 
     shown ifTrue:[
-	self redraw
+        self redraw
     ]
 
     "
@@ -525,13 +525,13 @@
 
      m add:'help' selector:#help before:#edit.
      m at:#help putMenu:(MenuView labels:#('foo' 'bar')
-			       selectors:#(foo bar)
-				receiver:nil).
+                               selectors:#(foo bar)
+                                receiver:nil).
 
      m add:'foo' selector:#foo before:nil.
      m at:#foo putMenu:(MenuView labels:#('foo1' 'foo2')
-			       selectors:#(foo1 foo2)
-				receiver:nil).
+                               selectors:#(foo1 foo2)
+                                receiver:nil).
 
      top open
     "
@@ -1814,9 +1814,10 @@
 !PullDownMenu class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/PullDownMenu.st,v 1.106 2011-10-05 14:13:41 az Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/PullDownMenu.st,v 1.107 2013-08-26 13:13:01 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/PullDownMenu.st,v 1.106 2011-10-05 14:13:41 az Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/PullDownMenu.st,v 1.107 2013-08-26 13:13:01 cg Exp $'
 ! !
+