diff --git a/Source/BoldComboBox.pas b/Source/BoldComboBox.pas index 431a4e4..f230a86 100644 --- a/Source/BoldComboBox.pas +++ b/Source/BoldComboBox.pas @@ -68,6 +68,7 @@ TBoldCustomComboBox = class(TCustomComboBox, IBoldValidateableComponent, IBold fProcessingClick: Integer; fOnSelectChangedIsCalled:Boolean; fAutoSearch: boolean; + FUseMouseWheel: Boolean; function GetBoldHandle: TBoldElementHandle; procedure SetBoldHandle(value: TBoldElementHandle); function GetFollower: TBoldFOllower; @@ -117,6 +118,8 @@ TBoldCustomComboBox = class(TCustomComboBox, IBoldValidateableComponent, IBold function GetVariableList: TBoldExternalVariableList; function GetExpression: TBoldExpression; protected + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override; + function HandleApplyException(E: Exception; Elem: TBoldElement; var discard: Boolean): boolean; procedure Change; override; function ComboAllowsTextEditing(BoldProperties: TBoldStringFollowerController; Follower: TBoldFollower): Boolean; virtual; @@ -160,6 +163,7 @@ TBoldCustomComboBox = class(TCustomComboBox, IBoldValidateableComponent, IBold destructor Destroy; override; procedure DragDrop(Source: TObject; X, Y: Integer); override; property SelectedElement: TBoldElement read GetSelectedElement; + property UseMouseWheel: Boolean read FUseMouseWheel write FUseMouseWheel; end; [ComponentPlatformsAttribute (pidWin32 or pidWin64)] @@ -230,6 +234,7 @@ TBoldComboBox = class(TBoldCustomCombobox) property OnMeasureItem; property OnStartDock; property OnStartDrag; + property UseMouseWheel default False; {$ENDIF} end; @@ -417,6 +422,7 @@ constructor TBoldCustomComboBox.Create(AOwner: TComponent); FFont := TFont.Create; FFont.OnChange := FontChanged; FColor := clWindow; + FUseMouseWheel := False; end; procedure TBoldCustomComboBox.CreateWnd; @@ -448,6 +454,18 @@ procedure TBoldCustomComboBox.DoEndDrag(Target: TObject; X, Y: Integer); inherited DoEndDrag(Target, X, Y); end; +function TBoldCustomComboBox.DoMouseWheel(Shift: TShiftState; + WheelDelta: Integer; MousePos: TPoint): Boolean; +begin + if FUseMouseWheel then + begin + Result := inherited; + end else + begin + Result := True; + end; +end; + procedure TBoldCustomComboBox.DoStartDrag(var DragObject: TDragObject); begin BoldProperties.StartDrag(Follower);