diff --git a/collects/tests/mred/choice-list-steps.txt b/collects/tests/mred/choice-list-steps.txt index 633cc0af..18abe4f4 100644 --- a/collects/tests/mred/choice-list-steps.txt +++ b/collects/tests/mred/choice-list-steps.txt @@ -194,37 +194,46 @@ Click "Check" and inspect the item list in the console. Multiple Selections >> Multiple-Selection Lists Only << ------------------- -Click on each of the three items and make sure that "Selected N" - and "Callback Ok" are printed in the console. (For most platforms - selecting an item deselects the other items, but some platforms - preserve the old selections. That's ok.) +Click on each of the three items and make sure that "Changed" + and "Callback Ok" are printed in the console: -Click "Check" and verify the item list *and* the selection list. Only - one item should be selected, and the only position of that item - (counting from 0) should be in the selection list. + * For regular MultiLists, each click should unhilite the + old selection as it hilites the new one + + * For MultiExtendLists, each click should extend the + selection. + +Click on a selected item to make sure "Changed" is printed again. + +Click "Check" and verify the item list *and* the selection list. + (Remember that the items are numbered from 0). + +Clear the selection except for one item, somehow. (You may need to use + the Ctl key) Use the shift key to select a second item. The console should show - "Selected N" and "Callback Ok" as usual. + "Changed" and "Callback Ok" as usual. Click "Check" and verify that the selection list now has the right two items. -Shift-click on a selected item. The console should show "Selected N" +Shift-click on a selected item. The console should show "Changed" and "Callback Ok" as usual. Shift-click to select the remaining item. The console should show - "Selected N" and "Callback Ok" as usual. + "Changed" and "Callback Ok" as usual. Control-click on a selected item. It should become unselected (and the other two selected items should remain so). The console should report - "Deselected N" and "Callback Ok". + "Changed" and "Callback Ok". Click "Check" and verify the selection list. -... +Try the "Select N" buttons. They should always extend the selection. -Simulate should act like clicking, either extending the selection or - restarting it. +Try the "by Simulate" buttons; they should should act like clicking, + either extending the selection or restarting it. -Drag and make sure each selection/desel causes a notification. +Try dragging (and shift-dragging and ctl-dragging) and make sure the + console reports are appropriate. diff --git a/collects/tests/mred/item.ss b/collects/tests/mred/item.ss index e75ae9a5..97a5b382 100644 --- a/collects/tests/mred/item.ss +++ b/collects/tests/mred/item.ss @@ -917,26 +917,7 @@ (send e get-command-string)) old-list)) (cond - [(= 0 (send e get-extra-long)) - ; deselection - (printf "Deselected ~a~n" (send e get-command-int)) - (unless multi? - (error "delselection in a single-selection list")) - (unless (< -1 (send e get-command-int) (length actual-content)) - (error "deselection index is out of range")) - (unless (not (memv (send e get-command-int) (send c get-selections))) - (error "deselected item is actually selected")) - (unless (string=? (send e get-command-string) - (send c get-string (send e get-command-int))) - (error "string selection mismatch:" (send e get-command-string)))] - [(= 2 (send e get-extra-long)) - ; double-click - (unless (= -1 (send e get-command-int)) - (error "selection index is not -1")) - (unless (null? (send e get-command-string)) - (error "string selection not null:" (send e get-command-string))) - (printf "Double-click~n")] - [else + [(send e is-selection?) ; selection (printf "Selected ~a~n" (send e get-command-int)) (if (or (not multi?) (<= (length (send c get-selections)) 1)) @@ -956,7 +937,23 @@ (send c get-string (send e get-command-int))) (error "selection string mismatch")) (unless (null? (send c get-string-selection)) - (error "string selection not null"))))]) + (error "string selection not null"))))] + [(send e is-double-click?) + ; double-click + (unless (= -1 (send e get-command-int)) + (error "selection index is not -1")) + (unless (null? (send e get-command-string)) + (error "string selection not null:" (send e get-command-string))) + (printf "Double-click~n")] + [else + ; misc multi-selection + (printf "Changed~n") + (unless multi? + (error "unknown event for a single-selection list")) + (unless (= -1 (send e get-selection)) + (error "selection is not -1")) + (unless (null? (send e get-string)) + (error "string selection is not null:" (send e get-string)))]) (check-callback-event c cx e commands #f))) (define c (if list? (make-object mred:list-box% p