Sign in Join

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

Mailing lists / lazarus / 2009-10

Sorting issue in ComboBox list using non-English languages

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

In a different message thread it was noted that when the Spanish language is used, sorting doesn't work correctly in ComboBox lists. I assume this will have issues with other components as well.

The combobox as a listing of class names, plus two items named: '<All>' and '<None>'.

All and None obviously in the various languages, but still including the < and > characters.

It seems the sorting algorithm in Combobox is not looking at the < and

characters and sorts the text as if those two items where 'All' and

'None' which I think is wrong.

What sorting algorithm does ComboBox and all other list containers user? Why are they ignoring < and > characters?

------[ original posting ]-------------

be '<Ninguno>'), '<All>' -> '<Todo>'. But they are sorted as if they didn't have the '<' character. For instance:

-----------------------

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Felipe Monteiro de Carvalho
to Graeme Geldenhuys
If you don't create the handle of the control then
TStringList.DoCompareText and TStringList.QuickSort are used.

If you create the handle, then the Windows API is used in Windows, setting CBS_SORT style in TWin32WSCustomComboBox.CreateHandle. Windows then sends a WM_COMPAREITEM message to the window callback routine. I couldn't find any handler for that, so whatever default from Windows is used, and I found no documentation explaining how this default works.

Reply by email

Graeme Geldenhuys
to Felipe Monteiro de Carvalho: If you don't create the handle of the control then TStringList.DoCompareText and…
Felipe Monteiro de Carvalho wrote
If you don't create the handle of the control then TStringList.DoCompareText and TStringList.QuickSort are used.

Thanks Felipe. Looking at the documentation I assumed the default TStringList.Quicksort is used. But I found it very strange that it ignored the '<' and '>' characters.

I'll do another test app and if the issue still persists, I'll file a bug report or look at the QuickSort implementation.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email