The Trunk: Morphic-mt.898.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-mt.898.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.898.mcz

==================== Summary ====================

Name: Morphic-mt.898
Author: mt
Time: 19 April 2015, 7:30:18.256 am
UUID: bc2e3dea-d6ae-0549-a1e9-b3671a4c0c32
Ancestors: Morphic-cmm.897

Fixed filter removal in lists to ask the model if it is okay to change because this action may cause a change in the list selection.

=============== Diff against Morphic-cmm.897 ===============

Item was changed:
+ ----- Method: PluggableListMorph>>removeFilter (in category 'filtering') -----
- ----- Method: PluggableListMorph>>removeFilter (in category 'model access') -----
  removeFilter
  lastKeystrokes := String empty.
  list := nil!

Item was changed:
  ----- Method: PluggableListMorph>>specialKeyPressed: (in category 'model access') -----
  specialKeyPressed: asciiValue
  "A special key with the given ascii-value was pressed; dispatch it"
  | oldSelection nextSelection max howManyItemsShowing |
  (#(8 13) includes: asciiValue) ifTrue:
  [ "backspace key - clear the filter, restore the list with the selection"
+ model okToChange ifFalse: [^ self].
  self removeFilter.
  priorSelection ifNotNil:
  [ | prior |
  prior := priorSelection.
  priorSelection := self getCurrentSelectionIndex.
  asciiValue = 8 ifTrue: [ self changeModelSelection: prior ] ].
  ^ self updateList ].
  asciiValue = 27 ifTrue:
  [" escape key"
  ^ ActiveEvent shiftPressed
  ifTrue:
  [ActiveWorld putUpWorldMenuFromEscapeKey]
  ifFalse:
  [self yellowButtonActivity: false]].
 
  max := self maximumSelection.
  max > 0 ifFalse: [^ self].
  nextSelection := oldSelection := self selectionIndex.
  asciiValue = 31 ifTrue:
  [" down arrow"
  nextSelection := oldSelection + 1.
  nextSelection > max ifTrue: [nextSelection := 1]].
  asciiValue = 30 ifTrue:
  [" up arrow"
  nextSelection := oldSelection - 1.
  nextSelection < 1 ifTrue: [nextSelection := max]].
  asciiValue = 1 ifTrue:
  [" home"
  nextSelection := 1].
  asciiValue = 4 ifTrue:
  [" end"
  nextSelection := max].
  howManyItemsShowing := self numSelectionsInView.
  asciiValue = 11 ifTrue:
  [" page up"
  nextSelection := 1 max: oldSelection - howManyItemsShowing].
  asciiValue = 12 ifTrue:
  [" page down"
  nextSelection := oldSelection + howManyItemsShowing min: max].
  model okToChange ifFalse: [^ self].
  "No change if model is locked"
  oldSelection = nextSelection ifTrue: [^ self flash].
  ^ self changeModelSelection: (self modelIndexFor: nextSelection)!