diff options
author | Nils Gey <denemo@nilsgey.de> | 2011-02-14 01:27:33 +0100 |
---|---|---|
committer | Nils Gey <denemo@nilsgey.de> | 2011-02-14 01:27:33 +0100 |
commit | 4dcf77b06a8b5458b040bb698df2c9bdf8e32ce1 (patch) | |
tree | d2a40d4912b0e1e442851a0eb7b7726c2f3063e2 | |
parent | 7b7c376c55eef6fca361d621c3820d86e5f13f7b (diff) |
Better NextSelectedObjectAllStaffs
-rw-r--r-- | actions/denemo.scm | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/actions/denemo.scm b/actions/denemo.scm index 5cdadaaa..ee041bc2 100644 --- a/actions/denemo.scm +++ b/actions/denemo.scm @@ -150,18 +150,20 @@ (list-ref (reverse (string-tokenize(d-GetNotes))) 0) #f)) -;Next Selected Object for all Staffs by Nils Gey Feb/2010 -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;Moves the cursor to the right. If there is no selection, If that returns #f it will move down one staff and rewind to the start of the selection in this staff.. -;TODO: After the last selected Item the cursor will move down one staff even outside the selection and will stay there. But a script with SingleAndSelectionSwitcher will NOT be applied to this outside-object and the user will not see this because the cursor is returned to the starting position afterwards. +;Next object in selection for all staffs (define (NextSelectedObjectAllStaffs) - (if (not (d-NextSelectedObject)) - (if (and (d-MoveToStaffDown) (d-IsInSelection)) - (selection::MoveToStaffBeginning) ; there is a selection a staff down, loop to the beginning - #f ; there is no staff down or the selection is single staff. - ) - #t)) ;NextSelecetedObject was succesful + (define remember 1) + (if (and (d-MarkStatus) (d-IsInSelection)) + (if (d-NextSelectedObject) + #t ; found one. End + (begin (set! remember (d-GetHorizontalPosition)) ; check one staff down and if there is a selection. + (if (d-MoveToStaffDown) + (if (selection::MoveToStaffBeginning) + #t ; found a selection in the lower staff + (begin (d-GoToPosition #f (- (d-GetStaff) 1) #f remember) #f)) ; reset cursor to the last known selection position + #f))) ; no staff below + #f)); no selection or cursor not in selection |