[Lazarus] How to create a listbox that can be shifted

Sven Barth pascaldragon at googlemail.com
Thu Apr 25 09:48:42 CEST 2013


Am 25.04.2013 09:40, schrieb zeljko:
> On 04/25/2013 09:34 AM, Sven Barth wrote:
>> Am 25.04.2013 07:10, schrieb Jürgen Hestermann:
>>>
>>> Am 2013-04-24 20:25, schrieb Jesus Reyes:
>>>>
>>>>> Still I am wondering why nobody seems to miss a horizontal
>>>>> shift for TListBox and TStringGrid (especially because a
>>>>> slider is shown for TStringGrid but does not work). Are
>>>>> these bugs which nobody discovered since years? I can't
>>>>> believe it.
>>>>>
>>>> Do you know if is there a bug report about it?, if not, please feel
>>>> free to submit one (I'm talking about the TStringGrid).
>>>>
>>>>
>>>
>>> As others told me these are all limitations of the underlying
>>> widgetset (in this case Win32 GUI) so it cannot be fixed within 
>>> Lazarus.
>>>
>> But AFAIK one can enforce a horizontal scroll bar for a list box. This
>> can be seen here for example:
>> http://www.delphitricks.com/source-code/components/show_a_horizontal_scrollbar_in_a_listbox.html 
>>
>>
>> So one might need to adjust the TListBox implementation to support this
>> as well (and I simply assume for now that the other widgetsets also
>> support a horizontal scrollbar in a list box...).
>
> Afair in lazarus TListBox.ScrollWidth := 
> Canvas.textWidth(longeststring) works (at least with qt widgetset).
I looked at the code. The Win32 implementation does exactly what is 
mentioned in the link and an GTK2 implementation exists as well. Only 
Carbon does not seem to be implemented.

So for the majority of the widgetsets this seems to be implemented already.

Regards,
Sven




More information about the Lazarus mailing list