FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Disable Mouse Wheel on combobox controls
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Disable Mouse Wheel on combobox controls
Posted: Tue Apr 07, 2015 05: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Disable Mouse Wheel on combobox controls
Posted: Tue Apr 07, 2015 05: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
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Re: Disable Mouse Wheel on combobox controls
Posted: Tue Apr 07, 2015 05: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Disable Mouse Wheel on combobox controls
Posted: Tue Apr 07, 2015 06:09 PM
Don,

Please try this,

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

Antonio Linares
www.fivetechsoft.com
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Re: Disable Mouse Wheel on combobox controls
Posted: Tue Apr 07, 2015 08: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Disable Mouse Wheel on combobox controls
Posted: Tue Apr 07, 2015 08:24 PM

Very good :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion