Commit 064a10f5 authored by Jesus's avatar Jesus
Browse files

LCL: UpdateRecord on DbCombobox mousewheel selection, resolves issue #32383

git-svn-id: trunk@58921 -
parent 41ea7084
......@@ -737,6 +737,7 @@ Type
procedure CloseUp; override;
Procedure Select; override;
procedure DataChange(Sender: TObject); virtual; abstract;
function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure Change; override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
......@@ -1887,6 +1888,7 @@ CONST
DBCBEVENT_CHANGE = 1; // CustomDBCombobox Detected change event
DBCBEVENT_SELECT = 2; // CustomDBCombobox Detected select event
DBCBEVENT_CLOSEUP = 4; // CustomDBCombobox Detected closeup event
DBCBEVENT_WHEEL = 8; // CustomDBCombobox Detected mousewheel event
{$Include dblookup.inc}
{$Include dbedit.inc}
......
......@@ -91,8 +91,11 @@ begin
FDatalink.Modified;
if FDetectedEvents and DBCBEVENT_CHANGE <> 0 then
inherited Change;
if FDetectedEvents and DBCBEVENT_SELECT <> 0 then
if FDetectedEvents and DBCBEVENT_SELECT <> 0 then begin
if FDetectedEvents and DBCBEVENT_WHEEL <> 0 then
FDatalink.UpdateRecord;
DoOnSelect;
end;
end;
if FDetectedEvents and DBCBEVENT_CLOSEUP <> 0 then
DoOnCloseUp;
......@@ -171,6 +174,13 @@ begin
FDetectedEvents := FDetectedEvents or DBCBEVENT_SELECT;
end;
function TCustomDBComboBox.DoMouseWheel(Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint): Boolean;
begin
Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos);
FDetectedEvents := FDetectedEvents or DBCBEVENT_WHEEL;
end;
procedure TCustomDBComboBox.Notification(AComponent: TComponent; Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment