More notifications for ListView class (please)

Discuss GUI programming with the MUI Royale plugin here
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

More notifications for ListView class (please)

Post by lazi »

Hello Queens and Kings of MUIRoyale! :)

It is a follow up of my listview sorting madness.
So there is a huge list and I want to display it the most convinient way for the user perspective.
Today I made a very nice approach of the problem:
Put the data to an SQLite database and display only just the visible rows of a query of the database.
It gives extreme flexibility on sorted, filtered data.

The gui part contains a listview with scrollerpos="none", a scrollbar and a string gadget.
The scrollbar sets the LIMIT and OFFSET part of the SELECT sql query and the string gadget sets the LIKE option.

Now the problems:

1.
When the listview's visible lines are changes, the query should be changed too, but MUIRoyale has no notification for this.
It is already discussed before here: viewtopic.php?f=27&t=2038&p=10646&hilit ... ize#p10660

The workaround is to display a minimal hollywood display and get the SizeWindow event from there.

2.
This custom listview can't be controlled with the mouse and the keyboard because there is no notifications for moving the list without
changing selection. I can't find any workaround this. Acceleration class of RapaGUI could solve the keyboard handling, but the mousewheel for a listview is so essential that can't be leave unworkable.

If these notifications can be added to a future MUIRoyale that will be make a very powerful combo of SQLite and the GUI.

Here is a small and crap video that shows the thing: https://youtu.be/GuEB_e9mxxM
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Re: More notifications for ListView class (please)

Post by lazi »

Just tried to figure out MUI event/notify system on the MUI developer documentation. To be honest I am still do not understand it clearly, but suspect that current MUI list class will not notify about list movement.
Am I correct? Then what should I ask from Thore? :)
Is there any difference on platforms about this?
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: More notifications for ListView class (please)

Post by airsoftsoftwair »

lazi wrote: Sat Oct 12, 2019 9:49 am Just tried to figure out MUI event/notify system on the MUI developer documentation. To be honest I am still do not understand it clearly, but suspect that current MUI list class will not notify about list movement.
Am I correct? Then what should I ask from Thore? :)
Is there any difference on platforms about this?
No, I don't think so. MUI supports notifications on pretty much all attributes. The fact that you can't listen to Listview.Visible is a MUI Royale limitation, not a MUI one. So I should be able to add this to MUI Royale quite easily.
lazi wrote: Mon Oct 07, 2019 3:11 am This custom listview can't be controlled with the mouse and the keyboard because there is no notifications for moving the list without
changing selection. I can't find any workaround this. Acceleration class of RapaGUI could solve the keyboard handling, but the mousewheel for a listview is so essential that can't be leave unworkable.
I could add notifications for mouse and keyboard for listviews but I'm not sure if I should do this because it's still somewhat of a hack. The bigger problem behind this is that MUI's listview doesn't work like "modern" listview implementations which just provide the data for a specific position, just like you do it. Your code somehow tries to hack that feature into MUI's listview but it would probably be better if MUI's listview implementation changed but that's easier said than done because of all the different MUI forks...
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Re: More notifications for ListView class (please)

Post by lazi »

The notify on listview.visible could solve the problem of windows resize, so please add it!

For the other I don't know, but as I seen correctly, there is an attribute which holds the pixel position of the list. If it could be use with notify we may solve the position change.
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: More notifications for ListView class (please)

Post by airsoftsoftwair »

lazi wrote: Tue Oct 15, 2019 8:35 pm The notify on listview.visible could solve the problem of windows resize, so please add it!

Code: Select all

- New: Listview.Visible now has an applicability of GN which means that you can also listen to changes
  of this attribute
lazi wrote: Tue Oct 15, 2019 8:35 pm For the other I don't know, but as I seen correctly, there is an attribute which holds the pixel position of the list. If it could be use with notify we may solve the position change.
Huh? Wasn't the other problem about keyboard and mouse control?
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Re: More notifications for ListView class (please)

Post by lazi »

Yes, but if the user using the mouse or keyboard to scroll the list, the position of the list will change. I thought that if I add two more line than visible, then it could refresh after every position change keeping one invisible line before and after the displayed list "window".

And of course thanks for your help!
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: More notifications for ListView class (please)

Post by airsoftsoftwair »

lazi wrote: Thu Oct 17, 2019 8:25 am Yes, but if the user using the mouse or keyboard to scroll the list, the position of the list will change. I thought that if I add two more line than visible, then it could refresh after every position change keeping one invisible line before and after the displayed list "window".
Hmm, still don't understand... so what else do you need? :)
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Re: More notifications for ListView class (please)

Post by lazi »

Please let me try to describe my problem once again. Maybe this time it will be more understandable.

So, I would like to display a custom listview.
Because the large amount of data, I don't want to insert them with the listview.insert method.
Only the visible entries should be inserted to the listview.
For the scrolling a separate scrollbar could be created and set up just like as we have all the data in the listview rows.
The script refreshes all the visible entries of the listview as that scrollbar changes.

The listview then really contains only the the data of the visible entries, but the user could display many more data rows.

A normal listview gadget can be controlled by mousewheel and keyboard arrows too.
This custom realization can not get any notification from the listview gadget to refresh the content when the user
press the arrow keys or using the mousewheel.

If the script could get any notification about these inputs than it could refresh content according to the list movement.
The other option is to get keyboard, mousewheel events and handle those for the listview.

The simplest solution would be enough.
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: More notifications for ListView class (please)

Post by airsoftsoftwair »

Ok, I understand it now. I could add support for getting those events but I'm not sure if I should do that because

a) it's somewhat of a hack and the result probably still won't feel like a real MUI listview. It probably would be better to improve MUI itself here, but this is going to be very difficult with all the forks out there

b) implementing keyboard and mouse listeners just for the list view gadget feels somewhat inconsistent. Support for those listeners would have to be added for all other gadgets too then but that's a lot of work :)

So I'm somewhat undecided here at the moment ;)
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Re: More notifications for ListView class (please)

Post by lazi »

What about to make notify applicability for Listview.First ?
It should be changing on list scrolling, so that would be enough to handle keayboard and mousewheel user inputs.
Post Reply