Recent

Author Topic: TValueListEditor - A Cell is cleared after sorting  (Read 14222 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1266
Re: TValueListEditor - A Cell is cleared after sorting
« Reply #15 on: August 20, 2018, 12:07:25 pm »
I modified Form1 you made. I just added a popup menu, and it is linked to ValueListEditor1.

You may click any cell of the ValueListEditor1, then right-click mouse, then press sort. You'll see what I'm talking about.

Precisely speaking, the Sort does not change the content of cell that is focused, when the "sorting" is carried out with TValueListEditor focused.

Bart

  • Hero Member
  • *****
  • Posts: 5265
    • Bart en Mariska's Webstek
Re: TValueListEditor - A Cell is cleared after sorting
« Reply #16 on: August 20, 2018, 01:21:40 pm »
Did you test the patch as I suggested?

It is useless to continue stating that you see a bug.
We know there is a bug.
We are trying to fix it.

Bart

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: TValueListEditor - A Cell is cleared after sorting
« Reply #17 on: August 20, 2018, 01:23:33 pm »
It's nothing but a frame containing TValueListEditor.
I don't have this unit. I am not going to build something on my own. It is too often that the code is not where the poster expects it to be. Or I do something differently from you and this bypasses the bug. So, please, post the project with all files required to compile it.

@Bart: I am insisting on this demo project because the OP may see a different bug in addition to the one you are fixing.

Bart

  • Hero Member
  • *****
  • Posts: 5265
    • Bart en Mariska's Webstek
Re: TValueListEditor - A Cell is cleared after sorting
« Reply #18 on: August 20, 2018, 11:29:13 pm »
I attached a sample project to the bugtracker.
You need to apply the valedit.sort.5.diff patch.

Run the sample project.
Click on "PickList".
Click on the row that has "MyPlainRO" (column does not matter).
Click on "Sort"
No cells content disappears, but there will be a visual anomaly "MyPlainRO" row now.

This anomaly is not there if you uncheck "Always Show Editor".

Bart

egsuh

  • Hero Member
  • *****
  • Posts: 1266
Re: TValueListEditor - A Cell is cleared after sorting
« Reply #19 on: August 21, 2018, 04:59:17 am »
I applied valedit.sort.6.diff, but the problem still exists --- the FOCUSED cell content is not changed after sorting.  My application has no problem once I move away the focus from valuelisteditor before the sorting.

BTW,  please add some documentation on TValueLsitEditor.InsertRow method^^. I cannot find it anywhere.

Bart

  • Hero Member
  • *****
  • Posts: 5265
    • Bart en Mariska's Webstek
Re: TValueListEditor - A Cell is cleared after sorting
« Reply #20 on: August 21, 2018, 09:43:27 am »
Please report that in the bugtracker issue.

Bart

Bart

  • Hero Member
  • *****
  • Posts: 5265
    • Bart en Mariska's Webstek
Re: TValueListEditor - A Cell is cleared after sorting
« Reply #21 on: August 24, 2018, 06:12:12 pm »
Fixed in r58773.
From now on (trunk) use TValueListEditor.Sort, not Strings.Sort.
You can use OnCompareCells to determine how the sort is done (so no need to alter all Keys before and after the sort in your example).
Sort defaults to sorting based on Key column, use Sort(colValue) if you want to sort on the Value's column.

Sort will hide the editor and restore it if needed afterwards.
This should prevent ugly visual anomalies and your initial issue.

Since this is new functionality I think this will not be merged into the 1.8 fixes branch.

Bart

 

TinyPortal © 2005-2018