The listbox control has a Selectiontype property which can be set to Mutiple. This works fine but you need the Ctrl button to select the second row. On a touchscreen this is going to be a thing. Does anybody know the trick how to do this ?
@Joost Rongen The SelectionType does not change much in the ListBox’s behavior because YOU are responsible for creating/using the list of selected items using “selected( row )”.
About the GUI, on my iPad, I usually need to do some action before I can select multiple items (like clicking on the Modify button). Then every click is interpreted as either selecting or deselecting a row.
Of course, I did so. But the trouble is, when you tap on a row (touchscreen) , the listbox first deselects the previously selected row(s) and selects the one you tapped on. The Change event fires afterwards. In the Change event you can re-select all other rows via code again, but you will see this proces as a lumpy behavior.
Using the WebListbox you can simply use the CellClick event which works fine for multirow selection on a touchscreen.
But, I still haven’t found a good looking solution for the Listbox control on desktop.
in mousedown get the row (fromXY) that was tapped, then you should be able to set the old and new row trough code
Se the return value appropriately
dim p1(-1) as integer //the listitems to select
dim p2 as integer = 1 //are we selecting multiple records right now?
if p2=1 then
p1.Append(me.ListIndex) //add the current item to the array of rows to be selected
if p1.Ubound=0 then //if there are no other rows to be sel. then this must be number 1
//do nothing... we have our first selection
else
for i as integer = 0 to p1.Ubound //from the first item to select to the last item
lb.Selected(p1(i))=true //select that row...
next //if nothing else move along, otherwise, go through it again
end
end
there. lol
Hi Robert, this is was my first thought was so I implemented it. Looks very lumpy to the user. We select rows by code which got deselected by the click event, so you will notice the re-selection of the rows. Functional it works fine, the experience is for the user is just not so professional.
what kind of touchscreen is this you are using? Raspberry pi?
If so you could map keys to multitouch.
The absence of right-click is the root of most of my gripes about touchscreen/ ipad use.
Its such a useful thing to be able to get options.
Just a presentation screen on the wall, OS = Win10
As said, functional it’s working ok. The look and feel is anything but perfect.
I am afraid the enduser has to accept as long as I use the xojo listbox here.
[quote=469202:@Joost Rongen]Just a presentation screen on the wall, OS = Win10
As said, functional it’s working ok. The look and feel is anything but perfect.
I am afraid the enduser has to accept as long as I use the xojo listbox here.[/quote]
I think there is a way to do this, i may have to look into it.
No time for coding today.
Thanks Derk.
Joh ? No worries.
And you cannot ask Windows 10 to display the keyboard on screen ?
No - since the app is actually a dashboard.
Sorry.
[quote=469205:@Joost Rongen]Thanks Derk.
Joh ? No worries.[/quote]
No coding but here’s a probability:
In this event:
http://documentation.xojo.com/api/deprecated/listbox.html#listbox-cellclick
Set the selection of the row from the event and return true.
By returning true the listbox should keep it’s current selection as the docs say.
Me.Selected(row) = True
Return True
That should do it
You could add an extra column, and format the new cell as a checkbox.
That allows the user to ‘check’ the rows they want to operate upon.
[quote=469215:@Derk Jochems]No coding but here’s a probability:
In this event:
http://documentation.xojo.com/api/deprecated/listbox.html#listbox-cellclick
Set the selection of the row from the event and return true.
By returning true the listbox should keep it’s current selection as the docs say.
Me.Selected(row) = True
Return True
That should do it[/quote]
@Joost Rongen did you try this ?
Yes I did, and would expect this to be working but it doesn’t work out as expected.
If you try to select a row in between two selected rows, it selects a complete wrong row and if click on a selected row, it get’s the wrong row too. Did not have the time to do further research on this behavior related to the expected behavior.
For now, I give up with this, too time consuming…Hope the user will accept the functional working multiselection listbox I delivered here.
Hm. That’s probably a bug. Let’s see when there’s time to test