VScroll with mouse wheel

VScroll with mouse wheel

Postby Rafael Clemente » Tue Apr 17, 2007 8: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
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Postby Antonio Linares » Tue Apr 17, 2007 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41450
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rafael Clemente » 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
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Postby Antonio Linares » Tue Apr 17, 2007 2: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41450
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rafael Clemente » Tue Apr 17, 2007 2:51 pm

Thanks, Antonio. I'll try and see what happens...
Rafael
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Postby Rochinha » Mon Apr 23, 2007 9:52 pm

Rochinha
 
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Otto and 127 guests