Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MouseWheel and scrolling in grids
Message
From
12/11/2018 19:34:47
 
 
To
12/11/2018 12:22:47
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01663284
Message ID:
01663290
Views:
104
Likes (1)
>Hi all,
>
>Funny when you are re-testing a client app and something that seemed so "normal" years ago now seems not so...I was testing changes to a grid that loads quite a few records and was hitting the mouse wheel expecting the grid to scroll downwards. In most places in this app, there are not that many records so really have not done anything with the mousewheel stuff.
>
>Looking at the default code (VMP framework), there is really nothing there to move the record pointer in the grid (their code just grabs the parameters). It looks like I have to code for this myself - does VFP not put a default behavior for scrolling?
>
>Sorry for the "duh" question but have never really needed the scrolling before (and all my "Hackers Guide" books etc are packed away in prep for a move).
>
>Thanks,
>Albert

This may help, this is from one of my Grid control's MouseWheel event. It doesn't change the record pointer position, I'm sure it can be fit in somehow.
LPARAMETERS nDirection, nShift, nXCoord, nYCoord

*!*	Scroll command  Scroll action  
*!*	0				 Scroll up
*!*	1				 Scroll down
*!*	2				 Scroll page up
*!*	3				 Scroll page down
*!*	4				 Scroll left
*!*	5				 Scroll right
*!*	6				 Scroll page left
*!*	7				 Scroll page right

DODEFAULT( nDirection, nShift, nXCoord, nYCoord )

LOCAL llSHIFT AS Boolean, llCTRL AS Boolean, llALT AS Boolean 
llNone 		= m.nShift = 0
llSHIFT		= BITTEST(m.nShift,0)
llCTRL		= BITTEST(m.nShift,1)
llALT		= BITTEST(m.nShift,2)

DO case
CASE llAlt AND llCtrl AND nDirection > 0	&& Alt+Ctrl+
	this.DoScroll( 6 )		&& page left
CASE llAlt AND llCtrl AND nDirection < 0	&& Alt+Ctrl+
	this.doscroll( 7 )		&& page right
CASE llCtrl AND nDirection > 0	&& Ctrl+
	this.DoScroll( 2 )		&& pageup
CASE llCtrl AND nDirection < 0	&& Ctrl+
	this.doscroll( 3 )		&& pagedown
CASE llAlt AND nDirection > 0	&& Alt+
	this.DoScroll( 4 )		&& left
CASE llAlt AND nDirection < 0	&& Alt+
	this.doscroll( 5 )		&& right
CASE llNone AND nDirection > 0
	this.DoScroll( 0 )		&& scroll up
CASE llNone AND nDirection < 0
	this.doscroll( 1 )		&& scroll down
ENDCASE 

RETURN 
Greg Reichert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform