How can I disable mouse wheel in FWH 8.10?
Thank You,
How can I disable mouse wheel in FWH 8.10?
Thank You,
Darrell,
I don't think you can. Why would you want to?
Regards,
James
Darrell,
In the class where you want to disable it, include this method:
METHOD MouseWheel( nKey, nDelta, nXPos, nYPos ) VIRTUAL
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
Thank You Antonio and James,
Antonio, can you provide sample source per James' request?
#include "FiveWin.ch"
...
OVERRIDE METHOD MouseWheel IN CLASS TXBrowse WITH MyMouseWheel
...
function MyMouseWheel( nKey, nDelta, nXPos, nYPos )
// local Self := HB_QSelf()
return nil//----------------------------------------------------------------------------//
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//----------------------------------------------------------------------------//
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 NILI 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
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,
>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
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()