Discussions related to Visual Prolog
Faddey
Posts: 14
Joined: 11 Mar 2018 16:09

Add a property to the listViewControl

Unread post 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.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1401
Joined: 28 Feb 2000 0:01

Re: Add a property to the listViewControl

Unread post 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).
Regards Thomas Linder Puls
PDC
Faddey
Posts: 14
Joined: 11 Mar 2018 16:09

Re: Add a property to the listViewControl

Unread post by Faddey »

Of course, these properties should only be external. I just forgot to add (o).
Best regards, Faddey.
Post Reply