diff options
Diffstat (limited to 'vcl/source/control/combobox.cxx')
-rw-r--r-- | vcl/source/control/combobox.cxx | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 42abe3fd248a..49c7e5457da7 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -142,23 +142,19 @@ void ComboBox::ImplCalcEditHeight() if ( !IsDropDownBox() ) mnDDHeight += 4; - // FIXME: currently only on aqua; see if we can use this on other platforms - if( ImplGetSVData()->maNWFData.mbNoFocusRects ) + Region aCtrlRegion( Rectangle( (const Point&)Point(), Size( 10, 10 ) ) ); + Region aBoundRegion, aContentRegion; + ImplControlValue aControlValue; + ControlType aType = IsDropDownBox() ? CTRL_COMBOBOX : CTRL_EDITBOX; + if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL, + aCtrlRegion, + CTRL_STATE_ENABLED, + aControlValue, rtl::OUString(), + aBoundRegion, aContentRegion ) ) { - Region aCtrlRegion( Rectangle( (const Point&)Point(), Size( 10, 10 ) ) ); - Region aBoundRegion, aContentRegion; - ImplControlValue aControlValue; - ControlType aType = IsDropDownBox() ? CTRL_COMBOBOX : CTRL_EDITBOX; - if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL, - aCtrlRegion, - CTRL_STATE_ENABLED, - aControlValue, rtl::OUString(), - aBoundRegion, aContentRegion ) ) - { - const long nNCHeight = aBoundRegion.GetBoundRect().GetHeight(); - if( mnDDHeight < nNCHeight ) - mnDDHeight = sal::static_int_cast<USHORT>( nNCHeight ); - } + const long nNCHeight = aBoundRegion.GetBoundRect().GetHeight(); + if( mnDDHeight < nNCHeight ) + mnDDHeight = sal::static_int_cast<USHORT>( nNCHeight ); } } @@ -876,10 +872,19 @@ long ComboBox::Notify( NotifyEvent& rNEvt ) (rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL) && (rNEvt.GetWindow() == mpSubEdit) ) { - if( ! GetSettings().GetMouseSettings().GetNoWheelActionWithoutFocus() || HasChildPathFocus() ) + USHORT nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() ); + if ( ( nWheelBehavior == MOUSE_WHEEL_ALWAYS ) + || ( ( nWheelBehavior == MOUSE_WHEEL_FOCUS_ONLY ) + && HasChildPathFocus() + ) + ) + { nDone = mpImplLB->HandleWheelAsCursorTravel( *rNEvt.GetCommandEvent() ); + } else + { nDone = 0; // don't eat this event, let the default handling happen (i.e. scroll the context) + } } return nDone ? nDone : Edit::Notify( rNEvt ); |