original commit: 4441d853094ea25f2e0fb95208bc6a4a25968aa8
This commit is contained in:
Matthew Flatt 1998-07-09 20:12:30 +00:00
parent 82db08511e
commit ee9cc189a7
2 changed files with 42 additions and 36 deletions

View File

@ -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.

View File

@ -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