Page 1 of 1

Add a property to the listViewControl

Posted: 1 Mar 2024 7:50
by Faddey
Dear Thomas!
There is a facts in implement listViewControl:

Code: Select all

facts - lv_sorting_db     ...     sortingOrder : order := unsorting.     sortingColumnNumber : unsigned := 0.
Is it possible to add a property to the listViewControl.i interface:

Code: Select all

properties      sortingOrder: order.      sortingColumnNumber : unsigned .
Then you can always know how the list in the listViewControl is sorted.
Every time I update Visual Prolog I do it myself, which is not a good solution.
Best regards, Faddey.

Re: Add a property to the listViewControl

Posted: 1 Mar 2024 10:29
by Thomas Linder Puls
No, I think that is a bad idea.

There are several ways to sort the items in a listViewControl and the mentioned facts are only used in some cases, with other sort methods the are misleading.

If the code was made today I don't think those facts would exist at all.

Anyway, your statement: "Then you can always know how the list in the listViewControl is sorted." is actually not correct. It may be correct for your applications, but if you sort the items using another method then these facts do not reflect anything.

Furthermore, if you continue to "export" the facts you should only "read" them, to set them you should call sortItems. So I suggest you make the properties out-only:

Code: Select all

properties     sortingOrder : order (o).     sortingColumnNumber : unsigned (o).

Re: Add a property to the listViewControl

Posted: 1 Mar 2024 11:38
by Faddey
Of course, these properties should only be external. I just forgot to add (o).
Best regards, Faddey.