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.
Disable Mouse Wheel on combobox controls
- don lowenstein
- Posts: 196
- Joined: Mon Oct 17, 2005 9:09 pm
- Contact:
Disable Mouse Wheel on combobox controls
Don Lowenstein
www.laapc.com
www.laapc.com
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Disable Mouse Wheel on combobox controls
Don,
Please try this and let me know if the combobox keeps scrolling, thanks
oComboBox:bMouseWheel = { || call_to_your_dialog_scroll_code }
Please try this and let me know if the combobox keeps scrolling, thanks
oComboBox:bMouseWheel = { || call_to_your_dialog_scroll_code }
- don lowenstein
- Posts: 196
- Joined: Mon Oct 17, 2005 9:09 pm
- Contact:
Re: Disable Mouse Wheel on combobox controls
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
**************************************************
//----------------------------------------------------------------------------//
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
www.laapc.com
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Disable Mouse Wheel on combobox controls
Don,
Please try this,
oComboBox:bMouseWheel = { || call_to_your_dialog_scroll_code, 0 }
Please try this,
oComboBox:bMouseWheel = { || call_to_your_dialog_scroll_code, 0 }
- don lowenstein
- Posts: 196
- Joined: Mon Oct 17, 2005 9:09 pm
- Contact:
Re: Disable Mouse Wheel on combobox controls
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
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
www.laapc.com
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: