Wheel Scrolling in Grid Example

Discussions related to Visual Prolog
Post Reply
daveplummermd
Active Member
Posts: 78
Joined: 18 Jul 2006 17:18

Wheel Scrolling in Grid Example

Post by daveplummermd » 2 Dec 2018 3:06

Guys
Can you advise on how to introduced scrolling the GRID by mouse wheel events in the Grid example distributed with v8.+. I have scoured the forum with no luck.

Thanks in advance
Dave Plummer
Dave Plummer

daveplummermd
Active Member
Posts: 78
Joined: 18 Jul 2006 17:18

Re: Wheel Scrolling in Grid Example

Post by daveplummermd » 6 Dec 2018 17:48

OK, if interested, I got it.

1) move the declaration of "grid_vmove_cells_area" to vpiGrid.cl

2) Add listener " addVScrollListener(onVScroll)" to the clause " generatedInitialize()" in childDialog.pro

3) add the clause "onVScroll" to handle the scroll event

Code: Select all

 onVScroll(Source, ScrollCode, ThumbPosition) -      if ScrollCode = 2 then            vpiGridgrid_vmove_cells_area(activeGrid, 1)       elseif ScrollCode=  1 then            vpiGridgrid_vmove_cells_area(activeGrid, -1)        end if,        !.
Dave Plummer

Harrison Pratt
VIP Member
Posts: 275
Joined: 5 Nov 2000 0:01

Re: Wheel Scrolling in Grid Example

Post by Harrison Pratt » 7 Dec 2018 14:52

Dave,

Should vpiGridgrid_vmove_cells_area be vpiGrid::grid_vmove_cells_area ?

Add listener " addVScrollListener(onVScroll)" confuses me. Do you mean add a VScroll listener (onVScroll) ?

Also, where is activeGrid defined? I can't find it.

Thanks for digging into this. I hope your tweaks get added into the next VP update.

User avatar
Thomas Linder Puls
VIP Member
Posts: 2351
Joined: 28 Feb 2000 0:01

Re: Wheel Scrolling in Grid Example

Post by Thomas Linder Puls » 7 Dec 2018 21:22

I don't have any really good information about this, but I have a warning.

Don't make any changes in generatedInitialize it is generated (as the name and the surrounding comments implies).

Whatever you like to do in generatedInitialize do it in the constructor after the call to generatedInitialize instead.
Regards Thomas Linder Puls
PDC

Post Reply