The Trunk: Morphic-topa.1092.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-topa.1092.mcz

commits-2
Tobias Pape uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-topa.1092.mcz

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

Name: Morphic-topa.1092
Author: topa
Time: 2 March 2016, 12:47:32.674693 am
UUID: c9c63a6f-3d27-472a-bb9d-b51d1f3eb218
Ancestors: Morphic-topa.1091

Adopt Tree (up/down/home/pg up/pg down) key handling to be more similar to List key handling.

=============== Diff against Morphic-topa.1091 ===============

Item was changed:
  ----- Method: SimpleHierarchicalListMorph>>arrowKey: (in category 'keyboard navigation') -----
  arrowKey: asciiValue
  "Handle a keyboard navigation character. Answer true if handled, false if not."
+ | keyEvent max oldSelection nextSelection howManyItemsShowing |
- | keyEvent |
  keyEvent := asciiValue.
+ max := self maximumSelection.
+ nextSelection := oldSelection := self getSelectionIndex.
       keyEvent = 31 ifTrue:["down"
+ nextSelection :=oldSelection + 1.
+ nextSelection > max ifTrue: [nextSelection := 1]].
- self setSelectionIndex: self getSelectionIndex+1.
- ^true].
       keyEvent = 30 ifTrue:["up"
+ nextSelection := oldSelection - 1.
+ nextSelection < 1 ifTrue: [nextSelection := max]].
- self setSelectionIndex: (self getSelectionIndex-1 max: 1).
- ^true].
       keyEvent = 1  ifTrue: ["home"
+ nextSelection := 1].
- self setSelectionIndex: 1.
- ^true].
       keyEvent = 4  ifTrue: ["end"
+ nextSelection := max].
+ howManyItemsShowing := self numSelectionsInView.
- self setSelectionIndex: scroller submorphs size.
- ^true].
        keyEvent = 11 ifTrue: ["page up"
+ nextSelection := 1 max: oldSelection - howManyItemsShowing].
- self setSelectionIndex: (self getSelectionIndex - self numSelectionsInView max: 1).
- ^true].
       keyEvent = 12  ifTrue: ["page down"
+ nextSelection := oldSelection + howManyItemsShowing min: max].
+
+ nextSelection = oldSelection ifFalse: [
+ self setSelectionIndex: nextSelection.
+ ^ true].
+
- self setSelectionIndex: self getSelectionIndex + self numSelectionsInView.
- ^true].
  keyEvent = 29 ifTrue:["right"
  selectedMorph ifNotNil:[
  (selectedMorph canExpand and:[selectedMorph isExpanded not])
  ifTrue:[self toggleExpandedState: selectedMorph]
  ifFalse:[self setSelectionIndex: self getSelectionIndex+1].
  ].
  ^true].
  keyEvent = 28 ifTrue:["left"
  selectedMorph ifNotNil:[
  (selectedMorph isExpanded)
  ifTrue:[self toggleExpandedState: selectedMorph]
  ifFalse:[self setSelectionIndex: (self getSelectionIndex-1 max: 1)].
  ].
  ^true].
  ^false!