Disable Mouse Wheel on combobox controls

Disable Mouse Wheel on combobox controls

Postby don lowenstein » Tue Apr 07, 2015 5:33 pm

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
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm

Re: Disable Mouse Wheel on combobox controls

Postby Antonio Linares » Tue Apr 07, 2015 5:41 pm

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
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Disable Mouse Wheel on combobox controls

Postby don lowenstein » Tue Apr 07, 2015 5:58 pm

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
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm

Re: Disable Mouse Wheel on combobox controls

Postby Antonio Linares » Tue Apr 07, 2015 6:09 pm

Don,

Please try this,

oComboBox:bMouseWheel = { || call_to_your_dialog_scroll_code, 0 }
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

Re: Disable Mouse Wheel on combobox controls

Postby don lowenstein » Tue Apr 07, 2015 8:21 pm

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
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm

Re: Disable Mouse Wheel on combobox controls

Postby Antonio Linares » Tue Apr 07, 2015 8:24 pm

Very good :-)
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