[lazarus] Treeview scrollbars
Mattias Gaertner
nc-gaertnma at netcologne.de
Sun Dec 21 09:22:21 EST 2003
On Sun, 21 Dec 2003 15:12:56 +0100 Micha Nelissen <micha at neli.hopto.org>
wrote:
> Hi,
>
> On win32 treeviews always schow scrollbars, which is quite annoying
> because they are not always necessary. I think I have found the problem:
> the SCROLLINFO record passed when calling SetScrollInfo has the
> following property:
>
> ---
> The SetScrollInfo function performs range checking on the values
> specified by the nPage and nPos members of the SCROLLINFO structure. The
> nPage member must specify a value from 0 to nMax - nMin +1. The nPos
> member must specify a value between nMin and nMax - max(nPage - 1, 0).
> If either value is beyond its range, the function sets it to a value
> that is just within the range.
> ---
>
> The lcl always passes nPage <= nMax, because GetMaxScrollLeft always
> returns a value >= 0 and nMax is:
>
> ScrollInfo.nMax := Max(1,GetMaxScrollLeft+integer(ScrollInfo.nPage));
>
> But only when setting nPage > nMax ( == nPage = nMax+1 ) the scrollbar
> will disappear. I have tried some fiddling around, but it didn't work as
> I wanted, and I am not familiar with the code at all. Can someone make a
> suggestion?
Not really a suggestion:
I implemented ssAutoHorizontal, ssAutoVertical, ssAutoBoth for TTreeView.
Mattias
More information about the Lazarus
mailing list