2150 super buttonPress:button x:x y:y. |
2150 super buttonPress:button x:x y:y. |
2151 ^ self |
2151 ^ self |
2152 ]. |
2152 ]. |
2153 |
2153 |
2154 (self isRowSelectable:rowNr) ifFalse:[^ self ]. |
2154 (self isRowSelectable:rowNr) ifFalse:[^ self ]. |
|
2155 |
|
2156 clickedIntoSelection := self isInSelection:rowNr. |
2155 |
2157 |
2156 sensor shiftDown ifTrue:[ |
2158 sensor shiftDown ifTrue:[ |
2157 (multipleSelectOk and:[selectedRowIndex size ~~ 0]) ifTrue:[ |
2159 (multipleSelectOk and:[selectedRowIndex size ~~ 0]) ifTrue:[ |
2158 self selectRowFrom:(selectedRowIndex min min:rowNr) |
2160 self selectRowFrom:(selectedRowIndex min min:rowNr) |
2159 to:(selectedRowIndex max max:rowNr). |
2161 to:(selectedRowIndex max max:rowNr). |
2164 ]. |
2166 ]. |
2165 |
2167 |
2166 sensor ctrlDown ifTrue:[ |
2168 sensor ctrlDown ifTrue:[ |
2167 self buttonControlPressAtRowNr:rowNr. |
2169 self buttonControlPressAtRowNr:rowNr. |
2168 "/ ^ self |
2170 "/ ^ self |
2169 ]. |
2171 ] ifFalse:[ |
2170 |
|
2171 sensor ctrlDown ifFalse:[ |
|
2172 "/ self withWaitCursorDo:[ |
|
2173 (self isInSelection:rowNr) ifTrue:[ |
2172 (self isInSelection:rowNr) ifTrue:[ |
2174 buttonReleaseAction := |
2173 buttonReleaseAction := |
2175 [ |
2174 [ |
2176 self selectRowAt:rowNr colAt:colNr atPoint:clickPoint. |
2175 self selectRowAt:rowNr colAt:colNr atPoint:clickPoint. |
2177 ] |
2176 ] |
2178 ] ifFalse:[ |
2177 ] ifFalse:[ |
2179 self selectRowAt:rowNr colAt:colNr atPoint:clickPoint. |
2178 self selectRowAt:rowNr colAt:colNr atPoint:clickPoint. |
2180 ] |
2179 ] |
2181 ]. |
2180 ]. |
2182 |
2181 |
|
2182 clickedIntoSelection ifTrue:[ |
|
2183 buttonMotionAction := [:p| |
|
2184 self canDrag ifTrue:[ |
|
2185 (((p x dist:clickPoint x) > (UserPreferences current motionDistanceToStartDrag)) |
|
2186 or:[p x < -5 or:[p x > (width+5)]]) ifTrue:[ |
|
2187 buttonReleaseAction := buttonMotionAction := nil. |
|
2188 self startDragAt:p |
|
2189 ] |
|
2190 ]. |
|
2191 ]. |
|
2192 ^ self. |
|
2193 ]. |
|
2194 |
2183 buttonMotionAction := [:p| |
2195 buttonMotionAction := [:p| |
2184 |r2| |
2196 |r2| |
2185 |
2197 |
2186 "/ cg: disabled: I dont want to loose the selection when starting |
2198 (self bounds containsPoint:p) ifTrue:[ |
2187 "/ a drag. |
2199 multipleSelectOk ifTrue:[ |
2188 "/ (self bounds containsPoint:p) ifTrue:[ |
2200 r2 := self yVisibleToRowNr:(p y). |
2189 "/ multipleSelectOk ifTrue:[ |
2201 r2 notNil ifTrue:[ |
2190 "/ r2 := self yVisibleToRowNr:(p y). |
|
2191 "/ r2 notNil ifTrue:[ |
|
2192 "/ r2 ~~ self lastIndexSelected ifTrue:[ |
2202 "/ r2 ~~ self lastIndexSelected ifTrue:[ |
2193 "/ self selectRowFrom:firstRowNr to:r2. |
2203 self selectRowFrom:firstRowNr to:r2. |
2194 "/ clickPoint := p. |
2204 clickPoint := p. |
2195 "/ ]. |
2205 "/ ]. |
2196 "/ ]. |
2206 ]. |
2197 "/ ]. |
2207 ]. |
2198 "/ ]. |
2208 ]. |
2199 |
2209 |
2200 self canDrag ifTrue:[ |
2210 self canDrag ifTrue:[ |
2201 (((p x dist:clickPoint x) > (UserPreferences current motionDistanceToStartDrag)) |
2211 (((p x dist:clickPoint x) > (UserPreferences current motionDistanceToStartDrag)) |
2202 or:[p x < -5 or:[p x > (width+5)]]) ifTrue:[ |
2212 or:[p x < -5 or:[p x > (width+5)]]) ifTrue:[ |
2203 buttonReleaseAction := buttonMotionAction := nil. |
2213 buttonReleaseAction := buttonMotionAction := nil. |
2204 self startDragAt:p |
2214 self startDragAt:p |
2205 ] |
2215 ] |
2206 ]. |
2216 ]. |
2207 ]. |
2217 ]. |
2208 |
|
2209 "/ (multipleSelectOk and:[selectedColIndex == 0 and:[selectedRowIndex size == 1]]) ifTrue:[ |
|
2210 "/ buttonMotionAction := [:p| |
|
2211 "/ |r| |
|
2212 "/ |
|
2213 "/ (self bounds contains:p) ifFalse:[ |
|
2214 "/ buttonReleaseAction := buttonMotionAction := nil. |
|
2215 "/ self startDragAt:p. |
|
2216 "/ ^ self. |
|
2217 "/ ]. |
|
2218 "/ r := self yVisibleToRowNr:(p y). |
|
2219 "/ r notNil ifTrue:[ self selectRowFrom:rowNr to:r ]. |
|
2220 "/ ] |
|
2221 "/ ]. |
|
2222 ! |
2218 ! |
2223 |
2219 |
2224 buttonRelease:button x:x y:y |
2220 buttonRelease:button x:x y:y |
2225 |
2221 |
2226 buttonMotionAction := nil. |
2222 buttonMotionAction := nil. |