FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour VScroll with mouse wheel
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
VScroll with mouse wheel
Posted: Tue Apr 17, 2007 08:45 AM

I am using the TScrWnd class (in \Samples\TestWScr.prg) to perform VScroll in a window. It works fine, but does not handle the wouse wheel. Has anybody modified this class (or an equivalent one) to perform mouse wheel vertical scroll?
Thanks
Rafael

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
VScroll with mouse wheel
Posted: Tue Apr 17, 2007 09:19 AM

Rafael,

You may review Class TWBrowse Method MouseWheel() source code.

Its quite simple and surely you can easily adapt it to your needs :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
VScroll with mouse wheel
Posted: Tue Apr 17, 2007 10:28 AM

Antonio:
Just to try, after studying the wbrowse class, I added Method MouseWheel() Inline MsgInfo("Hello") to the TScrWnd class. As it was suspecting, it didn't do anything. How can I make that class to be aware of that new method, could you give me a hint?
Rafael

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
VScroll with mouse wheel
Posted: Tue Apr 17, 2007 02:31 PM

Rafael,

Class TScrWnd does not inherits from Class TWindow, instead it is a container Class, as it "contains" a TWindow object (oWnd)

A possible solution though not very "technical" is to change the Method MouseWheel() of Class TWindow dinamically using __clsModMsg() but it has the side effect problem that all TWindows objects will change their behaviors too, which it is not desirable

In fact the right solution is to inherit from Class TWindow and redefine the Method MouseWheel(), so Class TScrWnd would become an inherited class, not a container class

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
VScroll with mouse wheel
Posted: Tue Apr 17, 2007 02:51 PM

Thanks, Antonio. I'll try and see what happens...
Rafael

Posts: 310
Joined: Sun Jan 08, 2006 10:09 PM
VScroll with mouse wheel
Posted: Mon Apr 23, 2007 09:52 PM

Continue the discussion