Scrollbargadget EventType? [Resolved]

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Scrollbargadget EventType? [Resolved]

Post by collectordave »

Just hit a small problem.

Scrolling a grid on a canvas gadget that has variable column widths and variable row heights which means that there are a variable number of columns and or rows on any "Page" displayed.

This means that having an arbitrary number for the page setting on a scroll bar leads to some scrolling confusion in this case.

To get over this would it be possible to have some scrollbar EventTypes?

I think the whole list would be

Small Positive Change
Large Positive Change
Small Negative Change
Large Negative Change

These would allow the programmer to ignore the value of the gadget and scroll meaningfully dependant upon the application. Of course the normal change and value still need to be kept as in most situations there a more than adequate.

Regards

cd
Last edited by collectordave on Thu Jan 05, 2017 5:06 pm, edited 1 time in total.
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: Scrollbargadget EventType?

Post by Mistrel »

My opinion on this after working with native scrollbars on Windows is that this is most likely difficult to achieve in a cross-platform way without some kind of compromising interface. Don't forget that scroll events can also be triggered by a mousewheel, arrow keys, numkeys, page keys, home/end.. there's a lot of behavior to consider.

There are some interesting nuances (at least on Windows) which don't work as you might expect such as trying to query information about a scrollable area when the scrollbars are disabled.

I agree that this would be a nice addition but also expect it to be a challenge to implement.
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: Scrollbargadget EventType?

Post by collectordave »

Hi

The scrollable area I am using is a canvas gadget not the scrollarea gadget. It is my programme that dictates what is shown on that canvas. So mousewheels produce mouse wheel events and keys produce their own key events. It is my choice whether to use these events in my programme as the only conection between my canvas gadget and these events is through my programme.

So that said the scrollbar gadget is restrictive in use. When using the page value the scrollbar value does not reach maximum and the page length needs to be varied whenever scrolling up or down. Indeed a down scroll may need a different page length to an up scroll. I know the current behaviour is what is required in the majority of cases and actualy helps in most situations however as outlined above where it is not known in advance what the page length is, the programme needs control and can only take control when these events are exposed to be used.

Regards
cd
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: Scrollbargadget EventType?

Post by collectordave »

Ok resolved.

Rolled my own.

Will post code in a few minutes.

Cheers

cd
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Post Reply