move columns up or down
authorca
Wed, 10 Jun 2009 17:20:46 +0200
changeset 2558 1acb2765094d
parent 2557 befc1c216287
child 2559 04b2605a66b2
move columns up or down
DataSetBuilder.st
--- a/DataSetBuilder.st	Wed Jun 10 15:25:54 2009 +0200
+++ b/DataSetBuilder.st	Wed Jun 10 17:20:46 2009 +0200
@@ -4156,14 +4156,17 @@
 doMoveColumn:upOrDown
     "move selected column up or down"
 
-    |idx list label col size|
+    |idx list label col size tabIndex|
 
     (idx := self singleSelectedColumnIndex) == 0 ifTrue:[^self].
     list := self seqList.
     size := list size.
 
-    size == 1 ifTrue:[^self].
+    size > 1 ifFalse:[ ^ self ].
+
     selectedColumnIndex := 0.
+    tabIndex := self tabModel value.
+
     label := list at:idx.
     col   := columns at:idx.
     list    removeIndex:idx.
@@ -4177,9 +4180,12 @@
                    ifFalse:[idx := idx + 1]
     ].
     columns add:col   beforeIndex:idx.
-    list    add:label beforeIndex:idx.  
+    list    add:label beforeIndex:idx.
+
     self selectedColumnModel value:idx.
     self updateColumnView.
+    self tabModel value:tabIndex.
+
     self setModified.
 !