DSVColumnView.st
changeset 5717 30b609979318
parent 5709 06971867c02d
child 5718 a3083ed0c1b8
equal deleted inserted replaced
5716:aa0c8adb8c29 5717:30b609979318
  4869     self selectionChanged:nil
  4869     self selectionChanged:nil
  4870 !
  4870 !
  4871 
  4871 
  4872 selectionChanged:colNrOrNil
  4872 selectionChanged:colNrOrNil
  4873     "selection has changed"
  4873     "selection has changed"
  4874     
  4874 
  4875     |val|
  4875     |val|
  4876 
  4876 
  4877     model notNil ifTrue:[
  4877     model notNil ifTrue:[
  4878         val := self selectedRowIndex copy.
  4878         val := self selectedRowIndex copy.
  4879         (model respondsTo:#selectionIndex:) ifTrue:[
  4879         (model respondsTo:#selectionIndex:) ifTrue:[
  4880             model selectionIndex:val
  4880             model selectionIndex:val
  4881         ] ifFalse:[
  4881         ] ifFalse:[
  4882             |newVal|
  4882             |newVal|
  4883 
  4883 
  4884             newVal := (useIndex ifTrue:[val] ifFalse:[self selectedRow]).
  4884             newVal := (useIndex ifTrue:[val] ifFalse:[self selectedRow]).
       
  4885 
       
  4886             (multipleSelectOk and:[newVal isNil]) ifTrue:[ "/ see selectedRow - answer nil for nothing selected
       
  4887                 newVal := OrderedCollection new.
       
  4888             ].
  4885             "/ must check here: valueHolder compares using identity to identify
  4889             "/ must check here: valueHolder compares using identity to identify
  4886             "/ changes. This would lead to an endless recursion....
  4890             "/ changes. This would lead to an endless recursion....
  4887             model value ~= newVal ifTrue:[
  4891             model value ~= newVal ifTrue:[
  4888                 model value:newVal
  4892                 model value:newVal
  4889             ]
  4893             ]
  4894             actionBlock valueWithOptionalArgument:(self selectedRowIndex)
  4898             actionBlock valueWithOptionalArgument:(self selectedRowIndex)
  4895         ] ifFalse:[
  4899         ] ifFalse:[
  4896             actionBlock valueWithOptionalArgument:(self selectedRowIndex) and:colNrOrNil
  4900             actionBlock valueWithOptionalArgument:(self selectedRowIndex) and:colNrOrNil
  4897         ].
  4901         ].
  4898     ]
  4902     ]
       
  4903 
       
  4904     "Modified: / 08-03-2018 / 14:27:36 / mawalch"
  4899 !
  4905 !
  4900 
  4906 
  4901 selectionIndicesDo:aOneArgBlock 
  4907 selectionIndicesDo:aOneArgBlock 
  4902     "evaluate block on each row selected; the argument to the row
  4908     "evaluate block on each row selected; the argument to the row
  4903      is the index of the selected row"
  4909      is the index of the selected row"