MultiSelectionInList.st
changeset 2724 23f4e16dc4f4
parent 1413 e00159f1414d
child 3847 bb36b6a3fc7c
equal deleted inserted replaced
2723:8c910a099160 2724:23f4e16dc4f4
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
       
    12 
       
    13 "{ Package: 'stx:libwidg' }"
    12 
    14 
    13 SelectionInList subclass:#MultiSelectionInList
    15 SelectionInList subclass:#MultiSelectionInList
    14 	instanceVariableNames:''
    16 	instanceVariableNames:''
    15 	classVariableNames:''
    17 	classVariableNames:''
    16 	poolDictionaries:''
    18 	poolDictionaries:''
    97     "Created: 26.10.1995 / 16:40:24 / cg"
    99     "Created: 26.10.1995 / 16:40:24 / cg"
    98     "Modified: 25.4.1996 / 09:07:44 / cg"
   100     "Modified: 25.4.1996 / 09:07:44 / cg"
    99 !
   101 !
   100 
   102 
   101 selectionIndex:indexes
   103 selectionIndex:indexes
   102     "set list of indexes
   104     "set the list of indexes"
   103     "
   105 
       
   106     |newIndices|
       
   107 
   104     indexes size ~~ 0 ifTrue:[
   108     indexes size ~~ 0 ifTrue:[
   105         ^ super selectionIndex:indexes
   109         newIndices := indexes.
   106     ].
   110     ] ifFalse:[
   107 
   111         indexes isNumber ifTrue:[
   108     (indexes isCollection or:[indexes isNil]) ifTrue:[
   112             newIndices := OrderedCollection with:indexes    
   109         ^ super selectionIndex:#()
   113         ] ifFalse:[
   110     ].
   114             newIndices := #()
   111   ^ super selectionIndex:(OrderedCollection with:indexes)
   115         ].
       
   116     ].
       
   117     ^ super selectionIndex:newIndices
   112 !
   118 !
   113 
   119 
   114 selectionIndexes
   120 selectionIndexes
   115     "added for ST-80 compatibility
   121     "added for ST-80 compatibility
   116     "
   122     "
   190 ! !
   196 ! !
   191 
   197 
   192 !MultiSelectionInList class methodsFor:'documentation'!
   198 !MultiSelectionInList class methodsFor:'documentation'!
   193 
   199 
   194 version
   200 version
   195     ^ '$Header: /cvs/stx/stx/libwidg/MultiSelectionInList.st,v 1.16 1998-01-14 15:17:01 ca Exp $'
   201     ^ '$Header: /cvs/stx/stx/libwidg/MultiSelectionInList.st,v 1.17 2003-04-02 16:27:31 cg Exp $'
   196 ! !
   202 ! !