[Gambas-user] combobox scrolling

Bruce Steers bsteers4 at gmail.com
Fri Oct 27 23:37:01 CEST 2023


On Fri, 27 Oct 2023 at 15:06, Fabien Bodard <gambas.fr at gmail.com> wrote:

>
>
> Le ven. 27 oct. 2023 à 15:37, Benoît Minisini <
> benoit.minisini at gambas-basic.org> a écrit :
>
>> Le 27/10/2023 à 15:32, Fabien Bodard a écrit :
>> >
>> >
>> >     I'm trying this code in the ScrollArea.class
>> >     DrawingArea_MouseWheel() event...
>> >
>> >        D = Max(Me.Font.Size, $hDrawingArea.ClientH - (Me.Font.Size * 4))
>> >
>> >     It's working a treat :)
>> >     I subtracted "- (Me.Font.Size * 4)" from ClientH so it scrolls a
>> >     little less than a full page.
>> >
>> >     Respects
>> >     BruceS
>> >
>> >
>> > depend of your page :-) ...  and of the desktop resolution
>> >
>>
>> I think the solution is using the minimum value between Desktop.Scale *
>> 60 and something like half of Client.Height (or Width depending on the
>> scrolling direction).
>>
>> Regards,
>>
>>
> I'm agree... but it not explain how it can work in mac world ... fixed 60
> px ... on a list of 3 element ?
>

I think I'd generally just like it to scroll a little bit less than the
visible page so i went with this in the end making it move 84% either way...

   If Mouse.Orientation = Mouse.Horizontal Or If $H <= $hDrawingArea.H Then
    D = Max(Desktop.Scale, $hDrawingArea.ClientW - ($hDrawingArea.ClientW /
6))
    Scroll($iScrollX - Mouse.Delta * D, $iScrollY)
  Else
    D = Max(Desktop.Scale, $hDrawingArea.ClientH - ($hDrawingArea.ClientH /
6))
    Scroll($iScrollX, $iScrollY - Mouse.Delta * D)
  Endif

But that's just me ;)

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20231027/045536e9/attachment-0001.htm>


More information about the User mailing list