Disable Mouse Wheel on combobox controls

Post Reply
User avatar
don lowenstein
Posts: 196
Joined: Mon Oct 17, 2005 9:09 pm
Contact:

Disable Mouse Wheel on combobox controls

Post by don lowenstein »

How can I "turn off" the wheel of the mouse in a combo-box?

My problem is, if focus is on a combo-box and the user wishes to scroll a dialog, the combobox values change by default, in stead of the dialog scrolling with the mouse wheel as it does with control on a different type of control.
Don Lowenstein
www.laapc.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Disable Mouse Wheel on combobox controls

Post by Antonio Linares »

Don,

Please try this and let me know if the combobox keeps scrolling, thanks

oComboBox:bMouseWheel = { || call_to_your_dialog_scroll_code }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
don lowenstein
Posts: 196
Joined: Mon Oct 17, 2005 9:09 pm
Contact:

Re: Disable Mouse Wheel on combobox controls

Post by don lowenstein »

I've tried this in my DEFAULT Method for this class. The value does in fact scroll, after going thru my logic. Somewhere the event is handled at a Super: level after control goes thru this method.

**************************************************
//----------------------------------------------------------------------------//

METHOD Default() CLASS TDComboBox

Local cStart
::bmousewheel := { | | ::ComboWheel() }

...
more lines of code from your Default Method
...

RETURN NIL



*******************************************************************

METHOD ComboWheel() CLASS TDComboBox
LOCAL RETVAL, X

altd( )

RETURN NIL

*************************************************

the mouse wheel goes thru this function, but, it is
Don Lowenstein
www.laapc.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Disable Mouse Wheel on combobox controls

Post by Antonio Linares »

Don,

Please try this,

oComboBox:bMouseWheel = { || call_to_your_dialog_scroll_code, 0 }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
don lowenstein
Posts: 196
Joined: Mon Oct 17, 2005 9:09 pm
Contact:

Re: Disable Mouse Wheel on combobox controls

Post by don lowenstein »

Your suggestion did in fact disable the scroll on the ComboBox.

My goal was to scroll the dialog (when it did not all fit on the screen) with the mouse wheel. In order to re-direct the mousewheel event to the dialog my combo-box scroll method looks like below. This works great.


METHOD ComboWheel( nKeys, nDelta, nXPos, nYPos) CLASS TDComboBox

LOCAL RETVAL, X
LOCAL ODLG := SELF:OWND

RETVAL := EVAL( ODLG:BMOUSEWHEEL, nKeys, nDelta, nXPos, nYPos )

RETURN RETVAL
Don Lowenstein
www.laapc.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Disable Mouse Wheel on combobox controls

Post by Antonio Linares »

Very good :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply