Listbox - Multiple Checkboxes, but NOT multiple Selections

I have a listbox, where only ONE record can be “active” [selected] at a time… BUT I need the ability to set (or reset) the checkboxes on multiple rows at once.

Anyone have a way to do this that is intuitive to the user?

[quote=470517:@Dave S]I have a listbox, where only ONE record can be “active” [selected] at a time… BUT I need the ability to set (or reset) the checkboxes on multiple rows at once.

Anyone have a way to do this that is intuitive to the user?[/quote]

IIRC If you click directly on the checkbox the row is not selected… If not If you put it in it’s own column you cam make that happen for a click anywhere in that column if you want Or in the first 20 pixels.

  • karen

You misunderstand Karen… I want the user to be able to set/reset the checkbox on muliple rows without having to click each check box.

I had thought I would check how many rows the user had selected and if more than ONE I would alter the checkboxes in those that were selected, and then unselect them… .However there is no way to tell when the user have finished selecting a range of rows. using MouseDown/Up is not an option, since UP won’t fire unless DOWN returns TRUE and if DOWN returns TRUE nothing can be selected :frowning:

[quote=470524:@Dave S]You misunderstand Karen… I want the user to be able to set/reset the checkbox on muliple rows without having to click each check box.

I had thought I would check how many rows the user had selected and if more than ONE I would alter the checkboxes in those that were selected, and then unselect them… .However there is no way to tell when the user have finished selecting a range of rows. using MouseDown/Up is not an option, since UP won’t fire unless DOWN returns TRUE and if DOWN returns TRUE nothing can be selected :([/quote]

Timer checking if the shift or control key is still down?

-Karen

Dave, I not sure I understand… It seems as though this is a “radio button” problem “where only ONE record can be “active” [selected] at a time”. ( I presume that having a checkbox checked is the same as being “active” and being selected )

[quote=470517:@Dave S]
I have a listbox, where only ONE record can be “active” [selected] at a time[/quote]
Did you mean that only one record can be “active” or that only one record should be “active”? In the former case, it is not clear how the user could get into the state of having multiple selections? Radio buttons would, of course, prevent the user from making multiple selections.

I asked a question the other day in the Getting Started forum about CheckBoxes as a tri-state control. Maybe you could use the “indeterminate” state of checkboxes in some way? If your views can be formulated as a sort of “tree view”, then the “indeterminate” state may be of use.

I want no more than one record that is considered “selected”, but I want/need to be able to select any range of rows and set their checkbox.

Consider this. the “selected/active” record is the one available for the user to edit (its an Address), only one address can be in edit mode at any one time. The checkboxes determine what records are available for a “batch” process. This could be to delete the records, print the records or transfer them from one list to another.

So its kind of like inverting what a listbox considers “checking the box” vs selecting a range

Do it like windows explorer does, if you select the row (not on the checkbox) it selects the row, if you select on the checkbox it checks the box and selects the row which you can repeatedly do until you click on just a row (not on a checkbox) which clears all checks and selects the current row.

If you want to try this, turn on “item check boxes” in explorer under the view tab.

Thanks… but again… I don’t want the user to have to click on EACH row. You can select groups or random rows using Shift/Alt.

What I have decided to do is if the user SELECTS more than one row, the edit window goes away, and a menu of options appears…

And Julian, no offsense, but I avoid WINDOWS as much as I can… using it on those rare (very) where I need to test an app,

Ah right I thought you wanted something different because multi selecting with key modifiers is standard (at least on Windows).

Don’t forget that multi select on lists acts differently between Mac/Windows if you’re planning cross platform.

you can shift click IF you allow multiple selection in the listbox itself
otherwise you can only select one row at a time

you cant allow both at the same time
unless MAYBE if when you detect mousedown you check if the shift key is down as well and alter the selection mode to multiple and then change it back sometime later
thats the only way I can think of that a Xojo listbox would allow this behaviour

*I’ve never coded one to do this but it seems sort of plausible you could

Hey Dave
How about putting a one column additional listbox with checkboxes in every row next to your main listbox (and scroll synced)? That way the user will have one row selected on the main listbox but many rows selected on the other.
Then it’s just a matter of checking the checboxes on the additional listbox to see what’s selected.

Thanks… I found an alternative approach to get the required data…

After that thread, it could be nice for posters and readers to explain how you solved the issue.

by alternative[quote=470586:@Michel Bujardet]After that thread, it could be nice for posters and readers to explain how you solved the issue.[/quote]
see 6 postings above

I see. You ask for assistance. Why refuse to explain what solution you applied ?

I am not refusing to explain… but the solution I decided upon has nothing to do with the original question I asked. It is an alternative work-around, not a method to do the actions in the original question.

Moreover, he DID say what he ended up doing. But when you asked he said “see 6 postings above” but did not also repeat:

EDIT: I see Dave has now ammended his answer to repeat that as well.