Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-02

TListView sorting

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Hans-Peter Diettrich

In an review of the TListView sorting procedure I could fix most problems already. Remaining question:

Is it possible to change the parameter lists of:

TWSCustomListView.SetSort(const ALV: TCustomListView; const AType:
TSortType; const AColumn: Integer);

into

TWSCustomListView.SetSort(const ALV: TCustomListView; SortProc:
TListSortCompare; const Data: lParam);

There exists no need to pass the sorting parameters, because these are accessible in every sort procedure. Instead a custom compare function and a custom sort argument should be passed, to allow for Delphi compatible custom sorting:
TCustomListView.CustomSort(SortProc; lParam); //types to be fixed

IMO every widgetset will allow to implement above change.

DoDi

Reply by email

William Oliveira Ferreira
to Hans-Peter Diettrich

Overloading?

Send your suggestion as an overload implementation, i think will solve your problem and don't start a backward incompatible implementation... ________________________________
William de Oliveira Ferreira
Bacharel em Sistemas de Informa??o

2011/2/6 Hans-Peter Diettrich

Show quoted text 30 lines
In an review of the TListView sorting procedure I could fix most problems already. Remaining question: Is it possible to change the parameter lists of: TWSCustomListView.SetSort(const ALV: TCustomListView; const AType: TSortType; const AColumn: Integer); into TWSCustomListView.SetSort(const ALV: TCustomListView; SortProc: TListSortCompare; const Data: lParam); There exists no need to pass the sorting parameters, because these are accessible in every sort procedure. Instead a custom compare function and a custom sort argument should be passed, to allow for Delphi compatible custom sorting: TCustomListView.CustomSort(SortProc; lParam); //types to be fixed IMO every widgetset will allow to implement above change. DoDi -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110206/51a6fc3b/attachment.html>

Reply by email

Hans-Peter Diettrich
to William Oliveira Ferreira: Overloading? Send your suggestion as an overload implementation, i think will solve your…
Overloading? Send your suggestion as an overload implementation, i think will solve your problem and don't start a backward incompatible implementation...

I've just updated issue #18716, with two bugs found in the implementation. Now my ToDoList works as expected, i.e. jumps to the correct source code even after sorting the list :-)

If this topic is of general interest, and when my suggestions are implemented in the LCL, I can check the behaviour with other widgetsets, too.

DoDi

Reply by email