Disable mouse wheel in FWH 8.10

Disable mouse wheel in FWH 8.10

Postby cdmmaui » Wed Dec 03, 2008 12:47 am

How can I disable mouse wheel in FWH 8.10?

Thank You,
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby James Bott » Wed Dec 03, 2008 1:19 am

Darrell,

I don't think you can. Why would you want to?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Antonio Linares » Wed Dec 03, 2008 1:25 am

Darrell,

In the class where you want to disable it, include this method:

METHOD MouseWheel( nKey, nDelta, nXPos, nYPos ) VIRTUAL
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Wed Dec 03, 2008 1:29 am

Antonio,

That is a nice simple solution!

If I remember correctly there is a way in xHarbour to override a class method so you don't have to modify the original source. Can you show us how to do it that way?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby cdmmaui » Wed Dec 03, 2008 1:42 am

Thank You Antonio and James,

Antonio, can you provide sample source per James' request?
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby Antonio Linares » Wed Dec 03, 2008 2:15 am

I am not very much used to this syntax, but I guess this may work:

Code: Select all  Expand view
#include "FiveWin.ch"
...

OVERRIDE METHOD MouseWheel IN CLASS TXBrowse WITH MyMouseWheel

...

function MyMouseWheel( nKey, nDelta, nXPos, nYPos )

   // local Self := HB_QSelf()

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rossine » Wed Dec 03, 2008 11:15 am

Hello Antonio,


Maybe you could create a "flag" to control this, ie one more appeal to xbrowse :lol:

SAMPLE:

Code: Select all  Expand view
//----------------------------------------------------------------------------//

STATIC FUNCTION BasicCell( oWnd )

   local oChild, oBrw

   DEFINE WINDOW oChild TITLE "Basic Cell selector browse" MDICHILD OF oWnd

   @ 0,0 XBROWSE oBrw OF oWnd ALIAS Alias()

   oBrw:CreateFromCode()

   oBrw:cToolTip = "This is a test"

   oBrw:lMouseWheel := .F.      // NEW

   oChild:oClient := oBrw

   ACTIVATE WINDOW oChild ON INIT oBrw:SetFocus()

RETURN NIL



Changes is XBROWSE.PRG

Code: Select all  Expand view
//----------------------------------------------------------------------------//


METHOD New( oWnd ) CLASS TXBrowse

...
::lMouseWheel := .T.
...

return Self

//----------------------------------------------------------------------------//

METHOD MouseWheel( nKeys, nDelta, nXPos, nYPos ) CLASS TXBrowse

   local aPoint := { nYPos, nXPos }

   if ! ::lMouseWheel
      return NIL
   endif

   ScreenToClient( ::hWnd, aPoint )

   if IsOverWnd( ::hWnd, aPoint[ 1 ], aPoint[ 2 ] ) .and. ;
...
return NIL
Obrigado, Regards, Saludos

Rossine.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Postby James Bott » Wed Dec 03, 2008 12:45 pm

I still wonder why you want to disable the scroll wheel?

As a user, I would not be happy about this--I use it extensively.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby cdmmaui » Wed Dec 03, 2008 4:11 pm

Hi James,

I am having a problem in which I call a modal dialog box from listbox window and the user is using the mouse wheel within the dialog to change the focus of the listbox record. I need to disable the mouse wheel only for this process.
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby James Bott » Wed Dec 03, 2008 4:19 pm

Darrell,

>I am having a problem in which I call a modal dialog box from listbox window and the user is using the mouse wheel within the dialog to change the focus of the listbox record. I need to disable the mouse wheel only for this process.

Hmm, you mean that the mouse wheel is still working when you have a modal dialog box open? By definition, you cannot have focus on anything else in the same app while a modal dialog box is open. At least this is the way it is supposed to be.

If the mouse wheel is active, then are the arrow keys active also?

Further, Antonio's solution is not going to work for you since you want to be able to turn on and off the mouse wheel depending on a condition.

I think that there is either a flaw in your design, or a bug in FW if this is what is happening.

Maybe you meant a "non-modal" dialog?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Antonio Linares » Wed Dec 03, 2008 10:08 pm

Darrell,

If you just want to temporarly disable the user input on the browse, then you can do:

oBrowse:Disable()

and later on, when you are done:

oBrowse:Enable()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 83 guests