Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built-in native multi-column sort support #441

Open
vincentparrett opened this issue Jan 21, 2015 · 11 comments
Open

Built-in native multi-column sort support #441

vincentparrett opened this issue Jan 21, 2015 · 11 comments

Comments

@vincentparrett
Copy link
Contributor

From gmnev...@gmail.com on June 23, 2014 18:38:39

Currently there is one-column sort support.
Which is ok, but there are several situtations where more than one-column sort is needed.
Googling for alternative returns one solution, but unfortunately it is not working like it suppose to.

I have implemented built-in native multi-column sort soluton to version 5.4.1.
It adds/extends design-time and run-time ability to sort selected columns in pre/post build time.
There is possibility to add/decrese number of sorted columns or rearange order in run-time.

Major changes are:

  • added Header.SortColumn = -2 value - it means multi-sorted,
  • deleted Columns[n].DefaultSortDirection,
  • added Columns[n].SortDirection,
  • added Columns[n].SortEnabled - on/off sort of column,
  • added Columns[n].SortOrder = -1 - not sorted at design-time or > -1 - sort index (0 - first, 1 - second, 2 - third,...)
  • modified TVirtualTreeColumn.ComputeHeaderLayout procedure,
  • modified TVirtualTreeColumns:
    • PaintHeader procedure,
    • HandleClick procedure,
  • added TBaseVirtualTree.Sort procedure overload,
  • published VTUtilityImages list and ClipCanvas procedure.

I attached sources in this issue.
I hope to apply this mod in vst sources.
Thank you,
NevTon.

Attachment: VirtualTrees541mod.zip

Original issue: http://code.google.com/p/virtual-treeview/issues/detail?id=441

@vincentparrett
Copy link
Contributor Author

From joachim....@gmail.com on June 24, 2014 14:10:10

One usually implements the OnCompare event to achieve multi column sorting. I'm not sure if this enhancement is of general interest.

In case there is a method you need virtual protected to apply this enhancement in your own derived clas, and it is not virtual protected, let us know.

Labels: -Type-Defect -Priority-Medium Type-Enhancement Priority-Low

@vincentparrett
Copy link
Contributor Author

From gmnev...@gmail.com on June 26, 2014 02:12:18

This is what I get from my enhancement (see picture).
I'm not sure if this can be achieved by making a descendant class derived from vts.

Attachment: vts_multi_column_sort.jpg

@vincentparrett
Copy link
Contributor Author

From fr0st.br...@gmail.com on November 18, 2014 03:46:22

Amazing for complex grid-like cases. IMHO worths to be included in the source, at least as demo or special derived class.

@ruslancnua
Copy link

Hello. can i have a code VirtualTrees541mod.zip?

@gmnevton
Copy link

Hi, it was 7 years ago, when I did this mod, but You are lucky that I have backup of this archive.
VirtualTrees541mod.zip
vt541_changes.zip
In file vt541_changes.rtf is summary of all changes that I did to this mod. Bold text represents what is added/modified by me.

@ruslancnua
Copy link

thanks

@MHumm
Copy link

MHumm commented Apr 27, 2021

Here's some new entry which might be related to this one: #1037

@gmnevton
Copy link

There is no need for this in my mod, because there is property TVirtualTreeColumn.SortEnabled, which is doing exactly what this sdNone would do. And even more, You do not loose last used sort direction for the column if You do it by using two properties.

@MHumm
Copy link

MHumm commented Apr 28, 2021

Ok, I didn't knew TVirtualTreeColumn.SortEnabled yet. In which version is this? I still have 7.2 installed and cannot find it there.

@gmnevton
Copy link

v5.4.1, maybe it was dropped somewhere along the road, I will look into latest sources and compare this.

@gmnevton
Copy link

Ok, I think that I added this properties to TVirtualTreeColumn because TVTHeader includes SortColumn and SortDirection properties, so to be able to sort multiple columns, You need to have this properties for each column, not for whole header only. but to be backward compatilble You need to have both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants